What is a good way to make backup clone of stable system?

Scenario: System is super stable, you want to back it up to a micro SD so you can do an update at a semi-critical point and still know you have a stable system (on the sd) even if something goes wrong during the update.

I could also imagine cloning the system, then 6 month later (without doing anything too stupid) you discover some bug at a critical time and the sd clone could save you because it is old enough.

Like currently OBS is not working for me because the version from Software in Debian is compiled for an older graphics library if I understand it correctly. I had the time to make a script (that I called obs-backup) that opens OBS with xcb and then it works, but I could imagine discovering this right before a stream and being super stressed trying to figure this out. Then a cloned system could do wonders!

Sooooo, what is the best way to do this? Thanks!

1 Like

I have in the past taken the SD card to another linux computer and used

sudo dd if=/dev/sdX of=file.img

where /dev/sdX is the block device (not sda1 or sda2 but sda… so the whole thing)

This copies all of the data from the SD card into a file. All partitions, etc.

Later on you can use

sudo dd if=file.img of=/dev/sdX

to write the file back to the SD card. This works as long as the target SD card is at last as big as the original.

(Of course you have to be very careful because if you enter the wrong device you will erase it)

There is lot of different solution for this.
Depending on your expected workflow.
The one I like is to use Btrfs and snapshots on my system.
It is cheap. It is quick. It is easy to restore per file or as a wall.
But you still need to periodically copy the snapshots on a backup device to be really safe.

My dream noob workflow is:

Boot computer, put in sd card, open gui program, select FROM storage on rk3588 TO sd card, click button.

In the future when I fuck up my system right before somthing:

Shut down computer, insert SD card, boot from SD card, do what I need to use the computer for, go home.

1 day later when I am rested: Fix what i fucked up in my system.

I have seen something like this for the raspberry pi (rpi-clone), to clone the running system into a bootable SD card.

I guess we could have a similar script on the (pocket) reform, to copy the system in the emmc (or nvme) to a bootable SD card.
Sort of like the reform-migrate script but backwards to migrate from emmc/nvme to SD.

The SD card would have to be large enough and the boot information set appropriately so the backup boots when the SD card is inserted. Removing the SD card would just leave the old system in place, and plugging in would boot the backup.

I think one problem with a simple approach like this (besides that the appropriate script doesn’t exist yet) is that most SD cards would not be big enough to backup most peoples working systems (?)

Maybe just the system without the /home volume.
It seems enough for what lislegaard said he expect.
As I understand it’s post he just want to prevent the system to stop working.
Preserving the personal data is a separate concern.

Maybe the best approach is simply to not clone, just write image to card, install needed software at a point everything is stable, etc.

Thanks so much for the input everyone! Very useful!