[ALUG] RPi SD backup/restore

steve-ALUG at hst.me.uk steve-ALUG at hst.me.uk
Wed Sep 20 21:09:34 BST 2017

On 20/09/17 12:53, Mark Rogers wrote:
> On 19 September 2017 at 17:58, <steve-ALUG at hst.me.uk> wrote:
>> Could you not just use the built-in sd-card backup/cloning utility?
> Which one do you mean? I'm aware of one that clones a running Pi to an
> SD card in a USB port connected to the Pi, but that doesn't really
> lend itself to keeping backups off the Pi.

SD Card copier, described here:

>> If you don't want to back-up to a separate sd card or USB stick, you
>> could use a mock drive (I think you create a fixed-size file, then
>> format it, then mount it) and backup to that.
> That would create a 4GB backup of a 4GB SD card though, which I'm
> tying to avoid. (Yes it compresses, but not as well or as quickly as
> using tar to backup just the files in the first place).

The SD Card copier can and does create an image suitable for the media 
you are copying too.  If you copy from a 4GB card to an 8GB, it will 
expand the partitions to use all the free space.  Similarly, it will 
down-size.  If you work out how much actual space is used and create the 
"fake drive" of just that size plus a bit of leeway, then you, create a 
minimal-ish backup.

You say above that sd-sd copying doesn't lend itself to keeping 
backups.  I respectfully disagree.  Back in the day I had loads of 
backup disks, so backup SDs is hardly different, but more importantly, 
that's why I suggested making a fake drive from a file.  Once created 
just move the file to a backup location, or you may be able to create 
the file for a fake drive on a network drive, and mount and backup to it 
without having to move it at all.

>> I also have a daily Backuppc backup.  Backuppc
>> is a pig to set up, but, when it works, it works well.
>> It has the advantage (and possible pitfall), that it
>> backs up only one copy of a file - so if you have 2
>> Pis and 2 linux machines, and they all have the
>> same version of a library file installed, only one
>> copy will be saved.  This saves tons of space.  The
>> disadvantage of course is that if that copy of the
>> file gets corrupted, then all the copies will be corrupted.
> I use backuppc for other things here in the office. However I wanted
> something much smaller and simpler to work only with the Pi.

Hmm,  once set up, the backuppc pi backup is quick, reliable and only 
backs up what you want it to, and what has changed.  If you have already 
got a backuppc server set up,  all you'd have to set up is the client 
config.  To be honest I'd have thought that's a lot easier than writing 
your own backup system!


More information about the main mailing list