ZFS Basics

Posted by user12614620 on Oracle Blogs See other posts from Oracle Blogs or by user12614620
Published on Thu, 30 Jun 2011 04:43:45 -0700 Indexed on 2011/06/30 16:27 UTC
Read the original article Hit count: 294

Filed under:

Stage 1 basics: creating a pool

# zpool create $NAME $REDUNDANCY $DISK1_0..N [$REDUNDANCY $DISK2_0..N]...

$NAME = name of the pool you're creating. This will also be the name of the first filesystem and, by default, be placed at the mountpoint "/$NAME"

$REDUNDANCY = either mirror or raidzN, and N can be 1, 2, or 3. If you leave N off, then it defaults to 1.

$DISK1_0..N = the disks assigned to the pool.

Example 1: zpool create tank mirror c4t1d0 c4t2d0

name of pool: tank

redundancy: mirroring

disks being mirrored: c4t1d0 and c4t2d0

Capacity: size of a single disk

Example 2: zpool create tank raidz c4t1d0 c4t2d0 c4t3d0 c4t4d0 c4t5d0

Here the redundancy is raidz, and there are five disks, in a 4+1 (4 data, 1 parity) config. This means that the capacity is 4 times the disk size. If the command used "raidz2" instead, then the config would be 3+2. Likewise, "raidz3" would be a 2+3 config.

Example 3: zpool create tank mirror c4t1d0 c4t2d0 mirror c4t3d0 c4t4d0

This is the same as the first mirror example, except there are two mirrors now. ZFS will stripe data across both mirrors, which means that writing data will go a bit faster.

Note: you cannot create a mirror of two raidzs. You can create a raidz of mirrors, but to do that requires trickery.

© Oracle Blogs or respective owner

Related posts about /Sun/ZFS