User Tools

Site Tools


computing:storage:zfs_replace_drive

This is an old revision of the document!


ZFS Failed Disk Replacement

https://docs.joyent.com/private-cloud/troubleshooting/disk-replacement

http://docs.oracle.com/cd/E19253-01/819-5461/gbcet/index.html

http://docs.oracle.com/cd/E19082-01/817-2271/ghzvx/index.html

Identify the problem drive and location exactly before replacing!
Power the server off when manipulating disk drives, if at all possible. This can go a long way towards eliminating self inflicted wounds!
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:

Degraded → Offline → Replace

Replace in-place drive:

Degraded → Offline → Remove → Pull Bad Drive → Install New Drive → Initialize → Add to VDEV

Wait for the resilvering to finish then run a scrub job.

CLI

Replace a Failed Drive

https://www.thegeekdiary.com/solaris-zfs-how-to-offline-online-detach-replace-device-in-a-storage-pool/

Use zpool replace to replace a failed drive. It is safest to replace a failed drive with another existent drive in another slot.
zpool replace <poolname> <faileddisk> <newdisk>
To replace a failed drive by replacing it in-place, it is best to shut down the server, remove and replace the failed drive, the use zpool replace specifying only the drive being replaced.
zpool replace <poolname> <disk>
zpool detach will remove a drive from a VDEV, turning a mirrored VDEV into a single drive VDEV. Use zpool attach to recreate the mirror. In general, do not use these commands to replace a failed drive.

Replace Old Drives With New or Bigger

https://www.thegeekdiary.com/solaris-zfs-how-to-offline-online-detach-replace-device-in-a-storage-pool/

It is safest to zpool attach an additional mirror to a mirrored VDEV (which adds redundancy) then remove the drive being upgraded afterwards.
zpool attach <poolname> <existingvdevmember> <newdrive>
# Wait for it to resilver, which adds redundancy
zpool detach <poolname> <drivebeingreplaced>

Spares

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.

computing/storage/zfs_replace_drive.1628095619.txt.gz · Last modified: 2021/08/04 10:46 by gcooper