HomeSolarisSolaris system administrationZFS: Create a raidz Filesystem

ZFS: Create a raidz Filesystem

ZFS supports a type of RAID-5 redundancy called raidz. This redundancy works at the ZFS pool level and affects all created filesystems in that pool. According to the Sun docs, raidz offers “better distribution of parity [than RAID-5] and eliminates the ‘RAID-5 write hole’ (in which data and parity become inconsistent after a power loss).” Creating RAID volumes in most volume managers (like VeritasVM) requires learning a new language describing the various components involved. ZFS only requires one command.


Creating a raidz pool is similar to creating a normal pool. Only the addition of the ‘raidz’ keyword is required:

zpool create rex raidz c1t0d3 c1t0d4 c1t0d5 c1t0d6

This command creates a raidz pool named “rex” consisting of four disks. One aspect that is slightly different in a ZFS raidz pool versus other RAID-5 filesystems is that the reported available disk space does not subtract the space required by parity. Consider the following “zfs list” output before and after creating a 10G file in a raidz filesystem.

# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rex 219K 76.8G 49K /rex
# cd /rex
# mkfile 10g bigfile
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rex 13.4G 63.4G 13.4G /rex

Although the file added only 10G to the filesystem, the change in the used space is 13.4G, so the parity is reflected in the usage. This is important to keep in mind as you monitor your filesystem.

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

3 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments

Cleveland Furia on How to Clear Google Activity
Sid Wohlfarth on How to Clear Google Activity
Riley Magsayo on How to Clear Google Activity
สมัครรับเครดิตฟรี ทันที on How to improve Remote Desktop Protocol Performance
Neal Wangstad on How to Clear Google Activity
Slavcho Andov on How to install Ubuntu
Slavcho Andov on How to fix bad sectors
Sheraz Ali on How to Backup Android