Tuesday, February 26, 2019

Replace failed drive in Hardware Raid 1 with MegaCli

Replace failed drive in Hardware Raid 1 with MegaCli


1. First, find out, which disk has failed using the below command:
/path/to/MegaCli64 -PDList -aALL
If the physical disk is healthy, it will have a "Firmware state" of "Online, Spun Up". If any of the disk shows as failed, note down the "Enclosure Device ID" and "Slot Number".

In the below example, we will use the "Enclosure Device ID" of the failed disk as "EID" and "Slot Number" as "SN".

2. Secondly, take the failed disk offline:

/path/to/MegaCli64 -PDOffline -PhysDrv [EID:N] -a0
say, if EID is 250 and SN is 2, our command would be:
/path/to/MegaCli64 -PDOffline -PhysDrv [250:2] -a0
3. Now, mark the failed disk as missing.

/path/to/MegaCli64 -PDMarkMissing -PhysDrv [EID:N]'-a0

/path/to/MegaCli64 -PDMarkMissing -PhysDrv [250:2] -a0
4. Finally, prepare to remove the disk from the array.
/path/to/MegaCli64 -PDPrpRmv -PhysDrv [EIDN] -a0

/path/to/MegaCli64 -PDPrpRmv -PhysDrv [250:2] -a0
5. Manually unplug the failed hard disk and replace it with brand new one. The RAID controller should automatically see the new disk and start the rebuild.

6. Check the physical status of the disk again

/path/to/MegaCli64 -PDList -aALL
You should now see the status of the "Firmware state" as "Rebuild".

7. Give it some time and once the rebuild is complete, the "Firmware state" will show as "Online, Spun Up".

If the disk is marked as foreign, do a full rebuild.
/path/to/MegaCli64 -PDMakeGood -PhysDrv [EID:N] -aALL

/path/to/MegaCli64 -CfgForeign -Clear -aALL

/path/to/MegaCli64 -PDHSP -Set -PhysDrv [EID:N] -aALL
Finally, you can check the status of the rebuild using the below command:


/path/to/MegaCli64 -PDRbld -ShowProg -PhysDrv[EID:N] -a0   

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...