User Tools

Site Tools


wiki:megacli_drive_rebuild

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 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

References

wiki/megacli_drive_rebuild.txt · Last modified: 2022/11/12 12:55 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki