I’m currently testing the new btrfs backup-restore functionalities and trying to implement backup system for home.
Snapper looks great for reverting back some changes, but it has unfortunately no support for backing up to external media.
I wanted to test yast-backup module, but it disappeared in 13.2 as unmaintained.
Some existing backup solutions, which impact the btrfs send/receive features do not integrate with snapper.
Snapper seems also to consider some special files (ignores them during restoration for some reason) and it could be useful for disaster recovery. And one of the main points - I don’t want to have some snapper snapshots and some other snapshots of other btrfs-aware backuping software.
I’ve tried using rear for disaster recovering (boot, restore bootloader and partitions) and manually send/receiving the snapper snapshots to the external drive, but I haven’t succeeded till now with rear. (Issues restoring UEFI-installations).
But even if I somehow manage to restore bootloader and all the rest, I could only restore the last snapshot from the backup disk. But I would like to restore all the snapper snapshots, so that I can use snapper to review them and so on.
I’m asking myself following questions:
What do you think of such a backuping solution? (Snapper with btrfs send/receive)
How to restore snapper snapshots metadata after disk failure?
Snapper is not backup. Please write 100 times on the blackboard
Backups are external to the machine and local drives. Otherwise it is not a backup it is just a copy
Snapper is really much more useful to developers then users, since it makes it easy to move between snapshoted version thus you can revert changes that may not have gone well. Disaster recovery can only be done with a real backup in the traditional manner.
(if /backup is mounted external drive formatted with btrfs)
And if I really need to, then rsync to somewhere else.
By the way what do I need the btrfs for? For all the headaches with virtualBox disk images, mysql and sqlite database files? For all the confusion with df output? For all the complexity of /proc/mounts and so on? For time machine, that doesn’t work, if my hard drive loses some sectors?
I have a huge home with a big amount of the stuff, which doesn’t change at all. As I started to use Unison for files synchronisation, it tooks over hour for synchronisation because of files amount (all that uni stuff - IT faculty).
At the end I’ve made a 5 GB tar.gz, which I’m currently not able to open (am too impatient to wait for ark to open it). But even after all of that, all the fotos and Co. the tools like rsync need some time for comparison. (I’m currently using ntfs on external drive).
Reading about “brand new” btrfs I thought: Hey! that’s it! Backup much more efficiently, then rsync ever could! Compression support! (And so much to be learnt to not to rustlol! !)
> I know that the snapper is not a backuping tool. But making it one is as
> simple as
>
> Code:
> --------------------
> btrfs subvolume create /backup/.snapshots
> mkdir /backup/.snapshots/1
> btrfs send /btrfs/.snapshots/1/snapshot | btrfs receive /backup/.snapshots/1
> --------------------
>
> and then
>
> Code:
> --------------------
> mkdir /backup/.snapshots/2
> btrfs send -p /btrfs/.snapshots/1/snapshot /btrfs/.snapshots/2/snapshot | btrfs receive /backup/.snapshots/2
> --------------------
NO.
If /backup is a subvolume, it is not a backup.
A backup, by definition, must be on a different disk.
You don’t “need” btrfs for anything ext4 works just fine. BTRFS does promise some nice bells and whistles in the future. Many key features are still in development though.
They way snapper works is not to make a copy. When a sector data changes the original sector is not reused it put in a snapshot. So snapshots are more like a diff then a backup copy
Everything you ask about is described in the snapper MAN pages. You’ll find stuff like files and file types which are excluded by default (you can remove or add to the list).
In other words, I recommend you use the snapper command line instead of the GUI in YAST… You’ll find plenty of flexibility and the ability to do everything you ask about (and I personally tested and executed a few weeks ago).
BTRFS may not be a backup solution if something should happen to the disk, but it’s a <very> useful backup solution if you need to restore the system to a previous state… eg before installing something, before a special configuration, particularly if there isn’t a simple “uninstall” option (like installing from source). I wouldn’t consider it ideal for restoring files because it’s not that granular, a snapshot is usually the entire disk or partition so rolling back replaces the entire disk or partition. Disaster recovery? Yes, you can recover from some disasters, but depends on the details.
For file recovery, I recommend instead
If on ext, use extundelete. Works sort of like BTRFS, but works only on EXT. Also, years ago I reported a bug that it also only works on the primary disk (typically sda). If your home partition is on the first or only disk in your system, no problem. If on another disk (eg sdb) then if the bug isn’t fixed, it won’t work.
In general, photorec for a variety of linux file systems. Works best when it’s saving snapshots like BTRFS and EXTundelete, but can also be installed and run when not previously installed and attempt to recover files, of course would then be subject to the file not being over-written.