RPIZW
Posts: 81
Joined: Sat Sep 28, 2019 5:54 pm

RPi snapshop backup

Wed Apr 21, 2021 9:19 pm

Hi all,
I’m trying to find an alternative to the SD card copier solution (is there any?)

One of my RPi runs from a 500GB SSD drive. Copy this can take a ling time. Also, I don’t want to backup the entire drive but only the OS + some files - but not all files(!)
The destination will be my Synology NAS.

Is there any option to do it?

Thanks

MiscBits
Posts: 204
Joined: Wed Jan 27, 2021 12:48 pm

Re: RPi snapshop backup

Thu Apr 22, 2021 1:01 am

I would look at the rsync command. This can copy changed files only if needed.

DSM has specific support for rsync built in see here to turn on.

Note this is a file level backup so you may need to export database records / structure etc for them to be restorable.

RPIZW
Posts: 81
Joined: Sat Sep 28, 2019 5:54 pm

Re: RPi snapshop backup

Thu Apr 22, 2021 8:04 pm

I work with rsync a lot.
Can it replicate RPi and its OS like a full snapshot of the SSD?
Just to be clear, the SSD used as the main storage and this is what I want to backup. To avoid cases when the OS fail

MiscBits
Posts: 204
Joined: Wed Jan 27, 2021 12:48 pm

Re: RPi snapshop backup

Thu Apr 22, 2021 9:36 pm

You cannot do a snapshot with rsync as per virtual machine style snapshots as it's a file level tool

Depending on what you are running, the system could have file data in disk cache, database commits (esp cross table integrity) outstanding and temporary files used a process markers / working storage to handle. I'm sure there are more 'gotchas' but they are the ones I normally worry about.

Snapshotting physical boxes is hard and I've known even the VMWare snapshot tools struggle with running machines. Maybe RonRs backup tool (here) running on a quiet system would be a starting point? Then look to use the 'changed' data when the system is in a known state? I think this uses rsync but I've not delved into its workings.

RPIZW
Posts: 81
Joined: Sat Sep 28, 2019 5:54 pm

Re: RPi snapshop backup

Thu Apr 22, 2021 9:49 pm

Clear! Thanks for the explanation, that makes total sense.

If I disconnect the SSD and connect it to external device, can I then make a clone?
If so, there is an option to exclude specific files and zeros on the drive to make the cold snapshot/clone/image smaller?

MiscBits
Posts: 204
Joined: Wed Jan 27, 2021 12:48 pm

Re: RPi snapshop backup

Thu Apr 22, 2021 11:05 pm

Exclusions can be handled at file or directory level - a few examples are shown here

Remember the Pi comes with a minimum of two partitions so you need to be able to handle all of that fun (format, partition and boot table data) for a restorable image.

RonRs program does support passing rsync options and makes the minimum possible sized image if you want. The code is open and he is very responsive so you could hack the copy commands to handle your exclusion permanently. A search of the thread may help (though its long) or raising a question there as RonR is very helpful.

One other way is to try the Raspberry Pi OS built in SD copier (think it works on SSD / HDD as well) and the RonRs image-shrink tool to keep size down BUT this has no exclude option so everything would be copied - it's like using DD to dump the whole drive to file.

Return to “General discussion”