Help with understanding BTRFS Snapshots and Subvolumes

I’ve been on Manjaro XFCE for awhile and decided to switch to BTRFS when I upgraded my SSD. I figured if Fedora is switching that maybe btrfs is mostly stable now. I was following a guide that had a three subvolumes: @, @home, and @cache at /, /home, and /var/cache
The Architect installer gave me so many problems however that I ended up installing using calemares on btrfs instead.

I really wanted to set up snapshots but it looks like the calemares defaults with just @ for / and @home for /home but no @cache.

Can I still setup snapshots? I am completely new to btrfs but hoping to use it to save me from myself and get better data protection. After doing so much reading trying to figure out what went wrong I am a bit brain fried and just want to set up snapshots or timeshift as a starting point for other stuff later. --mainly Lutris and KVM now that I have a nicer computer.

Where should I start?

You can still use snapshots without problems. @cache subvolume just significantly reduce the size of the snapshots, because it excludes /var/cache from snapshots. With snapshots, only the changes take actual disk space. Cache contains a lot of often changing low value files like pacman cache.

Here is a guide to creating more subvolumes after the fact.

1 Like

With kvm you should disable copy on write for the virtual machines, because it increases the performance significantly. You need to do this for the directory containing the virtual machines before creating the virtual machines.

1 Like

I don’t know how I missed that @cache was just for excluding it from snapshots.
I ended up taking a few snapshots doing just sudo btrfs subvol snap -r / /.snapshots/root-snap_DATE and a similar one for home. I’m not sure I fully understand the difference between @ or / and top-level but I hope some of that will come as I use btrfs.

That post you linked mentions updating grub for booting from a snapshot or different subvolume but I also found something called grub-btrfs that seems to automatically do that?

I’m going to try rolling back to a snapshot and test it out. I’m sure I’ll be back with more questions.

Grub-btrfs generates the menu entries when you run update-grub. So you want to install timeshift-autosnap in addition to grub-btrfs. Timeshift-autosnap automatically takes a snapshot and updates grub when you do something with packages. This way you can always boot to the state before your last update if something goes wrong.