zfs:troubleshooting:replace_a_disk
This is an old revision of the document!
Table of Contents
ZFS - Troubleshooting - Replace a Disk
Check the Pool
Verifing that a disk is bad and that it needs to be replaced.
zpool status
Add a New Disk
- Add a new disk.
- Optionally remove the old disk.
NOTE: Only remove the old drive at this point if it is a redundant setup.
Replace the Old Device
zpool replace testpool c1t1d0 c2t0d0 zpool offline testpool c1t1d0 zpool remove testpool c1t1d0
NOTE: Here the old device is specified first followed by the new device.
- If the pool is a redundant configuration, data will be copied from other good disks to the new disk.
- If the pool is not redundant, data will be copied from the old device to the new device.
- The old drive should also become detached.
- Once that is complete, the old device can be physically removed.
NOTE: If the old disk is already removed from the system and a new device has replaced it with the same device name, the following command can be used instead:
zpool offline testpool sdd
zpool remove testpool sdd
zpool attach -f testpool sdc sdd
Wait For Resilvering to Complete
Before the pool will be back to normal it will need to sync data over to the new disk.
- It will remain in a degraded status while the data syncs.
- This data syncing process is called resilvering.
- It may take a very long time depending on the size of the disks and on how much data is on them.
The status of the resilvering can be checked:
zpool status testpool
Physically Remove the Old Drive
Physically remove the old drive.
- If it is hot-swappable then just pull it out.
- Otherwise, shutdown the system, before removing the device.
zfs/troubleshooting/replace_a_disk.1634166214.txt.gz · Last modified: 2021/10/13 23:03 by peter