BTRFS Subvolumes vs Normal Partitions

Way back when I installed to this machine (what looks to be the beginning of the year) I decided to format my SSD to btrfs because I had heard of some SSD specific performance optimized stuff in btrfs. It worked great. While still in 'beta', it has yet to fail on me (knock on wood). But the performance, the SSD stuff and the compression is not what I came to write about.

Subvolumes. They are very similar to what LVM does, allowing you to use a single partition as multiple, but this is part of the filesystem. There are also ways to create snapshots of a subvolume (as another subvolume). Recently I set up a rotating backup for my snapshots. This allows me to roll back to any point in my computers history within 20 hours! The snapshots are taken using btrfs subvolume snapshot / /btrfs/@<some number> every two hours, and rotated up to @9, at which point @9 is removed. Note that this only runs when the computer is awake, so I could possibly move back much further than 20 hours. To mount an old subvolume, I would just change the options in the kernel command line at boot time. Quite easy.

Another thing that I set up using btrfs is having my / and /home on separate subvolumes. This means that taking a subvolume snapshot of / only saves the important files used by the OS, not the mass of large, ever-changing files in my home directory. While subvolumes take up almost no space for a while, if you keep them around too long or start changing a whole bunch of files between snapshots.

If you want more information on using btrfs, please head over to the btrfs wiki.

Comments !