Backing up the system

Thanks for all the replies. Seems this was the best time to find out ways to do this, while trying different things I found that the filesystem did have problems. I couldn’t delete older snapshots from before the upgrade to Tumbleweed and there were a few other inconsistencies.

I managed to rsync as much as possible and export a list of installed programs and repos. I then did a fresh install of Tumbleweed preserving the users, copied the old home data back across, reimported the repos and program list, let it do it’s thing, rebooted and it all looks to be back to how it was.

Next is working out to script all this to do it automagically on a schedule, so I’ll probably have a new thread at some point asking basic things about doing that. Also, Paragon now sees the btrfs partition properly again so there’s always that option.

1 Like

Glad to read it all worked out in your favor.

Because there are a number of options (not just for backup, but other operations), it can be intimidating … so best to sit back and ask for options.

And yes, you could create a “cron job” to run rsync (or something else) every now and then. Nice thing about rsync is it only copies changed data on each run, which makes it a quick process.

Personally, I don’t use rsync with cron … I do a quick manual rsync of /home every few days. (my /home is in its own separate partition).

If there’s a catastrophic failure of / (root partition) and BTRFS isn’t helpful, a fresh install is easy enough.

Infamous host erlangen runs these:

erlangen:~ # systemctl cat backup-home.*
# /etc/systemd/system/backup-home.service
[Unit]
Description=Backup /home

[Service]
ExecStartPre=/usr/bin/sleep 11
ExecStartPre=/usr/local/bin/scan-for-backup-disk
ExecStart=/usr/bin/rsync -a --exclude=.cache --exclude=covid-19-data --exclude=.snapshots /home/ /HDD/backup/home/
ExecStopPost=/usr/local/bin/disable-backup-disk

# /etc/systemd/system/backup-home.timer
[Unit]
Description=Backup of /home
After=local-fs.target

[Timer]
OnCalendar=daily
AccuracySec=1h
Persistent=true

[Install]
WantedBy=timers.target
erlangen:~ # 

Making a disk copy can be a good thing when your original disk breaks down completely. But it is not a good thing when you want to recover on the file level (the infamous document you erased by incident). Because a disk copy e.g. has the same UUIDs of the file systems and mostly mount by UUID is used, this can lead to many problems if one does not understand how that functions.

2 Likes

My thoughts, exactly.