Linux Software raid : Disk status check / Replace




Linux Software raid : Disk status check / replace 


A. Detecting a drive failure

 Need to check the log ile /var/log/messages for disk related error .

 or 

 check the RAID status in /proc/mdstat

 #cat /proc/mdstat 

 Note : If the out put displayed disk with [U_] then there is disk issue.


B.Check the RAID status / Query the RAID status

 # cat /proc/mdstat

  or

 # mdadm --detail /dev/mdx

  or


 # lsraid -a /dev/mdx


C.Manually fail the disk in RAID Array


 # raidsetfaulty /dev/md1 /dev/sdc2

should be enough to fail the disk /dev/sdc2 of the array /dev/md1. If you are using mdadm, just type liek below

  or 

 # mdadm --manage --set-faulty /dev/md1 /dev/sdc2


D. Replace the failed disk in RAID array


 #raidhotremove /dev/md1 /dev/sdc2  ( Consider the failed disk is /dev/sdc2 in array /dev/md1)

  or 

 # mdadm /dev/md1 -r /dev/sdc2 

Now we can fix the new disk and run the below commands.

 # raidhotadd /dev/md1 /dev/sdc2

  or

 # raidhotadd /dev/md1 /dev/sdc2


E.Monitor the RAID status


 # mdadm --monitor --mail=root@localhost --delay=1800 /dev/md2







Post a Comment

0 Comments