- 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.5 Creating a Spare in a Storage Pool
You can add spare vdevs to a pool to increase its reliability and maintain performance. In case of disk failure, ZFS can replace failed disks with spare disks automatically. This gives the administrator time to make repairs without compromising the reliability and performance of the pool. Spares can be shared among multiple pools. The following example adds a spare disk device to the pool mpool. On line 22, the spare vdev is now listed as part of the pool mpool.
1 # zpool add mpool spare c5t14d0 2 # zpool list 3 NAME SIZE USED AVAIL CAP HEALTH ALTROOT 4 dstripe 234M 75K 234M 0% ONLINE - 5 mpool 234M 84K 234M 0% ONLINE - 6 rpool 15.9G 3.20G 12.7G 20% ONLINE - 7 rzpool 936M 141K 936M 0% ONLINE - 8 # zpool status mpool 9 pool: mpool 10 state: ONLINE 11 scrub: none requested 12 config: 13 14 NAME STATE READ WRITE CKSUM 15 mpool ONLINE 0 0 0 16 mirror ONLINE 0 0 0 17 c5t2d0 ONLINE 0 0 0 18 c5t3d0 ONLINE 0 0 0 19 mirror ONLINE 0 0 0 20 c5t4d0 ONLINE 0 0 0 21 c5t5d0 ONLINE 0 0 0 22 spares 23 c5t14d0 AVAIL 24 25 errors: No known data errors
In Figure 2.5, an additional vdev is added to the ZFS pool mpool. A spare vdev can be shared with multiple ZFS pools. The spares must have at least the same capacity of the smallest disk in the other vdev devices.
Figure 2.5 Pool mpool with a spare vdev added