Updated 2 November 2026 · Published by Zoorik
btrfs is a copy-on-write (COW) filesystem for Linux, part of the Linux kernel. Instead of overwriting data in place, it writes each change to an unused place on the disk.
Not every Linux distribution ships it. Red Hat removed btrfs in Red Hat Enterprise Linux (RHEL) 8.
The main btrfs features
- Subvolumes are separate trees of files inside one btrfs filesystem. You can mount each one as if it were its own filesystem, and all of them share its free space.
- A snapshot is a copy-on-write copy of a subvolume. The two share all their unchanged data, so keeping a filesystem’s history is cheap. btrfs vs LVM compares them with LVM snapshots.
- btrfs keeps checksums on data and metadata. A scrub reads it all back and verifies the checksums while the filesystem stays mounted. Is btrfs stable in 2026? covers scrub and RAID.
- A reflink copy shares the same data as its source until one of them changes. btrfs also supports deduplication, and send and receive for incremental backups.
How btrfs compression works
btrfs supports transparent file compression, so apps read and write files as usual. It offers three algorithms: ZLIB, LZO and ZSTD.
The docs’ example turns it on for the whole filesystem, subvolume mounts included:
$ mount -o compress=zstd /dev/sdx /mnt
With no level given, ZLIB and ZSTD both use level 3. A plain compress with no algorithm means ZLIB. LZO has only one level.
Compression applies only to data written after you turn it on. To compress an existing file, rewrite it with btrfs filesystem defrag -czstd <file>. To compress one file’s future writes, run btrfs property set <file> compression zstd.
Quick checks skip data that won’t compress well. If the first part of a file doesn’t get smaller, btrfs marks the whole file NOCOMPRESS and stops compressing it. The docs advise against compress-force, which tries every block anyway.
Compression needs copy-on-write and data checksums, so the nodatacow and nodatasum options turn it off.
How btrfs grows and shrinks while mounted
One btrfs filesystem can span several disks, with a choice of RAID profiles. It can also grow or shrink in place while it stays mounted.
btrfs device addadds a disk to the mounted filesystem. It’s instant, and doesn’t affect the data already there.btrfs device removemoves all the data off the disk first, so it can take a long time. It fails where the profile can’t allow it, such as RAID1 going from two disks to one.
Why btrfs matters for your cloud cost
Azure charges a managed disk for its provisioned size, however full it is, and doesn’t support shrinking one. AWS says of Amazon Elastic Block Store (EBS) volumes: “You can’t decrease the volume size.”
So a smaller filesystem alone doesn’t make a smaller disk. With btrfs across several disks, you can empty one while it stays mounted. Then you detach and delete it, and its charge stops.
Amoeba moves the data disks of a virtual machine (VM) onto one btrfs pool sized to your data. It grows the pool before it fills. When your data goes down and stays down, it shrinks the pool one disk at a time.
It works on Azure managed disks and Amazon EBS volumes, on Windows and Linux VMs. It never touches the OS disk or root volume. On Linux, the kernel must support btrfs.
Read next: btrfs on multiple disks: how a btrfs pool works
Sources: The Linux Kernel documentation, “BTRFS” (opens in a new tab); BTRFS documentation, “Compression” (opens in a new tab); BTRFS documentation, “btrfs(5)” (opens in a new tab); man7.org, “btrfs-device(8): Linux manual page” (opens in a new tab); Red Hat, “Considerations in adopting RHEL 8: File systems and storage” (opens in a new tab); Microsoft Learn, “Understand Azure Disk Storage billing” (opens in a new tab); Microsoft Learn, “Expand Virtual Hard Disks on a Linux VM” (opens in a new tab); AWS, “Modify an Amazon EBS volume using Elastic Volumes operations” (opens in a new tab).