{{tag>raid megacli}} ====== megacli drive rebuild ====== If you get this error: CRITICAL: megacli:[Volumes(2): DISK0.0:Degraded,DISK1.1:Degraded: Devices(4): 06,07,04=Online 05 (WD-WCC1P1090364WDC WD2000FYYZ-01UL1B1 01.01K02)=Unconfigured(bad)] You need to rebuild the drive. First use [[wiki:smartctl_commands#smartctl_megaraid_check|smartctl]] to check if the disk is ok. Then check which disk is bad with megacli -pdlist -a0 If the disk for example is this one ... Enclosure Device ID: 252 Slot Number: 0 ... get full info megacli -pdinfo -physdrv[252:0] -a0 Steps: 1. Change the state to good megacli -pdmakegood -physdrv "[252:0]" -a0 Adapter: 0: EnclId-252 SlotId-0 state changed to Unconfigured-Good. Exit Code: 0x00 2. If the following commands shows "Foreign flag" in "Foreign state" you need to clear it with: megacli -cfgforeign -clear -a0 Foreign configuration 0 is cleared on controller 0. 3. Designate the drive as hotspare megacli -pdhsp -set -physdrv "[252:0]" -a0 Adapter: 0: Set Physical Drive at EnclId-252 SlotId-0 as Hot Spare Success. 4. The automatic rebuild should now start. Check with megacli -pdinfo -physdrv[252:0] -a0 ... Firmware state: Rebuild ... megacli -pdrbld -showprog -physdrv "[252:0]" -a0 Rebuild Progress on Device at Enclosure 252, Slot 0 Completed 1% in 3 Minutes. Exit Code: 0x00 Or start the rebuild manually with megacli -pdrbld –start –physdrv “[252:0]” –a0 ====== Tested on ====== * ====== See also ====== * [[wiki:megacli_commands|megacli commands]] * [[wiki:output_megacli_predictive_error|output megacli predictive error]] * [[wiki:megacli_replace_disk|megacli replace disk]] ====== References ====== * https://supportforums.cisco.com/t5/security-documents/recovering-a-disk-shown-as-unconfigured-bad-in-raid/ta-p/3116431