Hardware

ZFS Explained: Why Homelabs and Servers Use It

ZFS explained: pools, vdevs, RAIDZ, checksums, snapshots, compression and ARC, how it compares with ext4 and Btrfs, and how to plan a pool for a NAS.

By OmniAI Editorial · Nov 23, 2026 · 12 min read

ZFS is a filesystem and volume manager in one, designed to keep data correct. It checksums every block, detects and repairs silent corruption, takes instant snapshots, compresses data on the fly and manages disks in redundant groups without a separate RAID layer. That combination is why ZFS runs under TrueNAS, is built into Proxmox, and is the default answer on homelab forums whenever someone asks how to store data they can't afford to lose.

ZFS asks for a little more planning than a traditional filesystem. Its layout decisions are hard to change later, and it rewards plenty of RAM. This guide explains what ZFS is, how pools and vdevs work, the RAIDZ levels with a capacity table, the features that make it special, how it compares with ext4 and Btrfs, and how to plan a pool for a NAS or server.

ZFS at a Glance

ItemDetail
What it isCombined filesystem and volume manager with built-in redundancy
OriginSun Microsystems; announced in 2004, shipped with OpenSolaris in 2005
TodayOpenZFS, an open-source project for Linux, FreeBSD and other systems
LicenceCDDL, which keeps it out of the mainline Linux kernel
Key featuresChecksums and self-healing, copy-on-write, snapshots and clones, send/receive replication, compression, RAIDZ
Redundancy optionsMirrors, RAIDZ1, RAIDZ2, RAIDZ3
Common platformsTrueNAS, Proxmox VE, FreeBSD, Ubuntu and other Linux distributions
Main trade-offsLayout planning, RAM appetite, licence friction on Linux

What Is ZFS?

What is ZFS file system design, compared with the usual approach? Most storage stacks have separate layers: a RAID controller or mdadm combines disks, a volume manager carves up space, and a filesystem such as ext4 sits on top. None of those layers knows much about the others. (Object stores such as S3 are a different model again; see object storage vs block storage.) ZFS merges them, so the filesystem knows which disks hold each block and can verify and repair data end to end.

ZFS was designed at Sun by a team led by Jeff Bonwick, Bill Moore and Matthew Ahrens. It was announced in September 2004 and released with OpenSolaris in November 2005. After Oracle bought Sun, its ZFS became closed source, and the open-source line continued through illumos and, from 2013, the OpenZFS project. OpenZFS now brings Linux and FreeBSD onto one code base, and its 2.3 release added RAIDZ expansion, the ability to add a disk to an existing RAIDZ group.

Pools, vdevs and datasets

Two dashed groups of three drives under a pool bar, with three folders above, the first folder orange
Disks form vdevs, vdevs form a pool, and datasets share the pool's space.

ZFS has three layers to understand:

LayerWhat it isExample
DiskA physical drive or partitionSix 8 TB hard drives
vdev (virtual device)A group of disks with its own redundancyA 6-disk RAIDZ2 group, or a 2-disk mirror
Pool (zpool)One or more vdevs combined into a single storage space; data is striped across vdevstank, made of one RAIDZ2 vdev
DatasetA filesystem (or a block device, called a zvol) inside the pool, with its own settingstank/photos, tank/backups, tank/vm-disks

The rule that matters most: redundancy lives in each vdev, and losing any vdev loses the whole pool. A pool made of one RAIDZ2 vdev and one single disk is only as safe as that single disk.

Datasets share the pool's free space; there's no fixed partitioning. Each can have its own compression, record size, quota, reservation and snapshot schedule.

ZFS RAIDZ and Mirrors

ZFS RAIDZ is its parity-based redundancy, similar to RAID 5 and 6 but integrated with the filesystem:

LayoutDisks that can fail per vdevComparable toMinimum disks
MirrorAll but one in the mirrorRAID 12
RAIDZ11RAID 53
RAIDZ22RAID 64
RAIDZ33Triple parity5

Approximate usable capacity with six 8 TB disks, before ZFS metadata, padding and the free-space headroom you should keep:

LayoutUsable (approx.)SurvivesNotes
Three 2-way mirrors24 TB1 disk per mirrorBest random performance; easy to grow by adding mirrors
One 6-disk RAIDZ140 TB1 diskRisky with large disks during resilver
One 6-disk RAIDZ232 TBAny 2 disksThe common choice for a home or office NAS
One 6-disk RAIDZ324 TBAny 3 disksFor very large disks or archives

