Btrfs – Btrfs Subvolumes vs Folders

btrfs

I've read a fair bit about btrfs's subvolumes feature. While it would seem interesting to have subvolumes for the main categories in a data filesystem, such as @films, @pictures, @music… What advantage does this provide over just having folders?

Will I need to mount each subvolume? Or will the subvolumes appear like folders under the root mount point? i.e for a /data mount point will I have: /data/pictures, /data/music, etc

Best Answer

The answer to your either/or question is "both". Yes, you'll have to mount each subvolume. Each subvolume behaves like a normal file system, so they will appear in mount points like /etc.

There are a few advantages to that idea. For instance, you could make your MySQL database directory into a subvolume, which would enable you to take snapshots for use with backups. You could also choose to make that directory into a RAID1, so that if one disk failed, your database would still be intact. Another is using a subvolume for /etc so that you could always reverse any kind of system wide configuration changes. Using a subvolume for /home/username would potentially allow each user to have a time machine, though probably in a much more flexible way than what Apple provides in their system.

And of course, one benefit of having a subvolume for homes and another for the root is the ability to reverse an upgrade. For instance, you upgrade from 12.04 to 12.10 very early, discover that it's a tad too buggy after the first month, so you just un-upgrade your operating system. I haven't tried that myself, but it should work just as good as keeping your home and reinstalling the previous system, except it would take about a second insted of an hour. :)

Related Question