Filesystems for NAS

The filesystem on a NAS determines what you can do beyond "store files." Snapshots, checksumming, compression, deduplication, replication, self-healing — all are filesystem features. Picking ext4 vs ZFS vs Btrfs is the choice that defines whether your NAS is just a disk pool or an active data-integrity platform. The choice depends on platform, workload, and how much you trust the filesystem's RAID implementation.

The four main contenders

FilesystemOriginKey feature
ext4Linux mainlineMature, reliable, simple
XFSSGI (now Linux mainline)Scalable, fast, good for large files
BtrfsLinux mainlineCopy-on-write, snapshots, subvolumes
ZFSSun (now OpenZFS)Copy-on-write, RAID-Z, checksums, replication

ext4: the safe default

The default Linux filesystem for over a decade. Journaled (recovers cleanly from crashes), supports files and volumes up to 1 EiB, and has the most operational miles of any Linux filesystem.

What it lacks for NAS use: no native snapshots (LVM provides them at a layer below), no checksumming (silent data corruption goes undetected), no built-in compression or deduplication. Combined with mdadm or hardware RAID it makes a reliable but featureless NAS.

XFS: scalable and fast

Originally from SGI, now stable in the Linux kernel for years. Strengths: parallel I/O scales well across many cores, large-file performance is excellent, online resize and defrag work cleanly. Weaknesses: no native snapshots (rely on LVM or external snapshots), no checksumming of data (only metadata).

XFS is the default in Red Hat Enterprise Linux and is a common choice for media servers and large-file workloads.

Btrfs: copy-on-write on Linux

Designed from the start with modern NAS features in mind: snapshots, subvolumes, checksumming, compression, deduplication, send/receive replication. Used by SUSE and Synology in production.

The cautionary tale: Btrfs RAID-5 and RAID-6 have a long history of "use at your own risk" warnings due to the write-hole problem. Single-disk and RAID-1 (mirroring) Btrfs is generally stable. For RAID-5/6 workloads, most operators use Btrfs on top of mdadm RAID or use ZFS instead.

ZFS: the data-integrity standard

ZFS combines the filesystem and the volume manager into one tightly-integrated system. Every block is checksummed; reads verify the checksum; mismatches trigger repair from redundant copies. Snapshots are instant and free. Send/receive replicates entire datasets to another ZFS pool over the network.

Why ZFS dominates serious NAS deployments:

  • End-to-end integrity. Bit rot is detected and (with redundancy) automatically repaired.
  • RAID-Z. Integrated RAID without the write hole; rebuilds only used data, not the whole disk.
  • Pooled storage. Add disks, expand the pool, allocate datasets without partitioning.
  • Compression and deduplication. Native and tuned for the filesystem.
  • Snapshots and clones. Cheap, instant, mountable.
  • Send/receive replication. Stream incremental changes to a remote pool efficiently.

Why not always: ZFS is RAM-hungry (rule of thumb: 1 GB RAM per 1 TB raw storage, more if dedupe is enabled). Expanding a RAID-Z VDEV requires careful planning. Online RAID-Z expansion is a recent feature (OpenZFS 2.3+).

Copy-on-write in practice

Copy-on-write changes a few things about everyday operation:

  • Snapshots are free. Just keep a pointer to the old block layout; no copy needed.
  • Atomic updates. An interrupted write doesn't corrupt the filesystem — the old state is intact until the new state is committed.
  • Fragmentation. Files that are frequently rewritten can become fragmented. ZFS and Btrfs include defrag (Btrfs more actively).
  • Write amplification on small updates. Modifying one byte requires writing a full block plus metadata.

Checksums: data integrity

Without checksums, the filesystem trusts the disk. If a sector silently returns wrong data (bit rot, controller bug, cable noise), the filesystem doesn't notice. ZFS and Btrfs checksum every block; on read, they verify; on mismatch with redundancy, they repair.

For long-term archival storage (photo libraries, video archives, important documents), checksumming filesystems detect rot that would otherwise corrupt files years later without anyone noticing.

Compression

ZFS supports LZ4 (fast, low CPU) and Zstd (better ratios, more CPU) compression per-dataset. Most workloads see modest space savings (5-30% depending on data type) with negligible CPU cost. Text-heavy data compresses heavily; pre-compressed data (video, audio, JPEGs) doesn't benefit.

Btrfs supports zlib, LZO, and Zstd. ext4 and XFS have no native compression.

Deduplication

ZFS dedupe stores each unique block exactly once. Useful for VM images, backup archives, and similar workloads with high duplication. Memory cost is significant — the dedupe table needs to fit in RAM for performance. Practical rule: enable only when you have RAM to spare and a workload that benefits. See deduplication explained.

Choosing for common scenarios

Use caseRecommended FS
Home NAS with critical data (photos, family videos)ZFS or Btrfs (mirror)
Large media library (movies, music)ZFS (RAID-Z2) or XFS+mdadm RAID-6
VM datastore (high random I/O)ZFS or XFS
Backup target (immutable archive)ZFS with snapshots
Cheap bulk storage, low costext4 or XFS on mdadm
Synology / QNAP applianceWhatever the appliance uses (often Btrfs or ext4)

When to layer above mdadm or hardware RAID

If you use a filesystem without native RAID (ext4, XFS, Btrfs RAID-5/6 caveats), you typically layer it on top of:

  • mdadm — Linux software RAID. Mature; widely used.
  • Hardware RAID controller — fast but adds a dependency on the specific controller hardware.
  • LVM — logical volume manager. Provides flexibility (resize, snapshots) but adds complexity.

ZFS integrates RAID into the filesystem, so you skip this layer.

Frequently Asked Questions

Which filesystem is best for a NAS?

ZFS is the most-recommended choice for serious NAS deployments — built-in checksumming, snapshots, RAID-Z, and self-healing. Btrfs offers similar features on Linux but has a longer history of RAID-5/6 issues; recent versions are stable for single-disk and mirror layouts. ext4 and XFS are mature traditional filesystems but lack the data-integrity features of ZFS or Btrfs and rely on the underlying RAID layer.

What is copy-on-write?

A filesystem design where updates write to a new location instead of overwriting in place. The original data stays intact until the new data is fully committed and references are updated. Enables atomic snapshots (just keep the old references), prevents data corruption from interrupted writes, and supports efficient clones. ZFS and Btrfs are copy-on-write filesystems; ext4 and XFS are not.

What is RAID-Z?

ZFS's RAID variant that solves the RAID-5 "write hole" problem. By integrating RAID into the filesystem, ZFS knows which blocks are in use and which are free, can detect silent corruption via checksums, and rebuilds only used data on disk replacement. RAID-Z1, Z2, and Z3 correspond to RAID-5, RAID-6, and triple-parity equivalents.

Is ZFS available on every operating system?

OpenZFS runs on FreeBSD, Linux (via zfs-on-linux), macOS (via OpenZFS for macOS), and illumos-derived OSes. Native Linux integration is via DKMS or kernel modules. Windows support is experimental. The most production-mature platforms are TrueNAS (FreeBSD/Linux), Proxmox (Linux), and Ubuntu (Linux).

Does my NAS appliance use one of these?

Yes — typically. Synology uses Btrfs for their newer DSM systems (with some proprietary integration); QNAP uses ext4 or ZFS depending on the model; TrueNAS Core/SCALE uses ZFS; Unraid uses XFS with a parity-based pool. Knowing what your appliance uses determines what data-integrity features and snapshot capabilities you have.

Related Guides

More From This Section