Bananian

[Guide] Backup your Bananian

3 4081
jkw  
Post Last Edited by jkw at 2014-10-6 20:26

Hey guys, if you are interested in backing/clone up your Pi, running Bananian you should check out this modified version of BillW's rpi-clone:

pi-clone
get it via git
  1. git clone https://github.com/KoljaWindeler/pi-clone.git
Copy the Code
or http download
  1. wget https://github.com/KoljaWindeler/pi-clone/archive/master.zip
Copy the Code
BillW outstand easy way cloning your actively running OS to your sd card is
  1. sudo ./pi-clone sda
Copy the Code
assuming that you just have one sd card installed via USB-cardreader (besides the one with your OS)

Besides renaming the script I've added a command mounting the boot partition before running the script, required for Bananian.
In addition you can now run that script from a cronjob by using the added "--yes-to-all" option or "-y" to skip all questions.
Also: If you don't have as many backup SD cards as Pi's, you could use this method I've added: use a flash drive instead of
a SD card in a cardreader and run as usually
  1. sudo pi-clone sda
Copy the Code
again assuming that you just have one flash drive installed.

After you have successfully destroyed your pi, just power it down, grab the SD card and the flash drive and go to a different pi (or a pc) and run
  1. sudo pi-clone sda sdb
Copy the Code
assuming that you have plugged in the backup flash drive first and than the card reader with the destroyed bananian on it.

Always be careful with a multidrive setup: For the restore mode the syntax is: pi-clone SOURCE DESTINATION
And as always: Never trust a script you downloaded from the Internet, so please read and understand the script.
Maybe we can add even more feature to it.

Prost,
JKW
tkaiser  
Since one main difference between rPi and bPi is the existing SATA port a version of the script helping with an old laptop drive (or a freshly bought HDD) as backup target would be great (asking how many partitions of which size should be created on the HDD, labeling them accordingly to the different SD cards so that automatic mode would work without user intervention)

jkw  
nice idea, if there is a connected harddrive offering enough space one could write an image file instead of a partition, what do you think about that? that would make it possible to have "versions" of backups .. like pi-clone /mnt/harddrive/backup/monday.img ...
Interesting ... ;)

tkaiser  
Reply 3# jkw

an image file instead of a partition, what do you think about that? that would make it possible to have "versions" of backups


That would be a waste of disk space since the images would always be rather large even if only a small amount of contents has changed. You could do a differential sync approach using partitions on the backup target with rsync keeping old versions using hardlinks (see eg. this http://earlruby.org/2013/05/crea ... rd-links-and-rsync/ explanation) and therefore only consuming the amount of space that changed between different syncs. But I'm afraid that this would complicate the handling (especially 'restore') too much. But if done properly it would be a huge gain compared to the original version

You have to log in before you can reply Login | Sign Up

Points Rules