Show Menu

MegaCLI Cheat Sheet by

MegaRaid MegaCLI Cheat
linux     megaraid     dell     lsi     megacli     sas     sata

Adapter parameter -aN

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 config­ura­tion.

Physical drive parameter -PhysDrv [E:S]

For commands that operate on one or more pysical 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 -aALL”. The E:S syntax is also used for specifying the physical drives when creating a new RAID virtual drive.

Virtual drive parameter -Lx

The parameter -Lx is used for specifying the virtual drive (where x is a number starting with zero or the string all).

Controller inform­ation

MegaCli -AdpAl­lInfo -aALL
MegaCli -CfgDsply -aALL
MegaCli -AdpEv­entLog -GetEvents -f events.log -aALL && cat events.log

Enclosure inform­ation

MegaCli -EncInfo -aALL

Battery backup inform­ation

MegaCli -AdpBbuCmd -aALL
 

Controller management

Silence active alarm
MegaCli -AdpSe­tProp AlarmS­ilence -aALL
Disable alarm
MegaCli -AdpSe­tProp AlarmDsbl -aALL
Enable alarm
MegaCli -AdpSe­tProp 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 -PDMar­kMi­ssing -PhysDrv [E:S] -aN
Prepare for removal
MegaCli -PdPrpRmv -PhysDrv [E:S] -aN
Replace missing drive
MegaCli -PdRep­lac­eMi­ssing -PhysDrv [E:S] -ArrayN -rowN -aN
The number N of the array parameter is the Span Reference you get using “MegaCli -CfgDsply -aALL” and the 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!).

Physical drive inform­ation

MegaCli -PDList -aALL
MegaCli -PDInfo -PhysDrv [E:S] -aALL

Blinking LED’s

Start blinking
MegaCli pdlocate physdrv \[252:0\] a0
Stop blinking
MegaCli pdlocate stop physdrv \[252:0\] a0
where 252 is the enclos­ure’s device id, find it out via:
MegaCli encinfo a0
 

Virtual drive inform­ation

MegaCli -LDInfo -Lall -aALL

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

Bad to good (or back to good)

MegaCli -PDMak­eGood -PhysD­rv[E:S] -aN
This changes drive in state Unconf­igu­red-Bad to Unconf­igu­red­-Good.

Walkth­rough: Change­/re­place a drive

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 -PDMar­kMi­ssing -PhysDrv [E:S] -aN
Prepare drive for removal
MegaCli -PDPrpRmv -PhysDrv [E:S] -aN
Change­/re­place the 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 -PdRep­lac­eMi­ssing -PhysDrv [E:S] -ArrayN -rowN -aN
MegaCli -PDRbld -Start -PhysDrv [E:S] -aN

Download the MegaCLI Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/chubbard_megacli.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          LSI Logic MegaRAID Cheat Sheet