This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computing:storage:zfs_replace_drive [2021/03/29 14:21] gcooper old revision restored (2021/03/29 10:00) |
computing:storage:zfs_replace_drive [2023/07/05 11:39] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== ZFS Failed Disk Replacement ====== | ====== ZFS Failed Disk Replacement ====== | ||
+ | |||
+ | **Hot Spares**: https:// | ||
+ | |||
+ | **Hot Spares**: https:// | ||
https:// | https:// | ||
Line 9: | Line 13: | ||
<note important> | <note important> | ||
- | <note tip> | + | <note tip> |
<note tip>The normal replacement procedure involves fixing the pool first, then removing the failed drive. Replace in-place if you must.</ | <note tip>The normal replacement procedure involves fixing the pool first, then removing the failed drive. Replace in-place if you must.</ | ||
+ | |||
+ | ===== Napp-IT ===== | ||
Replace with spare: | Replace with spare: | ||
Line 19: | Line 25: | ||
Replace in-place drive: | Replace in-place drive: | ||
- | **Degraded -> Offline -> Remove -> Pull bad drive -> Install New Drive -> Initialize -> Add to VDEV** | + | **Degraded -> Offline -> Remove -> Pull Bad Drive -> Install New Drive -> Initialize -> Add to VDEV** |
Wait for the **resilvering** to finish then run a **scrub** job. | Wait for the **resilvering** to finish then run a **scrub** job. | ||
+ | |||
+ | ===== CLI ===== | ||
+ | |||
+ | ==== Replace a Failed Drive ==== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | <note tip>Use '' | ||
+ | |||
+ | < | ||
+ | zpool replace < | ||
+ | </ | ||
+ | |||
+ | <note tip>To replace a failed drive by replacing it **in-place**, | ||
+ | |||
+ | < | ||
+ | zpool replace < | ||
+ | </ | ||
+ | |||
+ | <note tip> | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | zpool replace -f " | ||
+ | </ | ||
+ | |||
+ | <note tip>'' | ||
+ | |||
+ | ==== Replace Old Drives With New or Bigger ==== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | <note tip>It is safest to '' | ||
+ | |||
+ | < | ||
+ | zpool attach < | ||
+ | # Wait for it to resilver, which adds redundancy, then | ||
+ | zpool detach < | ||
+ | </ | ||
+ | |||
+ | ==== Spares ==== | ||
+ | |||
+ | Usually a spare can replace a faulted disk but **remains a spare**. | ||
+ | |||
+ | If you want to remove the spare property, first remove then replace. | ||
+ | |||
+ | ===== Pool Expansion ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | ==== CLI ==== | ||
+ | |||
+ | <note tip>You can expand a ZFS pool by replacing redundant drives on replacing them **one at a time**. | ||
+ | |||
+ | <note tip>Shut down the server to physically replace drives. If you have hotswap capability, you can use '' | ||
+ | |||
+ | < | ||
+ | # Set the autoexpand property so the new disk space is recognized | ||
+ | zpool set autoexpand=on < | ||
+ | # Verify everything is online before replacing a disk | ||
+ | zpool status | ||
+ | # Take the old, smaller disk offline before removing it | ||
+ | zpool offline < | ||
+ | ##### Physically replace the disk with the new larger disk ##### | ||
+ | zpool online < | ||
+ | # Optionally kick off the autoexpand of each new larger device | ||
+ | zpool online -e < | ||
+ | </ |