Skip to content

RAIDZ Configurations

ZFS RAIDZ configurations provide fault tolerance by distributing data and parity across multiple disks. Unlike traditional RAID levels, RAIDZ in ZFS is more flexible, allowing for dynamic expansion and varying numbers of parity disks. RAIDZ1 uses one parity disk, RAIDZ2 uses two, and RAIDZ3 uses three. These configurations enable the pool to survive disk failures while maintaining data integrity.


Setting Up RAIDZ Pools

To create a RAIDZ pool, use the zpool create command with the raidz keyword. Ensure you have at least three disks for RAIDZ1, four for RAID, and so on.

Example: Creating a RAIDZ1 pool

zpool create myraidz1 raidz /dev/sda /dev/sdb /dev/sdc
This command creates a RAIDZ1 pool with three disks. For RAIDZ2, add four disks:
zpool create myraidz2 raidz /dev/sda /dev/sdb /dev/sdc /dev/sdd

Note: RAIDZ configurations require at least three disks. Always verify disk availability and ensure proper hardware redundancy before creating pools.


Managing RAIDZ Configurations

Adding or Removing Disks

To expand a RAIDZ pool, use zpool add. For example, adding a disk to a RAIDZ1 pool:

zpool add myraidz1 raidz /dev/sdd
This converts the pool to RAIDZ2 by adding an extra parity disk.

To remove a disk (not recommended for active pools), use:

zpool remove myraidz1 /dev/sdd
Warning: Removing disks from RAIDZ pools can disrupt redundancy and should be done with caution.

Replacing Failed Disks

If a disk fails, replace it using zpool replace:

zpool replace myraidz1 /dev/sda /dev/sda1
ZFS will resilver data to the new disk, rebuilding the pool's redundancy. Monitor progress with:
zpool status myraidz1


Monitoring and Troubleshooting

Checking Pool Health

Use zpool status to inspect the pool's state:

zpool status myraidz1
Look for ONLINE, OFFLINE, or DEGRADED states. The -v flag provides detailed information:
zpool status -v myraidz1

Resilvering and Errors

If resilvering fails, check logs with:

zevent -l
Or use zdb for advanced diagnostics:
zdb -v myraidz1

Common Issues

  • Disk failures: Replace failed disks promptly.
  • Resilvering errors: Verify disk connections and SMART status.
  • Insufficient parity disks: Ensure RAIDZ configurations meet redundancy requirements.

Key takeaways

  • RAIDZ1, RAIDZ2, and RAIDZ3 provide 1, 2, or 3 parity disks for fault tolerance.
  • Use zpool create with raidz to set up pools, ensuring sufficient disks for redundancy.
  • Expand pools with zpool add and replace failed disks using zpool replace.
  • Monitor health with zpool status and troubleshoot with zdb or zevent.
  • Always prioritize regular backups and hardware reliability for critical data.