Tag Archives: linux

Restoring a RAID array on Linux (mdadm)

01. Check the status of the raid:
# sudo mdadm –detail /dev/mdX
OR
# sudo cat /proc/mdstat (locate _ in the UUUU section)

02. Locate the broken disk:
# sudo cat /dev/sdX > nul (check HDD led for flashing/permanent light)
# sudo hdparm -i /dev/sdX | grep -i “serialno”

03. Remove the failed drive
# sudo halt
Replace drive (take note of serial number)

04. Locate the new drive
# sudo hdparm -i /dev/sdX | grep -i “serialno”
ex /dev/sdc

05. OPTIONAL: Partition the drive (GPT)
# sudo parted /dev/sdc
parted> mklabel gpt
parted> mkpart primary KB/GB GB

06. Add drive to broken raid
# sudo mdadm /dev/mdX –add /dev/sdc

07. Check status of RAID rebuild
# sudo mdadm –detail /dev/mdX
OR
# sudo cat /proc/mdstat
OR/AND
nmon (to check disk activity)

Now we are done!