Fedora's Btrfs Root with zstd Compression: A Practical Guide for Engineers
Fedora Workstation uses Btrfs with zstd compression and separate subvolumes for / and /home. Learn how to verify compression, manage snapshots, disable CoW for VMs, and avoid common pitfalls like treating snapshots as backups.
28 Jan 2026, 14:14 UTC

The Real Problem: You Can't Afford to Lose Data, But You Also Can't Afford to Lose Disk Space
Fedora Workstation 33+ uses Btrfs as the default root filesystem with transparent zstd compression. This isn't just a filesystem change—it's a shift in how you manage system state, backups, and storage efficiency. The combination of subvolumes and compression fundamentally changes how snapshots work and how much space your system actually uses.
Understanding the Default Setup
After a fresh Fedora Workstation install, your system has Btrfs with these key characteristics:
- Separate subvolumes for / (root) and /home, allowing independent snapshots
- Transparent compression enabled via
compress=zstd:1mount option - Copy-on-write (CoW) behavior that can fragment large files like VM images
Check your current setup:
findmnt -no FSTYPE,SOURCE,OPTIONS / /home
Expected output shows Btrfs with compression and subvolume settings. On a typical install you'll see:
btrfs /dev/sda2 subvol=root,compress=zstd:1 btrfs /dev/sda2 subvol=home,compress=zstd:1
Verifying Compression is Working
Install compsize to see real-world compression ratios:
sudo dnf install compsize compsize -x /usr
This compares actual disk usage against logical file sizes. On a typical system, you'll see 30-50% reduction for /usr due to compression. The zstd:1 level provides good speed/compression balance—higher levels (zstd:3, zstd:5) offer better compression but require more CPU during writes.
Practical Snapshot Management
Because / and /home are separate subvolumes, you can snapshot the OS without capturing user data:
sudo btrfs subvolume snapshot / /.snapshots/clean-install # Make system changes sudo dnf update # If something breaks, rollback just the OS sudo btrfs subvolume set-default /.snapshots/clean-install /
Important: Snapshots are not backups. They protect against accidental changes, not hardware failure. Always maintain separate backups.
Handling Large Files That Suffer from CoW
Copy-on-write causes fragmentation for files that are frequently rewritten, like VM images or databases. Disable CoW for these directories:
sudo chattr +C /var/lib/libvirt/images sudo btrfs filesystem defragment -r -czstd /var/lib/libvirt/images
Note: chattr +C only affects newly created files. Existing VM images must be copied (not moved) to drop CoW. Create a dedicated non-CoW subvolume for VMs:
sudo btrfs subvolume create /var/lib/libvirt/images-nocow sudo mount -o remount,compress=zstd:1,nodatasum /var/lib/libvirt/images-nocow
Common Mistakes and How to Avoid Them
Mistake 1: Running Out of Space Without Understanding Btrfs Accounting
df reports misleading numbers on Btrfs. Use instead:
btrfs filesystem usage / # Or for per-subvolume: btrfs qgroup show /
Mistake 2: Forgetting to Set CoW Exclusions for VM Images
Without chattr +C, VM images fragment badly, causing performance degradation. Always check VM directories after creating new VMs.
Mistake 3: Treating Snapshots as Backups
Snapshots don't protect against disk failure. Use timeshift or similar tools for snapshot management, but maintain off-system backups.
Mistake 4: Changing Compression Without Re-compressing Data
Editing /etc/fstab to change compression level only affects new writes. To recompress existing data:
sudo btrfs filesystem defragment -r -czstd:3 /path/to/recompress
Configuration Example: Adding a Dedicated VM Subvolume
Here's a complete example for isolating VM storage:
# Create subvolume for VMs (no CoW) sudo btrfs subvolume create /var/lib/libvirt/vm-storage # Add to /etc/fstab with nocow mount option /dev/sda2 /var/lib/libvirt/vm-storage btrfs subvol=vm-storage,compress=zstd:1,nodatasum 0 0 # Mount and set attributes sudo mkdir -p /var/lib/libvirt/vm-storage sudo mount /var/lib/libvirt/vm-storage sudo chattr +C /var/lib/libvirt/vm-storage
Limitations You Must Know
- Btrfs check --repair is officially discouraged—severe corruption may require full restore from backup
- RAID5/6 support has known write-hole issues and is not recommended for production
- Compression level changes require manual remount and don't auto-recompress existing data
- Free space reporting differs from traditional filesystems—use Btrfs-native tools
Verification Checklist
- Confirm Btrfs with compression:
findmnt -no OPTIONS /should showcompress=zstd - Check compression ratio:
sudo compsize -x /usr /varshould show 30%+ reduction - Test snapshot functionality: create, modify, and rollback a test subvolume
- Verify CoW settings for large files:
lsattr /path/to/vm/imagesshould showCflag
The combination of Btrfs subvolumes and zstd compression in Fedora Workstation provides powerful system management capabilities, but requires understanding the underlying mechanics to use effectively. By managing snapshots properly, disabling CoW for large files, and using the right verification tools, you can leverage these features without falling into common pitfalls.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.