RAID-Z Storage Pool Configuration
ZFS supports a RAID-Z configuration with the following fault tolerance levels:
-
Single-parity (
raidz
orraidz1
) – Similar to RAID-5. -
Double-parity (
raidz2
) – Similar to RAID-6. -
Triple-parity (
raidz3
) – For more information, see Triple-Parity RAID and Beyond (https://queue.acm.org/detail.cfm?id=1670144).
In RAID-Z, ZFS uses variable-width RAID stripes so that all writes are full-stripe writes. ZFS integrates file system and device management in such a way that the file system's metadata has enough information about the underlying data redundancy model to handle variable-width RAID stripes. Thus, RAID-Z avoids issues encountered in traditional RAID algorithms such as RAID-5's write hole problem.
ZFS provides self-healing data in a mirrored or RAID-Z configuration. When a bad data block is detected, ZFS fetches the correct data from another redundant copy and repairs the bad data by replacing it with the good copy.
A RAID-Z configuration with n disks of size x with p parity disks can hold approximately (n-p)*x bytes and can withstand p devices failing before data integrity is compromised. You need at least two disks for a single-parity RAID-Z configuration and at least three disks for a double-parity RAID-Z configuration, and so on. For example, if you have three disks in a single-parity RAID-Z configuration, parity data occupies disk space equal to one of the three disks. Otherwise, no special hardware is required to create a RAID-Z configuration.
Just like mirrored configurations, RAID-Z configurations can either be simple or complex.
If you are creating a RAID-Z configuration with many disks, consider splitting the disks into multiple groupings. For example, a RAID-Z configuration with 14 disks is better split into two 7-disk groupings. RAID-Z configurations with single-digit groupings of disks commonly perform better.
See the following sources for more information:
-
Creating a RAID-Z Storage Pool – provides information about creating a RAID-Z storage pool.
-
When to (and Not to) Use RAID-Z – presents guidelines on choosing between a mirrored configuration or a RAID-Z configuration based on performance and disk space considerations.
-
Recommended Oracle Solaris ZFS Practices – covers additional RAID-Z storage pool recommendations.