Backing up a Raspberry Pi to a File Transporter

I love the Magpi Magazine for Raspberry Pi owners. It has the feel of the old computer magazines from the 80s when I was a kid. In the last two issues there is a two part series on backing up your Raspberry Pi by Norman Dunbar. You can get the magazine for free though I encourage you to buy a subscription if you like it to support their efforts. You can start with the first part on page 12 of Issue #9 for Feb 2013. I will touch on the basics below but leave the details for Norman’s articles.

In my case having just made the mount over to the transporter worked out great. Let’s walk through the steps of making the image backup to the transporter folder. That will not only give you a backup but an offsite one too as the transporter syncs it off to another location.

Determine the device name of the sd card

First we need to get the device name of the sd memory card our Raspberry Pi is running on. Log into the Pi and run the following command.

Shell

1

2

3

4

5

6

7

8

9

10

11

>sudo fdisk-l

Disk/dev/mmcblk0:8010MB,8010072064bytes

4heads,16sectors/track,244448cylinders,total15644672sectors

Units=sectors of1*512=512bytes

Sector size(logical/physical):512bytes/512bytes

I/Osize(minimum/optimal):512bytes/512bytes

Disk identifier:0x00016187

Device Boot Start EndBlocks IdSystem

/dev/**mmcblk0**p1819212287957344cW95 FAT32(LBA)

/dev/**mmcblk0**p212288015644671776089683Linux

We can see that the partitions on the card start with “mmcblk0″ and that is the part we need.

Run the backup to our mounted transporter drive

The backup will take a while to write especiallly if you have an 8GB or more card. You will not get a progress indicator. You will know it is done when you see records output lines.

Confirm the backup is over on the transporter

Shell

1

2

3

4

5

>ls-lh/home/pi/transporter/raspi

total7.5G

drwxrwxrwx0root root0Sep2600:06Python

-rwxrwxrwx0root root7.5GMar523:18Rpi-Backup.img

That is all there is to it. You have an image backup of your active sd card running your Raspberry Pi.
Check out Norman’s two part series on all the other neat tricks such as mounting the image to pull out files.