What are Btrfs subvolumes in Linux? Understand how they work and why they are better than traditional partitions with features like snapshots and flexibility.
btrfs subvolumes are cool, but I’ll still take partitions for separation. The whole point of having a separate home partition is that it’s separate from / if we have to, say, reinstall the OS, or the filesystem breaks or whatever.
sure it might be possible to install an OS into a btrfs subvolume without wiping other subvolumes, but do I wanna risk it? Nah.
I have installed an OS onto just the btrfs root subvolume, leaving the home directory intact. This is how I originally swapped from Manjaro to Arch. The arch manual install instructions helped.
But this should be a feature of the graphical installers imo.
That… Is literally how you do it. You install the system onto a subvolume. Or many, in fact - the way I do. Root, var, srv, home, opt all get their own subvolume. Only boot stays as a separate partition.
Ignoring /boot, what is the benefit of putting everything else in different subvolumes? As opposed to just one subvolume for / and one for /home, which is what I currently have. It just looks to me like it’d be extra work, but I’m probably missing something
You can snapshot them independently. E.g. I snapshot / on every update and boot, /home every boot, and temporary file directories such as /tmp & /var/tmp don’t get snapshot at all and are also mounted with nodev,nosuid,noexec flags.
For one thing if you’re snapshotting your subvolumes for backup purposes then it will ignore nested subvolumes. Eg you dont want to preserve snapshots of huge installed game directories, cache directories, logs or docker / podman images, usually. Saves a lot of space.
Also you can tune copy on write on a subvolume, which is great for some use cases for performance.
Might be possible? It’s not only possible but rather easy to do, in fact I often have multiple installs side by side in different subvolumes and I can switch between them, reinstall as needed, snapshot them. The only partition I have separate is /boot because it has to be vfat for the esp. Tbh accidentally blowing up a subvolume isn’t all that much more or less difficult to do than accidentally blowing up a partition. IMO if you’re paranoid about wrecking something the only safe separation is multiple drives and disconnecting the one you want to avoid touching. I keep home in a separate subvolume specifically for the separation you mention, it can persist across different installs because it’s separate. Subvolumes are fully isolated from most failures with the exception of filesystem corruption.
I always do LVM now. Virtual partitions are the way to go, personally.
The amount of times that the root partitions have been 20-25GB but have still gotten completely full such that updates break… Well I could count it on one hand but still difficult enough that I would rather just use virtual partitions, especially on a server.
btrfs subvolumes are cool, but I’ll still take partitions for separation. The whole point of having a separate home partition is that it’s separate from / if we have to, say, reinstall the OS, or the filesystem breaks or whatever.
sure it might be possible to install an OS into a btrfs subvolume without wiping other subvolumes, but do I wanna risk it? Nah.
– Frost
I have installed an OS onto just the btrfs root subvolume, leaving the home directory intact. This is how I originally swapped from Manjaro to Arch. The arch manual install instructions helped.
But this should be a feature of the graphical installers imo.
That… Is literally how you do it. You install the system onto a subvolume. Or many, in fact - the way I do. Root, var, srv, home, opt all get their own subvolume. Only boot stays as a separate partition.
Ignoring
/boot, what is the benefit of putting everything else in different subvolumes? As opposed to just one subvolume for/and one for/home, which is what I currently have. It just looks to me like it’d be extra work, but I’m probably missing somethingYou can snapshot them independently. E.g. I snapshot
/on every update and boot,/homeevery boot, and temporary file directories such as/tmp&/var/tmpdon’t get snapshot at all and are also mounted withnodev,nosuid,noexecflags.For one thing if you’re snapshotting your subvolumes for backup purposes then it will ignore nested subvolumes. Eg you dont want to preserve snapshots of huge installed game directories, cache directories, logs or docker / podman images, usually. Saves a lot of space.
Also you can tune copy on write on a subvolume, which is great for some use cases for performance.
Might be possible? It’s not only possible but rather easy to do, in fact I often have multiple installs side by side in different subvolumes and I can switch between them, reinstall as needed, snapshot them. The only partition I have separate is /boot because it has to be vfat for the esp. Tbh accidentally blowing up a subvolume isn’t all that much more or less difficult to do than accidentally blowing up a partition. IMO if you’re paranoid about wrecking something the only safe separation is multiple drives and disconnecting the one you want to avoid touching. I keep home in a separate subvolume specifically for the separation you mention, it can persist across different installs because it’s separate. Subvolumes are fully isolated from most failures with the exception of filesystem corruption.
I always do LVM now. Virtual partitions are the way to go, personally.
The amount of times that the root partitions have been 20-25GB but have still gotten completely full such that updates break… Well I could count it on one hand but still difficult enough that I would rather just use virtual partitions, especially on a server.