We chatting about the Raspberry Pi on the recording for this weeks podcast (out tomorrow) and I mentioned that I found every time I got my Raspberry Pi setup 100% I would try one more thing and break it (my fault not the fault with the Raspberry Pi) which meant I would have to rebuild the whole system again. So rather than start from scratch each time I have started backing up the SD card giving myself a nice starting point. So I thought I would write up the tip for the blog to hopefully save others from starting from scratch each time. I am sure there are other ways of achieving the same results but works for me.

The first thing you need is a Linux machine with an SD card reader (or Mac as I believe it should work on OSX as well), if you don’t have machine setup you can get a Linux Live CD (I used Ubuntu and booted from a USB stick).

You will need to know the device name of your SD card, mine comes up as mmcblk0. One way of checking the name is to the load the disk tool GParted, this list the disks on a dropdown on the top right of the display and the size should match the size of the SD Card.


To make a backup load a terminal session and from the command prompt type:

SUDO DD if=/dev/mmcblk0 of=/home/Ian/backup.img

Where mmcblk0 is your SD card and /home/Ian is the folder where you want to store the image. I used an external drive which was labels DATA so my backup is

SUDO DD if=/dev/mmcblk0 of=/DATA/backups/debian.img

If you need to copy the image back to the SD card then you would use something like this (using the location of your backup file)

sudo dd if=/DATA/backups/debian.img of=/dev/mmcblk0

So now when I try one more thing and do something stupid l have a recent backup ready to go.

Leave a Reply