Skip to main content
BytesProbe
Probe. Diagnose. Secure.

Storage Tools

RAID-Z Calculator (ZFS)

RAID-Z1, Z2 and Z3 capacity for a ZFS pool

Only changes the file system suggestion.

Kept out of the array, ready to take over after a failure.

Usable capacity

30 TB

Shown as about 27.28 TiB in Windows/Linux

Array
5 × 10 TB
Efficiency
60.0%

RAID-Z2 with 5 × 10 TB

Capacity, redundancy and performance for this array
Raw capacity50 TB
Usable capacity30 TB (27.28 TiB)
Used for parity or mirroring20 TB
Storage efficiency60.0%
Fault toleranceSurvives any 2 disk failures.
Hot spares0
Total disks required5
Read performanceup to ~5× single-disk reads
Write performanceup to ~3× single-disk writes; ZFS writes full stripes, so the usual write-penalty figure does not apply
Minimum disks for RAID-Z24

Performance figures are approximations for sequential work on healthy disks. Real throughput depends on the controller, the cache, the workload and whether the array is rebuilding.

Disk layout

Capacity given up to redundancy, one block per disk. Parity is spread across all disks in a real array.

  • Data
  • Data
  • Data
  • Parity
  • Parity
D
Data
P
Parity
M
Mirror
S
Hot spare

What to watch for

RAID 10 may suit this disk count better

With 5 disks, double parity costs a third of the raw capacity and carries a write penalty of 6. RAID 10 gives similar efficiency with far better write performance, at the cost of surviving only one guaranteed failure.

Needs a GPT partition table

At 30 TB the volume is past the 2 TiB an MBR partition table can address. Use GPT when you partition it, or the usable space will stop at 2 TiB.

Rebuild time, roughly

Replacing one failed 10 TB disk takes about 28 hours at a sustained 100 MB/s. This is an estimate: a rebuild on an array that is still serving work is routinely slower, sometimes by several times.

RAID is not a backup

Redundancy protects against a disk failing. It does nothing about deletion, corruption, ransomware, theft or fire, all of which are written faithfully to every disk at once. Keep a separate copy of anything you would miss.

Recommended file system

ZFS

RAID-Z is ZFS. Give it the disks directly through an HBA in IT mode rather than presenting a hardware RAID volume: ZFS manages redundancy itself, and a controller hiding the disks behind its own array stops it from repairing what it detects.

Compare RAID levels

The same 5 disks of 10 TB across every level they are valid for.

Usable capacity, efficiency and fault tolerance by RAID level
Level Usable Efficiency Survives
RAID 0 50 TB 100.0% None
RAID 1 10 TB 20.0% 4 disks
RAID 5 40 TB 80.0% 1 disk
RAID 6 30 TB 60.0% 2 disks
RAID 10 RAID 10 needs an even number of disks. 5 is odd.
RAID 50 RAID 50 needs at least 6 disks.
RAID 60 RAID 60 needs at least 8 disks.
RAID-Z1 40 TB 80.0% 1 disk
RAID-Z2 Selected 30 TB 60.0% 2 disks
RAID-Z3 20 TB 40.0% 3 disks

How RAID-Z differs from hardware RAID

RAID-Z1, Z2 and Z3 hold one, two and three disks' worth of parity, so the capacity arithmetic is the same as RAID 5, RAID 6 and triple-parity RAID. Everything underneath is different, and the differences are the reason to choose it.

usable = (n − parity disks) × size of the smallest disk

ZFS writes variable-width full stripes rather than fixed ones, so it never has to read a stripe back to update part of it. That removes the read-modify-write cycle that gives conventional parity RAID its write penalty, and with it the write hole — the window where a power loss mid-stripe leaves data and parity disagreeing with no way to tell which is right. Hardware controllers address the write hole with a battery; ZFS designs it out.

The other difference is checksums. Every block is checksummed, and ZFS verifies on read. If a disk returns data that is wrong but does not report an error — which happens — ZFS detects it and rebuilds the block from parity. A conventional array cannot: it has no way to know which copy is right.

Two worked examples

Five 10 TB disks in RAID-Z2. (5 − 2) × 10 TB = 30 TB raw usable, 60% efficiency, any two disks may fail.

Eight 8 TB disks in RAID-Z2. (8 − 2) × 8 TB = 48 TB, 75% efficiency. Wider vdevs are more efficient, but they also resilver more slowly, which is the argument for Z3 or for splitting into two vdevs once a group gets very wide.

Why the pool reports less than the arithmetic

Expect noticeably less usable space than the formula gives, and not only because of the TB-to-TiB conversion every file system suffers. ZFS adds its own:

  • Parity and padding are allocated per record, not per stripe, so the real overhead depends on the record size and the width of the vdev. Small records on a wide vdev waste a surprising amount.
  • ZFS reserves a slice of the pool so it can still function when nearly full.
  • Metadata, snapshots and any copies=2 setting take their share.
  • Performance degrades well before the pool is full, because a copy-on-write file system needs free space to write into. Plan to stay below about 80%.

Compression often gives much of it back, and is on by default on current versions.

Choosing Z1, Z2 or Z3

Z1 carries the same rebuild exposure that makes RAID 5 risky on large disks, so it suits small vdevs of small disks. Z2 is the sensible default for most pools. Z3 is for wide vdevs of very large disks, where a resilver runs long enough that two failures during it stop being far-fetched.

Two practical constraints. Give ZFS the disks directly through an HBA in IT mode; a controller presenting a RAID volume hides the individual disks and prevents the self-healing that is the main reason to run it. And a vdev's width is fixed in most deployments: you grow a pool by adding another vdev, or by replacing every disk in an existing one, not by adding a single disk to it.