Is it reliable to use restic for system backups (root directory)

Does restic preserves:

  • symbolic links, file permissions, user & group ownerships and timestamps

  • ACLs

  • extended attributes

?

In case the System is not properly working well (f.e. we remove a system folder from our root directory) or even in a case where the OS doesn’t even boots, how would this tool be able to solve the problem in both cases?

And is it possible to then restore for example just home directory?

Thanks in advance.

OS: Linux

Yes.

Yes:

You can boot from a live Linux CD or your distro’s install CD in rescue mode and selectively restore the missing directories.

Yep, the --include option to restic restore lets you limit which files/directories are restored.

Note, however, that a backup of / may not be consistent which means that the snapshot doesn’t represent a single moment in time. If you run the backup directly on / then it represents a window of time from when the backup began to when it ended. This has implications for any programs that aren’t prepared to tolerate this situation – for example, nearly any database system (PostgreSQL, MySQL, or even embedded databases like SQLite which are used by Firefox and Chrome) is not going to like its files being out of sync with each other.

The proper way to handle this is to use some kind of snapshot mechanism. If you use LVM, you can use LVM snapshots. If you use btrfs or ZFS then you can use their built-in snapshotting feature. All of these snapshot mechanisms are atomic; they are taken at an exact moment in time as though the power to the machine had been cut at that moment. The snapshot should then be backed up and deleted.

3 Likes