Table of Contents

NAS - Build a Linux NAS - Support recovering from a faulty disk

Determine which disk has failed

mdadm --detail /dev/md0

returns:

 

Get the serial number of the failed disk

hdparm -i /dev/sdd | grep SerialNo

returns:

Model=ST16000NM001G-2KK103, FwRev=SB30, SerialNo=WL2091XL

NOTE: Double check which actual physical disk has failed and needs to be replaced.


Replace the faulty disk

Steps are:

NOTE: To add a failed drive, for example /dev/sdd1 back to the RAID the following can also be used:

sudo mdadm --manage /dev/md0 --add /dev/sdd1

Recover the Raid

If the original OS dies, but the RAID disks are okay, then rebuild a new OS.

Then, use mdadm to examine the superblock on one of the disks and use this to recover the raid:

mdadm --examine /dev/sda

returns:

 

Then use the listed UUID from the disk to assemble the raid onto the device md0:

mdadm --assemble /dev/md0 --uuid=<UUID>