Mark one online network backup of Raspberry Pi

Ok, heres how I’m doing it

I have an FTP Server on the network address 10.0.0.1

On the Raspberry Pi I installed curlftpfs which will enable me to connect to the ftp server

apt-get install curlftpfs

Now I need to make a mount point so in /mnt I create a folder called server

now I run

curlftps -o allow_other -o umask=000 usr:pswd@10.0.0.1 /mnt/server

where usr = your servers ftp user name and pswd = ftp server password

The above command will mount the ftp server share in your new /mnt/server/ folder on the RPI, and you will be able to browse, read and write to this folder at will.

The command will have to be run once every time you restart the pi, its not persistent

Now for the actual back up command, I have chosen to use dd as the means of back up, not ideal it creates a large file, the same size as the SD card on the pi. My reason for this method is that the two times my pi has fallen over its been due to corrupt filesystem and has required the whole OS to be reinstalled. So my backup image needs to be a bootable whole disk image (.dmg)

The mount command is done and now I run the following:

dd bs=1M if=/dev/mmcblk0 of=/mnt/server/RPI_Backup.img

Where mmcblk0 is the rpi sd card, and RPI_Backup.img is the disk image on the server

I have a 16GB SD card and it takes about an hour to complete.

I haven’t written a script to automate it yet as I’m happy just to be able to do the whole disk backup at all while online as the previous methods involved removing the card from the rpi and using windiskimager on a pc (yuk) = downtime which is unacceptable.

Note: I am manually saving the .img images as a sequence on the server so i can maintain some sort of incremental system. RPI_Backup1.img >>> RPI_Backup2.img >>> RPI_Backup3.img etc, cumbersome but effective and way way easier than reinstalling raspbian removing all the crap and setting up everything just right!

 

Feel free to add corrections or comments

🙂

Advertisements
This entry was posted in faf. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s