[ALUG] RPi SD backup/restore

Mark Rogers mark at more-solutions.co.uk
Thu Sep 21 10:03:36 BST 2017


On 20 September 2017 at 21:09,  <steve-ALUG at hst.me.uk> wrote:
> SD Card copier, described here:
> https://www.raspberrypi.org/blog/another-update-raspbian/

OK, that looks like the one I had looked at.

> The SD Card copier can and does create an image suitable for the media you
> are copying too. [...]   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.

That's a thought, although calculating that minimum size wouldn't be
easy would it? (It's not just how much space is used on the disk,
unless the sectors have been used consecutively.)

> You say above that sd-sd copying doesn't lend itself to keeping backups.  I
> respectfully disagree.

If you want a faithful bit-copy then that's fine, but how do you adapt
the image approach to not include (for example) log or temporary
files?

> 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 what I wanted was rolling backups of a live system that would make
sense, but what I'm after are snapshots that I can use to "clone" the
SD card, and when I say "I" I also mean other people if needed.

I think the problem is in how I framed the original post. My objectives are:
- To have something I run offline (not from the Pi). I need to be able
to clone multiple cards etc without having a Pi up and running. (As an
aside, that also means I can do the work on a USB3 port on my desktop
which speeds things up.)
- For the backups to be as small as possible and not include
irrelevant files (eg logs)
- For backups and restores to be as fast as possible. In particular,
not reading from/writing to unused parts of the SD cards
- For backup files to be "accessible", in that it is as trivial as
possible to extract files from them, compare backups etc.
- For the backup/restore process to be self contained (not needing
other tools) so that other people can use it with minimal overhead.

As an aside, I mentioned yesterday that I should have used Python for
cross-platform, forgetting that 90% of what the script does is calling
external tools like mkfs.ext4 which aren't going to be present on a
non-Linux system. Doh!

-- 
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER



More information about the main mailing list