Inside the tarball or zip file you’ll find an RPM archive which contains the megacli and megacli64 binaries (will be installed to /opt/MegaRAID/megacli).
This emergency cheat sheet is not exhaustive, but it should be sufficient in most cases. For a complete reference either call megacli -h or refer to the manual at: LSI megacli Manual
While there are a lot of different parameters for megacli, some of them are always identical. These are described here in short.
The parameter -aN (where N is a number starting with zero or the string ALL) specifies the PERC5/i adapter ID. If you have only one controller it’s safe to use ALL instead of a specific ID, but you’re encouraged to use the ID for everything that makes changes to your RAID configuration.
For commands that operate on one or more physical drives, the -PhysDrv [E:S] parameter is used, where E is the enclosure device ID in which the drive resides and S the slot number (starting with zero). You can get the enclosure device ID using:
megacli -EncInfo -aALLThe E:S syntax is also used for specifying the physical drives when creating a new RAID virtual drive.
The parameter -Lx is used for specifying the virtual drive (where x is a number starting with zero or the string all).
megacli -AdpAllInfo -aALL
megacli -CfgDsply -aALL
megacli -AdpEventLog -GetEvents -f events.log -aALL && cat events.logmegacli -EncInfo -aALLmegacli -LDInfo -Lall -aALLmegacli -PDList -aALL
megacli -PDInfo -PhysDrv [E:S] -aALLmegacli -AdpBbuCmd -aALLmegacli -AdpSetProp AlarmSilence -aALLmegacli -AdpSetProp AlarmDsbl -aALLmegacli -AdpSetProp AlarmEnbl -aALLmegacli -PDOffline -PhysDrv [E:S] -aNmegacli -PDOnline -PhysDrv [E:S] -aNmegacli -PDMarkMissing -PhysDrv [E:S] -aNmegacli -PdPrpRmv -PhysDrv [E:S] -aNmegacli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aNThe number N of the array parameter is the Span Reference you get using:
megacli -CfgDsply -aALLThe number N of the row parameter is the Physical Disk in that span or array starting with zero (it’s not the physical disk’s slot!).
megacli -PDRbld -Start -PhysDrv [E:S] -aN
megacli -PDRbld -Stop -PhysDrv [E:S] -aN
megacli -PDRbld -ShowProg -PhysDrv [E:S] -aNmegacli -PDClear -Start -PhysDrv [E:S] -aN
megacli -PDClear -Stop -PhysDrv [E:S] -aN
megacli -PDClear -ShowProg -PhysDrv [E:S] -aNmegacli -PDMakeGood -PhysDrv[E:S] -aNThis changes drive in state Unconfigured-Bad to Unconfigured-Good.
megacli -PDOffline -PhysDrv [E:S] -aNmegacli -PDMarkMissing -PhysDrv [E:S] -aNmegacli -PDPrpRmv -PhysDrv [E:S] -aNIf you’re using hot spares then the replaced drive should become your new hot spare drive:
megacli -PDHSP -Set -PhysDrv [E:S] -aNIn case you’re not working with hot spares, you must re-add the new drive to your RAID virtual drive and start the rebuilding:
megacli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN
megacli -PDRbld -Start -PhysDrv [E:S] -aN