SynologyRS
Storage

Filesystem & disk optimization: Btrfs, ZFS, fstrim

📅 2024-12-30✎ 9 min read

noatime, scheduled fstrim, and when to actually reach for ZFS.

Disk setup is where people either buy themselves trouble or get free performance. Two cheap wins — noatime and scheduled fstrim — cover most home servers. ZFS is a bigger decision and most people do not need it yet.

The two free wins

mount | grep " / "                       # see current opts
# add noatime to the / mount in /etc/fstab
mount -o remount,noatime /
sudo systemctl enable --now fstrim.timer

noatime drops a metadata write on every read; fstrim keeps SSDs fast as they fill. Both are nearly free performance and longevity. Put fstrim on a weekly timer and move on.

Btrfs vs ZFS — the honest take

Btrfs is easier on a small box: it lives in the kernel, snapshots are cheap, and it does not demand a RAM budget. ZFS pays off when you want byte-symmetric snapshots, replication you trust, or datasets with very different policies. The cost is RAM — it wants roughly as much as you can spare.

When to actually switch

zpool status
zfs list -o name,used,health
snaplist=$(zfs snapshot -r -t clone pool/data@check)

If your pool health looks fine and you are not chasing corruption, stay put. Migrating a filesystem is where data actually gets lost, not on the quiet days.