A refined, consistent, and practice-focused guide for running Btrfs efficiently on your at1 server. The structure emphasizes clarity, reliability, and long-term maintainability.
1. Overview
Btrfs is a modern copy-on-write filesystem designed for environments where integrity, snapshots, and flexibility are essential. It excels with:
- frequent small writes,
- container storage,
- snapshot-heavy workflows, and
- large multi-device volumes.
With correct mount options and regular maintenance, Btrfs provides excellent performance and data safety for NVMe+HDD or SSD-based RAID setups.
2. Recommended Mount Options
Optimized for SSD-RAID, fast metadata handling, and balanced compression:
- noatime – avoids unnecessary writes.
- ssd, ssd_spread – enables SSD optimization.
- compress=zstd:3 – modern, efficient compression.
- space_cache=v2 – improved metadata caching.
- autodefrag – reduces fragmentation on small-write workloads.
- commit=120 – reduces sync/write bursts.
- subvol=@ – clean separation of root data.
Example: /etc/fstab
UUID=48a6a5b9-eca7-4268-8dc1-8ef10f5d5eaf /mnt/raid1 btrfs noatime,ssd,ssd_spread,compress=zstd:3,space_cache=v2,autodefrag,commit=120,subvol=@ 0 03. Maintenance & Upkeep
Regular care ensures long-term performance and integrity.
3.1 Scrub
Checksums are validated, and redundancy repairs corrupted blocks automatically.
Install:
apt-get install btrfsmaintenanceEnable timer:
systemctl enable --now btrfs-scrub.timerStart scrub manually:
btrfs scrub start /mnt/raid1View scrub status:
btrfs scrub status /mnt/raid13.2 Balance (only occasionally needed)
Useful when metadata or data chunks become unevenly distributed:
btrfs balance start -dusage=75 /mnt/raid13.3 Defragment
Helpful for workloads with many fragmented small files:
btrfs filesystem defrag -r /mnt/raid13.4 Trim for SSDs
Recommended for SSDs to maintain performance:
systemctl enable --now fstrim.timer4. Performance Optimizations
Fine-tuning options to reduce write amplification and improve responsiveness.
4.1 Incus Containers
Avoid CoW on logs:
chattr +C /var/log/incus4.2 Browser Caches
chattr +C ~/.cache4.3 Java Services (e.g., Jitsi)
chattr +C /var/log/jitsi4.4 Dirty Page Limits
Lower latency by controlling write cache size:
vm.dirty_background_bytes = 52428800
vm.dirty_bytes = 2097152004.5 Large Files & Projects
Disable CoW where large sequential writes dominate:
chattr +C /mnt/raid1/PROJECTSYour Btrfs environment is now structured, efficient, and well-aligned with long-term reliability.