After seeing a video on YouTube about btrfs in combination with Timeshift, I reinstalled my Ubuntu 22.04 installation and replaced my ext4 partition with a btrfs partition, which give you great snapshot possibilities in combination with Timeshift.
My question is if anybody else has experience with Timeshift, and if you have included the homefolders or not ? When browsing on the Internet, I can´t really see a consensus if it is a good idea or not. I would also like to know if you have any experience using ZFS for snapshots.
I am using Deja Dup backup for a while to backup my homefolder to my Synology NAS, which now has new lab (beta) feature in which it will use restic to make backups in stead of duplicity. I noticed in my first tests I noticed that this has a huge performance increase, and backups are made a lot faster.
No experience with Timeshift or Deja Dup, just getting into BTRFS, but only temporarily, probably won’t even use it to store data on it. It’s until I can get ZFS on ARM (which I am getting really close, found the compiling issue, now I need to make the system boot). Anyway, got experience with ZFS pools, hardware optimization (some bare basic understanding of ZFS), snapshots and send/receive.
If you are only going to use 1 disk, stay with BTRFS, ZFS doesn’t really like single disks. It can work and you get the snapshot capabilities, but if ZFS detects any corrupt data or bits flipped, it can’t grab it from somewhere else and recover the data, so it just marks it as unusable. Not sure how BTRFS behaves in that case. Most files will work just fine even with a few bits flipped.
ZFS can be the ultimate backups server FS, because it had deduplication and the snapshot sending is fantastic. Even without snapshots, if you use rsync and some smart scripting, you can get some pretty fancy backup policies and only have the storage use just as much data as you actually have + modify, instead of having something insane like say 3 fulls + 21 incrementals for 3x to 4x the storage capacity, that’s a lot of waste just for what I would call a sane backup strategy.
As for btrfs partitioning, my opinion is that you should have 3 or 4 partitions:
/boot/efi = vfat
Keep them separate via the disk partitioning. Maybe you can put the swap in a btrfs subvolume, up to you, but definitely keep the home as a completely separate partition, not as a different volume. You want to be able to snapshot the root FS and revert it whenever you need to, without having to revert the files from your home. Bonus is that having a separate home allows you to snapshot the home more often, so that in case you delete a file by mistake, you can recover it pretty easily. Just don’t go too crazy with the snapshots, might hinder performance or use too much storage.
Timeshift will make snapshots of both btrfs subvolumes (/ and /home). Deja Dup will make backups of my homefolder to my NAS. The concept is: Use Timeshift for system recovery, Déjà Dup for backup history.
That’s what I kept saying not to do, you probably want btrfs1 subvolume1 = / and btrfs2 subvolume1 = /home, so that in the event of a system crash, you don’t have to also restore data from your backup if the snapshot goes too far back.
Timeshift should not take snapshots of both / and /home at the same time, they should not be subvolumes on the same FS, they should be subvolumes on different file systems. You take a snapshot of /, you write data to /home, you write data to root, you reboot and fail booting, you restore /, but your /home stays the same. Another scenario: you mistakenly delete data from /home, you only restore /home, not /. Backups are important, you should keep Deja Dup around, but you should not need to mess with Deja Dup if your system is the one having problems.
Think of another scenario when you are on the go and a system update breaks your install and you need access to files on your home that were created after the snapshot was taken. If you have 2 BTRFS partitions, sda2 and sda3, with / being a subvolume on btrfs on sda2 and /home being a subvolume on btrfs on sda3, then taking a snapshot and reverting it on sda2 will not affect sda3. That’s how it should be partitioned.
Also, not sure if I mentioned it, but on Ubuntu you can install snapper (same snapper as in OpenSUSE Tumbleweed) and it will hook into apt (from what I heard) and take a BTRFS snapshots before a system change, like an update, so in case something goes wrong on a reboot, you can revert to a previous snapshot before the update. Again, if you have a separate /home, this means your /home will be unaffected.
I distro-hop about once a year to see what is new in a handful of different distro’s that I like. This also is a method to see that is new in Linux and which distro’s are using the new technology. My last distro-hop was about a year ago and that is when I learned about btrfs with snapper and grub-btrfs. Oh, and ZRAM. I use both btrfs and ZRAM on all my computers now.