As someone who’s been using Fedora Workstation on and off since version 38, and is well aware that any major OS upgrade or any app installation/update is a great opportunity for things to go horribly wrong, I suppose I’ve tempted fate for long enough by not having any sort of backup system in place in case my system ever gets messed up (or the computer is lost or broken.)
I guess the predictable roadblock here for an inexperienced Linux user who’s used to macOS is that unlike macOS, Fedora doesn’t come with a go-to whole system backup solution ready to go out of the box like Time Machine. I’m mainly just looking for a way to get a similar safety net of being able to rollback my system in case I ever accidentally break it, and being able to restore my system to a replacement computer if necessary. It’s my understanding that Linux doesn’t have any perfect equivalent to Time Machine, so whatever’s the closest match?
I know a very similar question has been asked in another thread here not too long ago (Beginner - Backup Advice Please), but the responses threw out a bunch of tool names and terms I didn’t quite understand and I feel like I would benefit from someone just taking it from the top. If there’s no equivalent tool to Time Machine that can handle backing up and restoring your whole system, I guess you’d have to split it up between backing up system files (for events like borked OS upgrades and app installs) and backing up your user data (the stuff in /home and maybe also /etc)? Does that sound about correct?
If you were using Fedora 38, I would enthusiastically recommend fsarchiver, It allows you to encrypt and compress unmounted partitions during the archiving process. Sadly, compatibility issues arose in the Spring of '23, when the e2fsprogs utility package was released, which cause fsarchiver to throw an error during an archive creation attempt.
Another alternative is to create partitions of exactly the size of those that you wish to backup on another SSD and use dd to copy each unmounted partition.
some examples of backing up to a SATA device /dev/sdb4 follow:
If, as I do, you have more than one NVMe drive, you MUST determine which drive is called what before starting a dd copy. Depending upon which OS I boot, the same unmounted NVMe may be referenced as /dev/nvme0n1p4 or /dev/nvme1n1p4. lsblk -f can show you which is which.
After copying, I suggest using gparted to assign a new UUID to the copied partition as well as changing the filesystem name to something meaningful. If two partitions with the same UUID exist, nasty surprises can result.
If your ‘/etc/fstab’ file references the ESP system partition, that reference will have to be updated if/when you restore that partition due to the UUID change.
A very good tool that compresses the data and restores it to the same size partitions, creating the partitions for you if needed is clonezilla. Yes, it still needs to have the file system inactive so should be run from a live media boot and put the back up on a different device.
Clonezilla does a snapshot type backup so is a copy of the system at the time the backup is created. A restore is exactly that – a clone at the time the backup was made.
It has the ability to backup the entire drive, or selected partitions.
A similar tool to Time Machine is Deja-Dup (available in the repos, integrates well with GNOME). The backups are incremental, encrypted, and can be stored locally or in the cloud. It’s useful for the /home folder and other important data or system files, but probably not appropriate for full system backup.
If someone takes out a utility pole and you lose power or your SSD experiences a failure while writing, the partition table can get wiped out. In either of these scenarios an incremental backup might not be the most convenient or effective way to restore. A full partition backup or restore can be completed quickly and effectively. See an example of ‘dd’ use below:
# date;dd bs=222M status=progress if=/dev/nvme0n1p7 of=/dev/sdb2;date
Fri Dec 27 10:44:31 AM PST 2024
52143587328 bytes (52 GB, 49 GiB) copied, 122 s, 427 MB/s
225+1 records in
225+1 records out
52428800000 bytes (52 GB, 49 GiB) copied, 132.211 s, 397 MB/s
Fri Dec 27 10:46:43 AM PST 2024
Regardless of the backup system that seems right for you, it would be prudent to verify that it can restore both a root partition and its associated UEFI system partition to an external SSD and that you can boot that restored partition.