Unlike classic RAID 5, ZFS knows which blocks are in use, so rebuilding a replaced disk, called resilvering, copies only real data, not the whole disk. And because every block has a checksum, ZFS can tell which copy is correct when two disagree.

The Features That Make ZFS Different

Checksums and self-healing

Every block is stored with a checksum, kept in its parent block rather than next to the data. On every read, ZFS recomputes the checksum. If it doesn't match, the block is corrupt: a bad sector, a firmware bug, a cable fault or a misdirected write. With redundancy, ZFS reads a good copy from the mirror or rebuilds it from parity, returns the correct data and rewrites the bad block. This is self-healing, and it catches the silent corruption that traditional RAID passes straight through.

A scrub reads every block in the pool and checks it, repairing what it can. Most people schedule one every few weeks.

Copy-on-write

ZFS never overwrites live data in place. Changes are written to new blocks, and pointers are updated only once the new data is safely on disk. A power cut mid-write leaves the previous consistent state intact, so ZFS has no fsck step after a crash. Recently written data may be lost, but the filesystem stays consistent.

Snapshots and clones

Because of copy-on-write, a snapshot is nearly instant and initially takes no space: it simply keeps the old blocks instead of freeing them. You can keep hundreds, roll a dataset back, or browse old versions of files. A clone is a writable copy made from a snapshot, useful for test copies of databases or virtual machines.

Send and receive

zfs send turns a snapshot, or the difference between two snapshots, into a stream that zfs receive can apply on another pool, even over SSH to another machine. Incremental sends transfer only changed blocks, which makes ZFS-to-ZFS backups fast and efficient.

Compression

Transparent compression is cheap and usually worth enabling. LZ4 is fast enough that it often speeds up hard-drive pools, because less data is read and written. Zstandard compresses harder at more CPU cost. Already-compressed media such as video gains little, and ZFS quickly gives up on blocks that don't shrink.

ARC caching

ZFS caches hot data in RAM in the ARC (adaptive replacement cache), which balances recently and frequently used data. More RAM means more cache hits. An optional SSD L2ARC extends the cache, and an optional SLOG device speeds up synchronous writes, such as those from databases or NFS.

A Few Commands

Creating and using a pool on Linux or FreeBSD:

zpool create -o ashift=12 tank raidz2 /dev/disk/by-id/ata-DISK1 /dev/disk/by-id/ata-DISK2 \
  /dev/disk/by-id/ata-DISK3 /dev/disk/by-id/ata-DISK4 /dev/disk/by-id/ata-DISK5 /dev/disk/by-id/ata-DISK6   # one RAIDZ2 vdev of six disks

zfs set compression=lz4 tank             # children inherit it
zfs create tank/photos
zfs snapshot tank/photos@before-cleanup
zfs list -t snapshot
zpool scrub tank
zpool status tank                        # health, errors, scrub progress
zfs send -i tank/photos@mon tank/photos@tue | ssh backup zfs receive pool/photos

Use stable /dev/disk/by-id/ names rather than /dev/sdX, which can change between boots.

ZFS vs ext4

Left: a single drive with one layer above it; right: three drives under a database stack with an orange band
ext4 is a simple filesystem on one device; ZFS adds redundancy, checksums and snapshots in one stack.

On ZFS vs ext4: ext4 is the default filesystem on many Linux distributions, and it's fast, simple and very mature. It sits on a single block device and leaves redundancy to mdadm or hardware RAID.

ZFSext4
Data checksumsYes, with self-healingMetadata checksums only
Built-in RAIDMirrors and RAIDZNo (use mdadm or LVM)
SnapshotsInstant, built inOnly through LVM, which is slower
CompressionBuilt inNo
Replicationzfs send/receiveExternal tools such as rsync
RAM useUses spare RAM for ARCMinimal
Licence and kernelOut-of-tree module on LinuxIn the Linux kernel
Best forStorage servers, NAS, VM hostsBoot drives, desktops, simple servers

ZFS vs Btrfs

On ZFS vs Btrfs: Btrfs is the Linux-native filesystem with similar goals: copy-on-write, checksums, snapshots, compression and built-in RAID. It's part of the Linux kernel, used by default in Fedora Workstation and openSUSE, and handles mixed disk sizes and reshaping flexibly.

