I seem to be able to find lots of guides for backing up my PI that involve taking the SD card out, or running dd and hoping nothing changes.
But is there any way to take a proper, system-level, backup of my PI onto a NAS? I know with LVM you can use snapshots, but Raspian doesn't use LVM. Is there another way?
To be clear - I want to backup the entire SD card, so if it fails, I can grab a new one and restore. Or if I install too much crap and break the OS I can roll back.
dd
for backups! There is some very bad advice around about that. – goldilocks Mar 06 '15 at 14:17dd
... And I believe there is a newer thread (possible dupe if this one) which I just cannot find right now. – Ghanima Mar 06 '15 at 14:20dd
, it's just silly. – goldilocks Mar 06 '15 at 14:26rsync
ortar
, which are pretty canonical on linux (since this is really a general linux question, you might look around Unix & Linux as well). The difference between the two is in the nature of the backup; withrsync
you are creating a mirror (identical copy), withtar
you are creating an archive (compressed file which can be extracted later). – goldilocks Mar 06 '15 at 14:47dd
has its uses (I am well aware of its limitations), but thersync
solution you keep referencing also has shortcomings (I have comment on this before, and posted an answer which addresses some of these). Both have their places. I believe what the OP wants is an image backup. I know of no solution which does this - it should backup partitions, compress and allow restoration to different sized disks - like the many backup utilities on Windows. – Milliways Mar 07 '15 at 00:00dd
, but this is dangerous on a running system. It also will NOT restore to a different card, if it is not identical in size (or larger) - even nominally identical cards may differ. If you have a NAS (it really needs to be ext4 which will will keep permissions) you can usersync
. You should restore to a SD with a new blank image. – Milliways Mar 07 '15 at 00:10dd
does have its uses, but it's a raw block level tool, which is why it isn't appropriate for backing up the content of a filesystem. If I have a .pdf on a DVD, the sane way to backup that file is to copy it out, not to duplicate 4 GB of mostly garbage because I think the .pdf is synonymous with the DVD. It will work, but it's silly, aka. bad advice; it rhymes with "superstitious" and "spirits made my hard drive". If someone is hell bent to copy 100% of the raw blocks on a device because doing a restore from content is too mind boggling, fine – goldilocks Mar 07 '15 at 03:45dd
the whole thing "and hope nothing changes". That is NOT something that should be recommended as a normative means of backing up a root filesystem. Questions of the sort "I don't want to do this the rational way, please help" are just that. – goldilocks Mar 07 '15 at 03:46