flash bios
MegaCli -adpfwflash -f /scripts/firmware/lsi_imr_fw.rom -aALL
MegaCli -adpfwflash -f imr_fw.rom -NoVerChk -aAll
MegaCli -adpfacdefset -aALL # reset to factory default
controller info
MegaCli -AdpAllinfo -aALL
MegaCli -PDGetNum -a0 # nubmer of discs
MegaCli -PDInfo -PhysDrv [64:0] -aALL
MegaCli -PDMakeJBOD -PhysDrv[64:4]
clear controller config to defaults
MegaCli -CfgClr -aALL
delete all
MegaCli -CfgLdDel -LALL -aALL
create raid
MegaCli -CfgLdAdd -r5 [64:0, 64:1, 64:2, 64:3] -a0
MegaCli -CfgLdAdd -r0 [64:4,64:5,64:6,64:7] -a0
get free devices
MegaCli -PDList -a0 | grep -e '^Enclosure Device ID:' -e '^Slot Number:'
get raid info
MegaCli -LDInfo -Lall -aALL
MegaCli -PDMakeGood -PhysDrv[64:4] -force -aALL > /dev/null
MegaCli -PDMakeGood -PhysDrv[64:5] -force -aALL > /dev/null
MegaCli -PDMakeGood -PhysDrv[64:6] -force -aALL > /dev/null
MegaCli -PDMakeGood -PhysDrv[64:7] -force -aALL > /dev/null
MegaCli -PDMakeJBOD -PhysDrv[64:4,64:5,64:6,64:7] -a0
MegaCli -CfgLdAdd -r0 [64:4,64:5,64:6,64:7] -a0
MegaCli -AdpEventLog -GetEvents -f logfile -aALL
```
# Dump all events from the adapters event log to a file named logfile
`MegaCli -PDList -aAll` # Dump information about all Phsyical Disks
`MegaCli -LDInfo -LAll -aAll` # Dump information about all Logical Disks on all adapters
`MegaCli -LdPdInfo -aAll` # Dump information of all logical and physical disks on all known adapters
MegaCli -AdpSetProp -EnableJBOD 1 -aALL
MegaCli -CfgDsply -aAll
# adapter diagnostic
`MegaCli -AdpDiag -a0`
Controller information
MegaCli -AdpAllInfo -aALL
MegaCli -CfgDsply -aALL
MegaCli -AdpEventLog -GetEvents -f events.log -aALL && cat events.log
Enclosure information
`MegaCli -EncInfo -aALL`
Virtual drive information
`MegaCli -LDInfo -Lall -aALL
`
Physical drive information
MegaCli -PDList -aALL
MegaCli -PDInfo -PhysDrv [E:S] -aALL
Battery backup information
`MegaCli -AdpBbuCmd -aALL`
Controller management
Silence active alarm
`MegaCli -AdpSetProp AlarmSilence -aALL`
Disable alarm
`MegaCli -AdpSetProp AlarmDsbl -aALL`
Enable alarm
`MegaCli -AdpSetProp AlarmEnbl -aALL`
Physical drive management
Set state to offline
`MegaCli -PDOffline -PhysDrv [E:S] -aN`
Set state to online
`MegaCli -PDOnline -PhysDrv [E:S] -aN
`
Mark as missing
`MegaCli -PDMarkMissing -PhysDrv [E:S] -aN`
Prepare for removal
`MegaCli -PdPrpRmv -PhysDrv [E:S] -aN
`
Replace missing drive
`MegaCli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN
`
Rebuild drive
MegaCli -PDRbld -Start -PhysDrv [E:S] -aN
MegaCli -PDRbld -Stop -PhysDrv [E:S] -aN
MegaCli -PDRbld -ShowProg -PhysDrv [E:S] -aN
Clear drive
MegaCli -PDClear -Start -PhysDrv [E:S] -aN
MegaCli -PDClear -Stop -PhysDrv [E:S] -aN
MegaCli -PDClear -ShowProg -PhysDrv [E:S] -aN
MegaCli -PDMakeGood -PhysDrv[E:S] -aN
Set the drive offline, if it is not already offline due to an error
`MegaCli -PDOffline -PhysDrv [E:S] -aN`
Mark the drive as missing
`MegaCli -PDMarkMissing -PhysDrv [E:S] -aN`
Prepare drive for removal
`MegaCli -PDPrpRmv -PhysDrv [E:S] -aN`
If you’re using hot spares then the replaced drive should become your new hot spare drive:
`MegaCli -PDHSP -Set -PhysDrv [E:S] -aN
`
In 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
MegaCli -CfgLdAdd -r0 [0:1, 0:1] -a0
MegaCli -LDInfo -Lall -aALL
# View all controleler informations
`MegaCli -AdpAllInfo -aAll`
`MegaCli -LDSetProp CachedBadBBU -LALL -aALL`
Delete all devices
`MegaCli -CfgLdDel -LALL -aALL`
`MegaCli -CfgLdAdd -r1 [252:0,252:1] -a0
`
`MegaCli -CfgLdAdd -r10 [252:0,252:1,252:2,252:3] -a0`
# create RAID5
`MegaCli -CfgLdAdd -r5 [64:0,64:1,64:2,64:3] -a0
`
# create RAID10
`MegaCli -CfgSpanAdd -r10 -Array0[64:0,64:1] -Array1[64:2,64:3] -a0`
# create RAID10
`MegaCli -AdpSetProp -EnableJBOD 1`
# Enable disks cache
`MegaCli -LDSetProp EnDskCache -LAll -aAll
`
# Force flash
`MegaCli -adpfwflash -f ./12.12.0-0111.rom -NoVerChk -a0
`
# load controller defauts
`MegaCli -adpfacdefset -aALL`