ZFS: Create a raidz filesystem

Home -> UNIX -> Solaris -> System administration

15953 views

From the computer of: qmchenry (335 recipes)
Created: Jun 06, 2006     Updated: Jun 07, 2006


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

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.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  ZFS: Set or change the mount point of a filesystem
  ZFS: How to fsck or check filesystem integrity with scrub
  ZFS: Create a writable clone of a filesystem
  ZFS: Create a new filesystem from an existing pool
  ZFS: Create a basic filesystem or pool using zpool
  Solaris 10: Create multi-terabyte UFS filesystem
  Solaris: Mount filesystem with UFS logging enabled
  Solaris: unmounting a filesystem with umount
  ZFS: Create a mirrored storage pool
  Automatically answer yes to all fsck questions

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.