Btrfs Filesystem – The Best Thing Since Sliced Bread

Btrfs Logo

Btrfs Logo

Short Bytes: Linux boasts a cornucopia of filesystems, some cutting edge, some cross platform, and some retro support from days of UNIX past. Btrfs is one that’s been sticking its head above the crowd lately, and for good reasons like its Copy-on-Write, RAID functionality, and Snapshotting ability.

A filesystem is the underlying structure by which the files on your disk are organized. It is the system used for saving, moving, deleting, renaming, and any other operation you might do to a file on a disk or another storage medium. Some notable filesystems are NTFS on Windows, HFS+ on Mac OS X, EXT on Linux, and finally, Btrfs, also on Linux.

The EXT filesystems have been the longtime de facto for Linux systems. As the EXT filesystem evolved, it became more stable and resilient to catastrophe. For example, when EXT3 introduced journaling. It seems, though, that EXT’s time is coming to an end. But, fear not, because a new hero is rising.

Btrfs, pronounced any of many ways, but prominently Butter-FS, is an amazing piece of work. Btrfs is backed by the likes of Facebook, Google, OpenSUSE, and several other major players in the tech industry. It is the inherent rival of ZFS due to their many similarities and the problems they attempt to tackle.

First and foremost, Btrfs is a filesystem. It does things a little differently, though. Where many filesystems will change a file in-place, Btrfs creates a copy of it, and subsequently links the file name to the newly updated and changed copy. This process is called copy-on-write, and, inherently, eliminates the need for a journal. Due to this process, many of the features of Btrfs are made much more accessible, including snapshots.

One of the things that makes Btrfs so special is its ability to span across multiple storage devices, but beyond this, it is capable of creating RAID (Redundant Array of Independent Disks) volumes. RAID volumes are groupings of disks that are configured for either performance or redundancy. This makes Btrfs the volume manager, RAID software, and filesystem all in one. That means that you only need a single utility from which you manage your RAID volumes and filesystem. This is much easier than using a set of independent tools with varying syntaxes and command formats that aren’t always aware of each other.

Of the many features, there are three in particular that are especially attractive to system administrators.

  • RAID – This allows for the combining of storage devices — hard disks or solid states — to create a volume consisting of multiple devices for either improved performance, larger volumes, or increased redundancy. Btrfs supports RAID levels 0, 1, 5, 6, and 10.
  • Copy-on-Write – This allows for snapshots and versioning of data. Because a file is forked when it is changed, the original or previous version can easily be preserved.
  • Subvolumes – In Btrfs, there are volumes within the Btrfs filesystem volume, these are called subvolumes. Subvolumes can be snapshotted, cloned, frozen, exported, imported, and so much more. Subvolumes are an extremely flexible way of managing both your system and your data. Subvolumes can be snapshotted before system updates for safe measure, or you can snapshot your mission critical data and export for external backup.

There are many ways to create a Btrfs volume with different RAID levels and different disk configurations. Check back for subsequent tutorials on how to leverage these.

Devin McElheran

Devin McElheran

IT professional by day and various hobbies by night.
More From Fossbytes

Latest On Fossbytes