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/08/04 10:21] gcooper |
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.</ | ||
Line 27: | Line 31: | ||
===== CLI ===== | ===== CLI ===== | ||
- | Replace a Failed Drive: https:// | + | ==== Replace a Failed Drive ==== |
- | <note tip>Use '' | + | https:// |
+ | |||
+ | <note tip>Use '' | ||
< | < | ||
Line 35: | Line 41: | ||
</ | </ | ||
- | <note tip>To replace a failed drive by replacing it in-place, it is best to shut down the server, remove and replace the failed drive, | + | <note tip>To replace a failed drive by replacing it **in-place**, it is best to shut down the server, remove and replace the failed drive, |
< | < | ||
Line 41: | Line 47: | ||
</ | </ | ||
- | <note tip>'' | + | <note tip>After initializing |
+ | </ | ||
- | Replace Old Drives With New or Bigger: https:// | + | < |
+ | zpool replace -f " | ||
+ | </ | ||
+ | |||
+ | <note tip>'' | ||
+ | |||
+ | ==== Replace Old Drives With New or Bigger | ||
+ | |||
+ | https:// | ||
<note tip>It is safest to '' | <note tip>It is safest to '' | ||
Line 49: | Line 64: | ||
< | < | ||
zpool attach < | zpool attach < | ||
- | # Wait for it to resilver, which adds redundancy | + | # Wait for it to resilver, which adds redundancy, then |
zpool detach < | 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 < | ||
+ | </ |