Side by Side
| Aspect | ZFS | Btrfs | RAID (mdadm or hardware) |
|---|---|---|---|
| Detects silent corruption | Yes, checksums on every block | Yes, checksums on every block | No |
| Repairs it | Yes, from a mirror or parity | Yes, from a mirror (RAID1/10) | No: cannot tell which copy is right |
| Snapshots | Yes, instant | Yes, instant | No (add LVM or a snapshotting file system) |
| Redundancy | Mirrors, RAID-Z1/2/3 | RAID1/10 stable; RAID5/6 not recommended | RAID 1, 5, 6, 10 |
| In the Linux kernel | No (OpenZFS module; Ubuntu ships it) | Yes | Yes (mdadm) |
| Memory | Uses free RAM as cache | Modest | Modest |
| Best for | NAS, storage servers, parity arrays | Desktops, single disks, mirrors | Simple servers with ext4 or XFS |
ZFS
ZFS combines the volume manager and the file system. Every block is checksummed; when a read fails its checksum, ZFS fetches the good copy from the mirror or rebuilds it from parity and rewrites the bad one. A regular scrub reads everything and repairs quietly decayed blocks before you need them. Snapshots are instant and cost nothing until data changes, and zfs send streams them to another machine.
Its licence keeps it out of the mainline Linux kernel, so it is installed as the OpenZFS module (Ubuntu ships it ready to use). Plan the layout before you start: a RAID-Z group can be widened one disk at a time only since OpenZFS 2.3.
# A two-drive mirror, then a monthly scrub to find and fix bad blocks sudo zpool create tank mirror /dev/nvme0n1 /dev/nvme1n1 sudo zpool scrub tank zpool status tank
Btrfs
Btrfs has the same core ideas, checksums, copy-on-write, snapshots and subvolumes, and is part of the mainline kernel, which makes it the default on Fedora Workstation and openSUSE. It is excellent on a single disk or in RAID1 and RAID10. Its RAID5 and RAID6 modes still carry warnings in its own documentation, so do not use them for data you care about.
Plain RAID
Linux software RAID (mdadm) or a hardware controller keeps several drives in step at the block level, with an ordinary file system such as ext4 or XFS on top. It survives a failed drive and is understood by every tool and rescue system. What it cannot do is notice corruption: if two mirrored copies differ, RAID has no checksum to say which is right. That is acceptable on a server whose important data is backed up elsewhere.
cat /proc/mdstat # array health at a glance sudo mdadm --detail /dev/md0
On a new dedicated server, first checks on a new dedicated server shows how to see what layout you were given and test the drives.
Which to Choose
- A NAS or storage server with several drives: ZFS, with RAID-Z2 for larger arrays.
- A desktop, laptop or single-disk server where snapshots help: Btrfs.
- A two-drive server where simplicity matters most: an mdadm mirror with ext4 or XFS, or a ZFS mirror if you want checksums.
Whatever you pick, keep a backup somewhere the server cannot delete it. The 3-2-1 backup rule explains how.
OpenZFS, Fedora and openSUSE are trademarks of their respective owners. Virteche is not affiliated with or endorsed by them. Details about their products come from their public documentation as of the date at the top of this guide.