Linux Don’t Need No Stinkin’ ZFS: BTRFS Intro & Benchmarks

ZFS may be locked into the Solaris operating system but "Butter FS" is on the horizon and it's boasting more features and better performance.

Linux is a fun project to watch because you get to see this living and breathing piece of software change and evolve.

Recently, Linux has been undergoing something of a revolution with a respect to file systems. There are a number of projects including ext4 (See ext4 File System: Introduction and Benchmarks), squashfs, nilfs which have made it into the kernel, and tux3, which hasn’t made it into the kernel yet but is under heavy development.

And perhaps most importantly, btrfs. Btrfs holds the promise of giving Linux many enterprise class file system features similar to ZFS (See Solving Common Administration Problems with ZFS and ZFS on FUSE) but with even more features and better performance. In fact, many Linux experts think that btrfs is one of the keys to the future of Linux. While btrfs is not quite ready to be your only file system, it is in the kernel ready for testing and is still undergoing very heavy development.

In this article we will introduce the key features of btrfs find out how it compares to existing file systems. We will also test it using iozone, with the understanding that it’s still in development so performance will likely change over time.

Introduction to btrfs

Btrfs, sometimes called “Butter FS”, is a new file system for Linux that has a wealth of features users have been wanting for some time. Chris Mason, who works at Oracle, started the project and Oracle has released the project under the GPL license so anyone can work on it. Btrfs has a gained a very large following within the Linux community and has whipped up a good deal of buzz. Some of the features of btrfs that have led to this buzz are:

  • Copy on Write
  • Extents (see article about ext4)
  • Space efficient packing of small files (file systems have needed this for a long time)
  • Space efficient indexed directories
  • Dynamic inode allocation
  • Writable snapshots
  • Snapshots of snapshots
  • Subvolumes (separate internal filesystem roots)
  • Object level mirroring and striping
  • Checksums on data and metadata
  • Compression
  • Integrated multiple device support, with several RAID algorithms
  • Online filesystem check and defragmentation
  • Very fast offline filesystem check
  • Efficient incremental backup and File System mirroring

You can tell from the list of features that btrfs is a very ambitious project with a load of features (got to love that).

One of the most immediate questions one would have about btrfs is, “how does it compare to ZFS?” That’s a great question. There is a pretty good blog posting that attempts to impartially compare btrfs and ZFS. While the comparison is quite long, a quick summary of the comparison is below:

Copy on Write yes yes
Snapshots yes yes
Snapshots of snapshots ? yes
Performance degradation at near 98-100% disk usage yes Most likely yes
Block level compression yes Currently a mount option
Disk encryption Being developed Planned but not currently in kernel. Encryptfs could be an option
Online resizing no (being worked on) yes
Online defragmentation no (being being worked on as part of other projects) yes
Write checksums yes yes
Built-in RAID yes (0,1,10, 5 with fixes for write hole (raidz), and some variant of 6 called raidz) yes (0, 1, 10)
ACL yes yes
Direct IO yes Writes yes. Reads No – Planned
Quotas yes yes

Next: Feature Breakdown