Thursday 7 February 2013

Back Up the Pi

Easiest to do, with the samba share working, was copy the contents of the pi user directory to a directory on my mac, which gets backed up by time machine. That still leaves backing up an image of the full system, with all the permissions and everything. I put the card in the reader did the "About This Mac" thing again. This time the card reader was listed as disk2s1 instead of disk3s1 (probably because I didn't have the USB key connected) so I typed:


mkdir RaspberryPi
cd RaspberryPi
sudo dd if=/dev/rdisk2 of=rwspi20120207.img bs=1m


in the mac terminal window. There were lots of disk noises, but no other response to the terminal for a long time. (1050 seconds is 17 1/2 minutes but it seemed longer)


15271+0 records in
15271+0 records out
16012804096 bytes transferred in 1050.493195 secs (15243130 bytes/sec)

resulted in a 16 GB .img file on my mac for the 16 GB card size. I ejected the card and put in another 16 GB card. I erased the partition that existed on the card, then reversed the if/of arguments to produce a copy:

sudo dd of=/dev/rdisk2 if=rwspi20120207.img bs=1m
15271+0 records in
15271+0 records out
16012804096 bytes transferred in 1123.638986 secs (14250844 bytes/sec)

took less time to write than I expected. I ejected the SD, put it in the Pi and it booted just like the original. 

Dropbox would be cool to have, but a little googling suggests it would be difficult.

No comments:

Post a Comment