Btrfs and the future of the filesystem

Internals

Under the hood, Btrfs emulates its role model ZFS and relies on a technique called copy-on-write (CoW). The idea of CoW is to avoid unnecessary copies and copying actions. Therefore, changed blocks are only written physically if they are changed by one of the entities. For filesystems, CoW means that changed blocks are first written to free space without overwriting the original data; only the metadata is modified accordingly. CoW thus supports the creation of snapshots, because the original blocks are retained and form the snapshot. The metadata of the snapshot is stored with the first snapshot. In other snapshots, only changes to data blocks from the previous snapshot are incrementally stored.

Another advantage of the transaction-based CoW method is that the filesystem is always consistent, because changes to data do not overwrite the existing data but cause a block rebuild. This approach offers wear benefits on conventional hard drives with moving heads, because the mechanical system is not overtaxed; the write heads do not have to look for old data to overwrite but can simply write changes to a free part of the disk. This feature increases the write speed with less complexity than journaling-based filesystems like ReiserFS, ext3, and ext4.

Cards on the Table

The opinions on whether a filesystem needs the enormous functionality of Btrfs are as diverse as the views of its current production capability. However, many different application scenarios are implemented on Linux, and the kernel supports a number of different filesystems.

Whether or not Btrfs will inherit ext4's crown is currently unclear, because Btrfs's extensive feature set is widely regarded as overkill for normal desktop systems, and because the very useful snapshot function is also available on ext4, Btrfs currently serves as more of an alternative for specific use cases. Theodore T'so, the developer of the ext family, sees Btrfs as a successor to ext4 that is pushing its development limits. In addition to enthusiastic desktop users, the target group for Btrfs includes data centers, cloud computing environments, and large-scale storage, such as the massive storage required by developer Mason's current employer, Facebook.

Yes, No, But …

Btrfs requires some training time, which is not the case with conventional filesystems. Users also need to be confident about working at the terminal, because Btrfs does not integrate well with graphical file managers.

The undeniable advantage that Btrfs offers is currently bought at the price of additional coordination and configuration time for ordinary desktop users. One possible exception is openSUSE, which uses Btrfs as the default and thus offers good support for the system.

The Author

Ferdinand Thommes lives and works as a Linux developer, freelance writer, and tour guide in Berlin.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News