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 11:26] 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 31: | Line 35: | ||
https:// | https:// | ||
- | <note tip>Use '' | + | <note tip>Use '' |
< | < | ||
Line 37: | 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, |
< | < | ||
zpool replace < | zpool replace < | ||
+ | </ | ||
+ | |||
+ | <note tip> | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | zpool replace -f " | ||
</ | </ | ||
Line 53: | 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 < | ||
</ | </ | ||
Line 59: | Line 70: | ||
==== Spares ==== | ==== Spares ==== | ||
- | Usually a spare can replace a faulted disk but remains a spare. | + | Usually a spare can replace a faulted disk but **remains a spare**. The idea behind this is that you replace the faulted disk, then replace the spare with the new and the spare remains a spare. |
If you want to remove the spare property, first remove then replace. | If you want to remove the spare property, first remove then replace. | ||
===== Pool Expansion ===== | ===== Pool Expansion ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
==== CLI ==== | ==== CLI ==== | ||
Line 72: | Line 87: | ||
< | < | ||
+ | # Set the autoexpand property so the new disk space is recognized | ||
zpool set autoexpand=on < | zpool set autoexpand=on < | ||
+ | # Verify everything is online before replacing a disk | ||
zpool status | zpool status | ||
+ | # Take the old, smaller disk offline before removing it | ||
zpool offline < | zpool offline < | ||
- | # Physically replace the disk with the new larger disk | + | ##### Physically replace the disk with the new larger disk ##### |
- | zpool online < | + | zpool online < |
+ | # Optionally kick off the autoexpand of each new larger device | ||
+ | zpool online -e < | ||
</ | </ |