« Sigh | Main

ZFS Basics

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.

« Sigh | Main
Comments:

Post a Comment:
Comments are closed for this entry.
About

Known throughout Sun as a man of infinite wit, of jovial attitude, and of making things up about himself at the slightest whim.

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today