bcachefs Explained: What It Promises and Where It Stands
Most filesystem comparisons on Linux come down to ext4, Btrfs, XFS and ZFS. bcachefs is the newer entrant with one design idea the others do not have natively, and a complicated history with the kernel.
The idea
bcachefs grew out of bcache, a block-layer cache that put an SSD in front of spinning disks under an existing filesystem. That worked, and it had the limitation every layered approach has: the filesystem above knows nothing about the caching below it.
bcachefs makes the tiering part of the filesystem. One filesystem spans devices of different speeds, and it promotes hot data to the fast ones automatically, with policy you can set per file and per directory.
# the shape of it
sudo bcachefs format \
--label=ssd.ssd1 /dev/nvme0n1 \
--label=hdd.hdd1 /dev/sda \
--label=hdd.hdd2 /dev/sdb \
--foreground_target=ssd \
--promote_target=ssd \
--background_target=hdd
sudo mount -t bcachefs /dev/nvme0n1:/dev/sda:/dev/sdb /mnt/data
Three targets doing distinct jobs:
foreground_targettakes new writes, so writes land on the SSDpromote_targetreceives frequently read databackground_targetis where data migrates when it cools
That is genuinely nicer than the alternatives. On Btrfs or ZFS you reach for bcache, LVM cache or L2ARC, each of which is a separate layer with its own configuration and failure modes.
The rest of the feature list
Largely what you expect from a modern copy-on-write filesystem:
- Checksumming of data and metadata
- Compression, with zstd, lz4 and gzip
- Writable snapshots of subvolumes
- Replication, with a configurable number of copies per target
- Encryption, built in rather than layered under
- Erasure coding, which has been in development for a long time
# per-directory properties, which is the part Btrfs lacks
sudo bcachefs setattr --compression=zstd /mnt/data/archive
sudo bcachefs setattr --background_target=hdd /mnt/data/archive
sudo bcachefs setattr --promote_target=ssd /mnt/data/active
# device management
sudo bcachefs device add --label=hdd.hdd3 /mnt/data /dev/sdc
sudo bcachefs device evacuate /dev/sdb
sudo bcachefs device remove /dev/sdb
# state
bcachefs fs usage -h /mnt/data
bcachefs show-super /dev/nvme0n1
Built-in encryption is worth a note. It uses ChaCha20 and Poly1305 and sits inside the filesystem rather than beneath it, which means the filesystem knows what is encrypted and can still checksum and compress sensibly. Compare with LUKS, where the filesystem is unaware and the whole device is opaque.
Where it stands
Being direct, because this is the part that matters for anyone considering it.
It reached mainline in Linux 6.7. That is a real milestone and it is not the same as stability.
The on-disk format and tooling have continued to change. Features have been added, fixed and reworked after the merge, which is normal for a young filesystem and means a kernel upgrade can change behaviour.
The relationship with kernel maintainers has been turbulent. Disagreements over the size and timing of fixes sent outside merge windows, and over process generally, have played out publicly. The practical consequence for a user is that which kernel carries which state of the code has been less predictable than for Btrfs or XFS.
That last point is the one with operational weight. Choosing a filesystem means choosing to depend on it being maintained in the kernel you run, and that calculus is less settled here.
# what does your kernel actually have
grep bcachefs /proc/filesystems
modinfo bcachefs 2>/dev/null | head -5
bcachefs version
uname -r
The honest recommendation
Not for data you cannot lose, today.
Reasonable uses:
- A scratch array where the tiering is the point and loss is tolerable
- A media library that is a copy of something else
- Evaluating it deliberately, with tested backups
Not reasonable:
- A root filesystem on a machine you need
- The only copy of anything
- A production server
The comparison that matters is not features, it is recovery. When Btrfs goes wrong there are years of accumulated documentation, mailing list archives and tooling. When ZFS goes wrong the same is true in greater measure. When a young filesystem goes wrong, you are reading source code or asking the author.
Our filesystem comparison covers the mature options, and Btrfs versus ZFS covers the copy-on-write choice most people are actually making.
If you want to try it
# Debian and Ubuntu
sudo apt install bcachefs-tools
# Fedora
sudo dnf install bcachefs-tools
# Arch
sudo pacman -S bcachefs-tools
# a single device, to look at it
sudo bcachefs format --compression=zstd /dev/sdb1
sudo mount -t bcachefs /dev/sdb1 /mnt/test
bcachefs fs usage -h /mnt/test
# subvolumes and snapshots
sudo bcachefs subvolume create /mnt/test/sub
sudo bcachefs subvolume snapshot /mnt/test/sub /mnt/test/snap
sudo bcachefs subvolume list /mnt/test 2>/dev/null
In fstab, note the multi-device syntax:
/dev/nvme0n1:/dev/sda:/dev/sdb /mnt/data bcachefs defaults,nofail 0 0
Use nofail, and keep the fsck field at 0. Our fstab guide covers why.
# check, which is still maturing
sudo bcachefs fsck /dev/sdb1
The broader point
bcachefs is interesting because tiering belongs in the filesystem, and the layered alternatives are genuinely worse at it. If it matures, that design advantage is real.
Whether it matures is a question about sustained maintenance rather than about code, and that is not something a feature table answers. Worth watching, worth trying on a scratch array, and not yet worth your data.
For now: ext4 when you want nothing to think about, Btrfs when you want snapshots and are willing to learn its failure modes, ZFS when you want the most mature option and can accept its licensing situation, XFS for large single-filesystem workloads. Our ZFS guide and Btrfs snapshots guide cover the two most people choose between.
Frequently Asked Questions
What makes bcachefs different from Btrfs and ZFS?
Native multi-device tiering. You can add an SSD and spinning disks to one filesystem and have it promote hot data to the fast device automatically, with per-file and per-directory policy. Btrfs and ZFS need separate caching layers such as bcache or L2ARC to approximate that.
Is bcachefs production ready?
Treat it as not production ready for data you cannot lose. It reached mainline in Linux 6.7 and its on-disk format and tooling have continued to change, and its relationship with upstream has been turbulent. Use it where you have tested backups and tolerance for problems.
What happened between bcachefs and the kernel?
The filesystem was merged in 6.7 and the relationship with kernel maintainers deteriorated over the size and timing of fixes sent outside merge windows, along with disagreements about process. The practical effect is that which kernel version carries which state of the code has been less predictable than for other filesystems.
Can bcachefs replace my Btrfs setup?
Technically it covers the same ground, with snapshots, checksumming, compression and multi-device support. In maturity and tooling it is well behind, and Btrfs has years of production use and much better recovery documentation. Switching a working Btrfs system is hard to justify today.
Does bcachefs support snapshots?
Yes, as writable snapshots of subvolumes, conceptually close to Btrfs subvolumes rather than ZFS datasets. The tooling around them is thinner than Btrfs has, so the snapshot workflows people rely on for rollback are less developed.
What is the difference between bcachefs and bcache?
bcache is a block layer cache that sits under an existing filesystem, so ext4 on top of bcache on top of an SSD and a disk. bcachefs grew out of that work into a full filesystem, so the caching and tiering are part of the filesystem rather than a layer beneath it.