Skip to content
Log In Sign Up info@muvcloud.com

The Short Answer

On most Linux systems, storage is built in layers: RAID with mdadm, volumes with LVM, and a file system such as ext4 on top. ZFS replaces all three. Because one piece of software sees everything from the disks to the files, it can detect and repair corrupted data, which the layered approach cannot. On Linux it is developed as OpenZFS and is distributed as a separate kernel module.

Pools, Vdevs, and Datasets

  • Vdev: a virtual device made of one or more disks with a redundancy type: a single disk, a mirror, or RAID-Z.
  • Pool (zpool): one or more vdevs combined. Data is spread across all vdevs in the pool. If any vdev fails completely, the pool is lost, so every vdev needs its own redundancy.
  • Dataset: a file system created in the pool. Datasets share the pool's space and each has its own settings, such as compression or a quota.
  • Zvol: a block device carved from the pool, often used as a virtual machine disk.

Copy-on-Write and Checksums

ZFS never overwrites a block that is in use. A change is written to a new location, and only then is the pointer to it updated. A crash in the middle leaves the old version intact, so there is no file system check to run after a power loss.

Every block is stored with a checksum, kept in its parent block. On each read, ZFS verifies it. If the data does not match and the vdev has redundancy, ZFS reads the good copy from the mirror or parity and repairs the bad one. A scrub reads the whole pool to find such errors before you need the data:

sudo zpool scrub tank
sudo zpool status tank

Many administrators run a scrub monthly. zpool status shows the state of every disk and any read, write, or checksum errors.

RAID-Z Levels

LayoutDisks that can failLike
MirrorAll but one per mirrorRAID 1
RAID-Z11 per vdevRAID 5
RAID-Z22 per vdevRAID 6
RAID-Z33 per vdevNo common match

Mirrors give the best random performance and rebuild fastest; RAID-Z gives more usable space. The classic levels are compared in RAID levels explained.

Snapshots and Send/Receive

A snapshot is instant and takes no space at first, because of copy-on-write: it keeps the old blocks as they change.

sudo zfs snapshot tank/data@before-upgrade
sudo zfs list -t snapshot
sudo zfs rollback tank/data@before-upgrade

A rollback discards every change made to the dataset since that snapshot, and it goes back only to the most recent snapshot unless you add -r, which destroys the newer snapshots. zfs send turns a snapshot into a stream, and zfs receive rebuilds it on another pool, even on another server over SSH. After the first full copy, incremental sends move only the changed blocks. A snapshot in the same pool is still not a backup; see snapshot vs backup.

Memory and the ARC

ZFS caches data in RAM in the ARC (adaptive replacement cache), which can grow to a large share of memory and gives memory back when programs need it. On a server where applications need predictable memory, cap it with the zfs_arc_max module option, in bytes, in /etc/modprobe.d/zfs.conf:

options zfs zfs_arc_max=8589934592

This example sets 8 GiB. The default limit depends on the OpenZFS version and, on Proxmox VE, on what its installer wrote. The new value applies after a reboot; when the root file system is on ZFS, run sudo update-initramfs -u first on Debian and Ubuntu. ZFS does not require ECC memory, but its checksums protect data on disk, not data in RAM, so servers holding important data use ECC RAM with it.

Where ZFS Is Used

  • Proxmox VE: its installer offers ZFS for the system disks and stores VM disks on zvols. See how to install Proxmox VE.
  • Ubuntu: the kernel module ships with the Ubuntu kernel, and the tools are in the zfsutils-linux package from the universe section.
  • Debian: the zfs-dkms and zfsutils-linux packages are in the contrib section, and DKMS builds the module for each kernel.
  • AlmaLinux and Rocky Linux: packages come from the OpenZFS project's own repository, as DKMS or prebuilt kmod packages.

Look at a Pool

sudo zpool list
sudo zpool status
sudo zfs list

These show pool size and health, each vdev and disk, and every dataset with its used and available space. Creating a pool with zpool create erases the disks you name, so check the device names with lsblk and back up first.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations