Friday, 3 October 2014

Why BTRFS is Amazing

You may have heard of the BTRFS file system. BTRFS is an advanced, next-generation file system which was jointly developed by Oracle, RedHat and other companies.

When I came across BTRFS the first time, I dismissed it as yet another file system like EXT4 and NTFS. There are so many file systems available these days that most people don't care about what they are using. And there really is nothing to care about. The difference between file system formats like EXT3 and EXT4 are of interest only to advanced users. Sure, EXT4 provides journaling and better reliability than EXT3, but for the average user, there is nothing about EXT4 that changes the way they interact with their system on a daily basis.

BTRFS is different. It's such a big improvement over previous generation file systems that it will change the way you use your hard disks.

Consider the following:

  • Dynamic Partition Resizing - You can resize partitions dynamically while they are being used. There is no need to unmount and no need to reboot to a live CD. You can even resize the root partition while the system is running.

  • Disk Pooling - You can combine all your hard disks into one big volume which will act like a single partition even though they are on separate devices. You can add more devices to this pool and remove existing devices without having to unmount.

  • RAID Arrays - You can combine separate partitions on different hard disks to create a software RAID setup. For example, if you have two 1TB hard disks you can create a single BTRFS volume of 2TB capacity which uses the disks in a RAID-0 setup. Any file that you write to the volume will be written to both disks simultaneously, giving you almost twice the read and write speeds that you would get from a single disk.

  • Atomic COW Snapshots - You can create a snapshot of your system without copying a single file. The snapshot simply replicates file system metadata without duplicating files. The snapshot will take zero disk space when it is created initially since a single copy of each file is stored on disk. Files are duplicated when they get modified and common data blocks are shared. So you can create a hundred snapshots of your system without wasting disk space and restore the snapshots to undo system changes. The snapshots are also atomic. So if you take a snapshot at 10 seconds past 4:00 pm on 3rd October 2014, the snapshot will contain every single byte of data that existed on your system at 10 seconds past 4:00 pm on 3rd October 2014. Restoring a snapshot will give you the exact system that was snapshotted, down to the last byte.

  • Data Compression - BTRFS can automatically compress and decompress data that gets written to the BTRFS volume. This saves a lot of disk space and is similar to the NTFS compression available on Windows. Different compression algorithms can be selected (ZLIB,LZO,etc) to get the desired balance between better compression and faster performance. Un-compressible files like videos and music are automatically stored without compression.

  • Data Block Sharing - Let's say you have a 100GB file that you need to modify 10 times to create 10 different versions. On a normal file system like EXT4 the 10 files will occupy 1000GB space. On a BTRFS file system the different versions of the files can share common data blocks. The total disk space used by all 10 files will be the size of one file plus the modified blocks in each file.

These are just some of the things that you can do with BTRFS. More information is available at the following links:

Bitrot and atomic COWs: Inside "next-gen" filesystems BTRFS Fun

BTRFS Wiki Main Page


The simplest way is to install your system on a BTRFS partition when you install Ubuntu or Linux Mint. In some distributions like Linux Mint, BTRFS is not available by default. You will get the option in GParted only after installing the 'btrfs-tools' package with the following command:

sudo apt-get install btrfs-tools

Install the above package, use GParted to format the partition to BTRFS, then select the partition while installing Ubuntu or Linux Mint. By default it will create 2 subvolumes @ and @home which will be mounted to root (/) and home (/home) directories.

Note: You don't need to specify a separate partition for home while installing Ubuntu since the installer will automatically create a separate subvolume (@home) in the BTRFS partition.


  1. Isn't BTRFS still slower than EXT4 (on SSD)? It's the only reason I am still waiting to use it.

    1. Not really. I have used both EXT4 and BTRFS on my Kingston SV300 SSD and not found any significant difference. Performance depends on various factors. You will get better performance with EXT4 in some cases and with BTRFS for others.

      BTRFS may actually extend the life of SSDs. Being a copy-on-write file system, data is always written to new blocks instead of overwriting existing blocks when a file is modified. This spreads out the writes over all available blocks. EXT4 on the other hand always overwrites existing blocks thus reducing their life.

    2. Thank you for the additional info. Will give it a try than, I just read I can convert a live system (living on the edge here :)

    3. As someone who installed a system last month just to test BTRFS progress from a few years a go, I had horrible performance with it (possibly due to using its compression). Feature wise, BTRFS is a slow, crappy ZFS clone Performance wise, it's extremely slow when compared to XFS. I can copy ZFS to BTRFS at 30mb/s, same ZFS drive to XFS is at 50mb/s. I keep all my backups on a 1.5TB ZFS volume.

      My recommendations for a new user would be XFS if you're not worried about power loss, EXT4 if you are, and ZFS if you're a geek and can deal with the modules and licensing issues. BTRFS wouldn't be my last choice, but it's surely not my first.

      All my tests are done on 7200rpm HDDs because I don't have a SDD.

    4. What kernel did you use, Ricky?
      And how did you benchmark it?

  2. I was working and suddenly I visits your site frequently and recommended it to me to read also. The writing style is superior and the content is relevant. Thanks for the insight you provide the readers!
    facebook entrar
    facebook entrar iniciar sesion
    facebook en español descargar
    facebook entrar direto agora

  3. thiet ke noi that
    thiet ke noi that chung cu Great focuses you composed here..Great stuff...I think you've made some genuinely fascinating points.Keep up the great work.
    thiet ke noi that can ho
    thiet ke noi that van phong Thanks for sharing this interesting blog with us.My pleasure to being here on your blog..I wanna come back here for new post from your site
    thiet ke noi that phong khach
    thiet ke noi that shop wow good ctually how you are no longer really much more well-appreciated than you might be now. thiet ke noi thatthiet ke noi that showroom
    vit om sau, cach lam ga ran


If you are reporting an issue and commenting as an anonymous user, please leave your email address so that I can get in touch with you.