Lack of Documentation on how to do a full system back up

Hey @randUser,

There’s a few things that I think haven’t been made completely clear yet ( It’s likely the online documentation better describes them, but I’ll try to summarize some major points here ).

Assuming you’re using Linux, and the latest Restic Beta,

  1. The --one-file-system option does a lot of the exclusions you’re trying to do manually. Any filesystem which isn’t specifically mounted as part of the root partition will be excluded, including virtual file systems. This means that virtual filesystems like /proc /sys /dev /tmp and /run will be excluded automatically without the need for an exclude file or directive ( So long as you specify the --one-file-system directive. ) However! If you’re backing up to somewhere on your root partition, you will need to exclude that manually!
  2. This is just a clarification of the above, but it’s likely your distro uses separate filesystems or mountpoints for important directories, like possibly /boot and /home. These would not be backed up with the --one-file-system flag, unless you specifically back them up manually in a separate backup ( I’ve tested this, it works fine for me ), or you manually re-add them with --include directives. ( I haven’t tested this, but adding something like --include /home should work, if /home is a separate mountpoint. ( to get an idea of your separate mountpoints, run grep '^/' /etc/fstab ) If you’re not including a major filesystem, this is likely the reason the backup seems too small.
  3. Restic Does Deduplication. It’s possible it only added 27.856 GiB of unique data, while while you have about 10GB of data that was able to be deduplicated.
  4. If you want to backup your full installation, you’ll have to use sudo or do it from a root shell. This allows reading all the necessary files from all users and keep all correct permissions. You’d also need to restore from a root shell as well. WARNING! Always be very careful when using root! Root can do whatever it wants to your system, so make sure you type exactly what you mean! I recommend using a script for this that only root has the permission to read/write/execute. Once you’re satisfied the script is correct, double then triple-check it! If you haven’t been doing this, it could result in restic missing files that you don’t have permission to view as your normal user.

I’ve tested backing up my Arch and Ubuntu installs multiple times and reinstalling them onto other HDDs. I’m not sure how it would work in non-Linux OSes, but in Linux there are a few things you’ll need to note to do a full restore in the event of a disk failure or complete wipe:

  1. There are important files on Linux that tell the computer where the partitions are it needs to boot. For example the file /etc/fstab requires updating to allow your system to boot again. Any file that specifically identifies the disks or partitions used will need to be updated. If you’re using encryption, often the file /etc/crypttab will need to be updated. The bootloader configuration may also need to be updated. For Grub2, you’ll likely find the base config in /etc/default/grub. See here for some background info on restoring from a backup like this.
  2. The bootloader will need to be reconfigured and reinstalled. To do this you’ll need to boot off a liveCD and mount all the important partitions, then chroot into the install. Some good pointers for doing this can be found here. Once you’ve chrooted, you’ll need to reinstall the bootloader on the new HDD and then re-configure it. Assuming your new install drive is /dev/sdX and your distro is using GRUB2 ( It wont be! You’ll need to replace /dev/sdX! Don’t just blindly copy these! ):
grub-install /dev/sdX
grub-mkconfig -o /boot/grub/grub.cfg   # For Arch - Other more manual distros may be similar
update-grub   # For Ubuntu  - Mint and Debian may be similar

One thing that’s really cool about restic is that if you’d like you can take all my suggestions without creating a new restic repository. Restic will handle the dirty work, and your backup should basically only grow by any new files added, plus some small metadata.
I hope this clears things up somewhat.

Good luck! I think you’ll find Restic does an excellent job of doing what you’re trying to accomplish!
jedi453

1 Like