Best Way To Do a Full System Backup

Introduction

Hey, I’ve used Restic to backup some stuff before and now I’m thinking of using it to backup my whole filesystem as part of my Linux configuration.

Solutions I Found

I’ve read the docs, but it doesn’t address the issue of ongoing filesystem writes during a backup, which I heard can cause issues with the backup? To that end, I saw someone else’ setup where we do

export RESTIC_FEATURES="device-id-for-hardlinks=true" restic backup ...

on a fresh BTRFS snapshot.

Queries

  • Is this the best way to do a full filesystem backup?

  • A cursory reading of issue 3041 and PR 4006 seems to suggest enabling the feature flag RESTIC_FEATURES=device-id-for-hardlinks=true might be an imperfect solution. But I don’t really understand it for now haha, so I would appreciate a quick rundown of any key drawbacks of enabling this.

  • Furthermore, if LUKS full disk encryption is enabled, then a BTRFS snapshot is a snapshot of the decrypted disk information right? If I do a full system restore (e.g. doing a Restic restore at /mnt where the target disk is mounted, from within a live USB boot.), I would have to set up the full disk encryption over again. Is there a way to avoid this?

    Edit: Now that I think about it maybe this isn’t really a problem. I can just setup my target disk with a standard Fedora ISO and enable LUKS during the installation process. Then, I can use cryptsetup luksOpen (in a live USB boot) and restore from there. This should result in a restored disk with LUKS, right? :smiley:

  • Or would something like Clonezilla be better for a full system backup?

My end goal is to have a frequently backed up system, so I don’t lose any important data if any sudden and catestropic data loss occurs to me, and to make the backup easy to restore from if I’m panicking from sudden data loss.

Hi :waving_hand:

For a full system backup, IMO best would be to use some kind of snapshot-able filesystem / volume manager and do periodic snapshots, then backup these read-only snapshots via either restic or any other tool.

But honestly, if you’re not doing anything exotic with your system, backing up your /usr folder won’t help much, since that you’ll get as-is* when you do a fresh install of your OS anyway. If you really want to keep your setup I’d advise you to backup your configuration files, maybe home directory (which will be way easier with snapshots, but less pain if you just run restic towards it). If the target is to be able to restore whole OS as fast as possible (considering you’re not planning to use nixos or zfsbootmenu), full-disk cloning tools like Clonezilla would be the way.

>* “as-is” for any practical purpose