Stop your Btrfs subvolumes from ballooning into metadata hell
By Saket Jain Published Linux/Unix
Stop your Btrfs subvolumes from ballooning into metadata hell
Technical Briefing | 7/28/2026
Btrfs is great until you hit the wall. You start seeing massive disk usage spikes, and ‘df’ lies to you because of how COW works. I once spent an entire Saturday digging through a production node because the free space reporting was technically correct, but practically useless. If you do not monitor your metadata chunks separately, you are one snapshot away from a read-only filesystem crash.
The metadata allocation trap
Most sysadmins assume Btrfs manages space dynamically for both data and metadata, but metadata chunks are allocated in fixed increments. If you create too many small files or generate constant snapshots, you end up with metadata fragmentation. The kernel cannot allocate new metadata space if the disk is full of stale data, even if your reported free space suggests otherwise.
btrfs filesystem usage /mountpoint
- Check the Device size versus the actual allocated space for metadata
- Keep an eye on the Metadata: ratio in the output, it should not be hitting the ceiling
- Use balance filters to reclaim space if metadata allocation is starving
How to stop the bleeding before it starts
If you are running Btrfs on SSDs, make sure you are mounting with the space_cache=v2 option. The old v1 cache is a known performance killer that bloats metadata usage over time. I have seen systems recover significant headroom just by switching to the newer cache format. It is a minor change in your fstab that saves you from a massive headache down the line.
Next time you feel like your storage is phantom-consuming space, ignore the standard df output and run the usage command. You will likely find your metadata chunks are fragmented or exhausted. Keep your snapshot retention tight, clean up the orphans, and stop treating your subvolumes like a bottomless bucket.