ZFSBtrfs
In the Linux kernelNo (CDDL licence)Yes
MirrorsMatureMature
Parity RAID (5/6)RAIDZ1/2/3, matureRAID 5/6 still carries warnings against production use
Growing arraysAdd vdevs; RAIDZ expansion since OpenZFS 2.3Add or remove disks and rebalance freely
Mixed disk sizesWasteful within a vdevHandled well
CachingARC, L2ARC, SLOGUses the normal Linux page cache
Best forLarge redundant storage poolsDesktops, single disks and mirrors on Linux

For a parity-protected storage pool, ZFS is the safer choice; for a Linux desktop or a simple mirror, Btrfs is a good fit.

Useful Dataset Properties

Each dataset can be tuned for what it stores:

PropertyWhat it controlsTypical setting
compressionTransparent compressionlz4 everywhere; zstd for archives
recordsizeMaximum block size for files1M for large media and backups; 16K–64K for databases; default 128K otherwise
atimeWhether reads update access timesoff to avoid extra writes
quota / refquotaMaximum space a dataset can usePer user, project or VM
reservationSpace guaranteed to a datasetFor critical datasets
copiesExtra copies of each block within the pool2 for a few precious files on a single-disk pool
encryptionNative encryption per datasetSet at creation; keys can be loaded separately

Native encryption is handy for backups: an encrypted dataset can be sent to another machine with zfs send --raw, so the backup host never sees the keys.

Where ZFS Runs

PlatformZFS support
TrueNAS (Community and Enterprise)Built around ZFS; managed from a web interface
Proxmox VEZFS offered at install for the root disk and VM storage
FreeBSDZFS supported in the base system, including as the root filesystem
UbuntuOpenZFS packaged by the distribution
Other Linux distributionsOpenZFS installed as a separate kernel module
macOS and WindowsCommunity ports exist; not for production data

How Much RAM Does ZFS Need?

Less than forum folklore suggests. ZFS works on modest systems; the ARC simply uses free memory and gives it back under pressure. More RAM improves cache hit rates on busy pools. The big exception is deduplication, which keeps a large table of block hashes and can need a lot of memory; most home users should leave it off and use compression instead.

ECC memory is recommended for any server whose job is keeping data safe, but it isn't a special ZFS requirement. Our guide to ECC RAM covers the debate.

Planning a Pool

  1. Decide the vdev layout first. It's the hardest thing to change. RAIDZ2 for bulk storage on large disks; mirrors for VMs and databases.
  2. Buy disks of the same size within a vdev.
  3. Set `ashift=12` (4K sectors) when creating the pool; it can't be changed later.
  4. Enable LZ4 compression at the pool root.
  5. Leave free space. Performance drops as a pool fills; plan to stay below about 80% full.
  6. Create datasets per purpose with their own snapshots and quotas.
  7. Schedule scrubs and snapshots, and alert on errors.
  8. Keep backups elsewhere. Snapshots on the same pool don't protect against losing the pool. Our home server vs NAS guide covers the hardware side.

Is ZFS Worth It?

Is ZFS worth it for you? For a NAS, file server, backup target or virtualisation host holding data you care about, usually yes: checksums, snapshots and replication solve real problems that ext4 on mdadm doesn't. For a laptop, a single-disk desktop or a throwaway cloud server, the planning and memory overhead often aren't worth it, and a simpler filesystem is fine.

Common Mistakes

  • Adding a single disk to a redundant pool as a new vdev, making the whole pool depend on it.
  • Using RAIDZ1 with large disks for important data.
  • Filling the pool close to 100%.
  • Turning on dedup without understanding its memory cost.
  • Using hardware RAID underneath ZFS. Give ZFS the raw disks through an HBA in IT mode.
  • Treating snapshots as backups.

FAQ

Is ZFS good for a home NAS?

Yes. Its checksums, snapshots and RAIDZ protect data well, and NAS operating systems such as TrueNAS make it easy to manage.

Can I add disks to a ZFS pool later?

You can always add another vdev. Since OpenZFS 2.3, you can also add a disk to an existing RAIDZ vdev with RAIDZ expansion.

Does ZFS work on Linux?

Yes, through OpenZFS, as a kernel module. Some distributions, such as Ubuntu, package it directly; others need it installed separately.

Is ZFS faster than ext4?

Not always. ext4 is often faster on a single disk for simple workloads. ZFS can be faster on pools with large caches and compression, but its main advantage is data integrity, not raw speed.

What does a ZFS scrub do?

It reads every block in the pool, checks it against its checksum and repairs damaged blocks from redundant copies or parity.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog