- 2.1 ZFS Pool Concepts
- 2.2 Creating a Dynamic Stripe
- 2.3 Creating a Pool with Mirrored Devices
- 2.4 Creating a Pool with RAID-Z Devices
- 2.5 Creating a Spare in a Storage Pool
- 2.6 Adding a Spare Vdev to a Second Storage Pool
- 2.7 Replacing Bad Devices Automatically
- 2.8 Locating Disks for Replacement
- 2.9 Example of a Misconfigured Pool
2.4 Creating a Pool with RAID-Z Devices
In ZFS you can also create redundant vdevs similar to RAID-5, called RAID-Z. To create a pool with double parity, you would use RAID-Z2 instead.
The following command line will create a ZFS pool named rzpool with two RAID-Z1 vdevs, each with four disks:
# zpool create rzpool raidz1 c5t6d0 c5t7d0 c5t8d0 c5t9d0 raidz1 c5t10d0 c5t11d0 c5t12d0 c5t13d0
The first RAID-Z1 vdev consists of disks c5t6d0, c5t7d0, c5t8d0, and c5t9d0, and the second RAID-Z1 vdev has c5t6d0, c5t7d0, c5t8d0, and c5t9d0 as members.
The zpool list command shows the summary status of the new pool rzpool. The output of zpool status, on lines 16 and 21, shows the RAID-Z1 virtual devices and physical disk devices that make up each RAID-Z1 virtual device.
1 # zpool create rzpool raidz1 c5t6d0 c5t7d0 c5t8d0 c5t9d0 raidz1 c5t10d0 c5t11d0 c5t12d0 c5t13d0 2 # zpool list 3 NAME SIZE USED AVAIL CAP HEALTH ALTROOT 4 dstripe 234M 75K 234M 0% ONLINE - 5 mpool 234M 78K 234M 0% ONLINE - 6 rpool 15.9G 3.21G 12.7G 20% ONLINE - 7 rzpool 936M 138K 936M 0% ONLINE - 8 # zpool status ...lines deleted... 9 pool: rzpool 10 state: ONLINE 11 scrub: none requested 12 config: 13 14 NAME STATE READ WRITE CKSUM 15 rzpool ONLINE 0 0 0 16 raidz1 ONLINE 0 0 0 17 c5t6d0 ONLINE 0 0 0 18 c5t7d0 ONLINE 0 0 0 19 c5t8d0 ONLINE 0 0 0 20 c5t9d0 ONLINE 0 0 0 21 raidz1 ONLINE 0 0 0 22 c5t10d0 ONLINE 0 0 0 23 c5t11d0 ONLINE 0 0 0 24 c5t12d0 ONLINE 0 0 0 25 c5t13d0 ONLINE 0 0 0 26 27 errors: No known data errors |
Figure 2.4 has two RAID-Z1 vdevs with four physical disks to each vdev. The vdevs are concatenated to form the ZFS pool rzpool.
Figure 2.4 Pool rzpool using two RAID-Z1 redundant vdevs