Replace disk in failed RAID

Failed disk is /dev/sde and new one is /dev/sdh

First copy the partition data from another disk

# sgdisk /dev/sda -R /dev/sdh
#sgdisk -G /dev/sdh

Reread the partition table

# partprobe /dev/sdh

Remove the failed disk

mdadm --manage /dev/md2 --fail /dev/sde1
mdadm --manage /dev/md2 --remove /dev/sde1

Add new disk

mdadm --manage /dev/md2 --add /dev/sdh1

and wait for rebuild

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *