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 requires one wee 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 thing that’s a little different in a ZFS raidz pool versus other RAID-5 filesystems is that the reported available disk space doesn’t 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. Just an important thing to keep in mind as you monitor your filesystem.










Guest said on December 22, 2008
Would it be correct to assume that utilizing raidz would make data about 30% bigger in size but with the advantage of having an ever-expanding RAID-5? As to say that instead of having the typical trade-off of a RAID-5 with the array minus one HDD… and in this case roughly 30% file size increase? Just wondering.
Tomasz Miklas said on April 27, 2009
In fact 30% is almost like having 2 disks space available in 3 disk RAID-5 array, right?
I would consider them the same in general – done in hardware or software, still requires a drive for parity.
Adam Kwiecien-Fisher said on November 26, 2010
FYI: as of Solaris Express 11, disk usage is reported correctly:
“zfs list” will show the size of the volume (minus parity)
“zpool list” will show the size of the volume (including parity)