Daerandin
Well-Known Member
I've been using btrfs for a few years now, although I have not been making extensive use of the subvolume snapshot feature yet. Mostly I have had system root on one subvolume, and /home on another subvolume.
If you are unfamiliar with what subvolumes are, you can think of them as hard drive partitions. They are not exactly partitions, but you mount them as partitions. They do share the same hard drive space, but are separate when mounted individually.
However, a recent issue with a couple of package upgrades on Arch pushed me into setting up a bit more complicated setup with snapshots. The update issue I had turned out to not be that complicated, but just to ensure that I always have the ability to boot into a fully functional system to troubleshoot, I went ahead with this. First my subvolume setup:
/ - The root directory obviously needs to be a subvolume
/home - home is kept separate on its own subvolume
/var - mostly kept separate so that logs are consistent, and not different between my snapshots, this is also true for the package database
/var/lib/pacman - This is required specifically for Arch's package manager
Then I snapshot the root partition (/) and /var/lib/pacman, I also keep the kernel and initramfs that coincides with the version of the snapshot. I then have a separate boot entry which utilizes the snapshots instead of the main subvolumes. So if I boot up with the snapshots, my system will be at the state it was in when I took the snapshots. But all my files in /home are unaffected, meaning I would not lose progress in games.
The reason for keeping /var/lib/pacman on its own subvolume has to do the Arch's package manager, pacman. The files here need to be in sync with the snapshot I take of root (/), so I need to snapshot this along with root. Otherwise, pacman would incorrectly detect the versions of installed packages and system.
It gives me peace of mind that I can go back to an earlier state in case something goes wrong.
If you are unfamiliar with what subvolumes are, you can think of them as hard drive partitions. They are not exactly partitions, but you mount them as partitions. They do share the same hard drive space, but are separate when mounted individually.
However, a recent issue with a couple of package upgrades on Arch pushed me into setting up a bit more complicated setup with snapshots. The update issue I had turned out to not be that complicated, but just to ensure that I always have the ability to boot into a fully functional system to troubleshoot, I went ahead with this. First my subvolume setup:
/ - The root directory obviously needs to be a subvolume
/home - home is kept separate on its own subvolume
/var - mostly kept separate so that logs are consistent, and not different between my snapshots, this is also true for the package database
/var/lib/pacman - This is required specifically for Arch's package manager
Then I snapshot the root partition (/) and /var/lib/pacman, I also keep the kernel and initramfs that coincides with the version of the snapshot. I then have a separate boot entry which utilizes the snapshots instead of the main subvolumes. So if I boot up with the snapshots, my system will be at the state it was in when I took the snapshots. But all my files in /home are unaffected, meaning I would not lose progress in games.
The reason for keeping /var/lib/pacman on its own subvolume has to do the Arch's package manager, pacman. The files here need to be in sync with the snapshot I take of root (/), so I need to snapshot this along with root. Otherwise, pacman would incorrectly detect the versions of installed packages and system.
It gives me peace of mind that I can go back to an earlier state in case something goes wrong.