What They Share
Both write changed data to new places instead of overwriting it, so snapshots are instant and a crash does not leave half-written blocks. Both checksum data and metadata, detect silent corruption, and repair it from a second copy when one exists. Both manage several disks themselves, without a separate RAID layer, and both can stream snapshots to another machine. The differences are in maturity, licensing, and how they fit into Linux.
Side by Side
| ZFS | Btrfs | |
|---|---|---|
| License | CDDL | GPL |
| In the kernel | No, separate module | Yes |
| Mirrors | Mature | Mature |
| Parity RAID | RAID-Z1, Z2, Z3 | Not recommended |
| Cache | Own (ARC) | Page cache |
| Block volumes | Yes (zvols) | No |
| Tools | zpool, zfs | btrfs |
License and Kernel Integration
Btrfs is part of the mainline kernel and is updated with it. OpenZFS is published under the CDDL, which is widely considered incompatible with the kernel's GPL, so it is built as a separate module. On most systems the module is compiled with DKMS after each kernel update; if a new kernel is not yet supported by the installed OpenZFS release, the pool does not mount until it is. Ubuntu avoids most of that by shipping a prebuilt module with its kernels.
Maturity of the RAID Modes
ZFS mirrors and RAID-Z have been in production use for many years. RAID-Z2 is a common choice for large storage pools, and copy-on-write means it has no classic write hole. Btrfs mirrors (raid1, raid10, raid1c3) are widely used, but the project still advises against its RAID 5 and 6 profiles for important data. For parity RAID, ZFS is the safer pick.
Memory Use
ZFS keeps its own read cache, the ARC, which grows to use much of the memory that programs leave unused and shrinks when they need it. The upper limit can be set with the zfs_arc_max module parameter. ZFS deduplication needs a lot of memory and is best left off unless you have measured the gain. Btrfs uses the normal Linux page cache and has no extra memory needs.
Snapshots and Send and Receive
sudo zfs snapshot tank/data@before-upgrade
sudo btrfs subvolume snapshot -r /mnt/data/www /mnt/data/www-before-upgrade
Both send a snapshot or the difference between two: zfs send -i on ZFS, btrfs send -p on Btrfs. ZFS can resume an interrupted transfer and send encrypted datasets without decrypting them.
Support by Distribution
| Distribution | Btrfs | ZFS |
|---|---|---|
| Ubuntu | In the kernel | Packaged |
| Debian | In the kernel | contrib, DKMS |
| AlmaLinux 10 | In the kernel (10.1+) | OpenZFS repository |
| AlmaLinux 9, Rocky | Not in stock kernel | OpenZFS repository |
On Ubuntu the ZFS tools are in the zfsutils-linux package. openSUSE uses Btrfs for the root file system by default, and Fedora's desktop editions do the same.
Which One to Choose
- Storage server with many disks: ZFS with mirrors or RAID-Z2.
- System disk with snapshots before updates: Btrfs on a distribution that uses it by default, or ZFS on Ubuntu.
- AlmaLinux or Rocky Linux: ZFS from the OpenZFS repository, or XFS on LVM when you do not need its features.
- Backup target: either one, receiving snapshots from servers that use the same file system.
- A plain server: ext4 or XFS, as compared in ext4 vs XFS.
Each file system on its own: what is ZFS and Btrfs explained.