Show Menu

LSI Logic MegaRAID Cheat Sheet by

DELL PERC5/i Integrated (LSI Logic MegaRAID) Emergency Cheat Sheet

Requir­ements and General Inform­ation

DELL’s PowerEdge RAID Controller (PERC) is a special LSI Logic SAS/SATA RAID Controller and thus the LSI management utility called MegaCli also works for this contro­ller. For older contro­llers like PERC4 and PERC3 please refer to http:/­/li­­ll.c­om­/st­ora­ge.s­html (keyword DellMgr).

MegaCli is available for Linux, DOS, Windows, Netware and Solaris.
You can get it from LSI’s website (search for MegaRAID SAS) or download it here: http:/­/ww­w.l­si.c­om­/su­ppo­rt/­dow­nlo­ads­/me­gar­aid­/mi­sce­lla­neo­us/­lin­ux/­1.0­1.4­0_L­inu­x_C­

Inside the ZIP file you’ll find an RPM archive which contains the MegaCli and MegaCli64 binaries (will be installed to /opt/M­ega­RAI­D/M­ega­Cli).

MegaCli conven­tions

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 (see 5).
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).

Gather inform­ation

Adapter inform­ation
MegaCli -AdpAl­lInfo -aALL
Config­uration inform­ation
MegaCli -CfgDsply -aALL
Events Inform­ation
MegaCli -AdpEv­entLog -GetEvents -f events.log -aALL && cat events.log
Enclosure inform­ation
MegaCli -EncInfo -aALL
Virtual drive inform­ation
MegaCli -LDInfo -Lall -aALL
Physical drive list
MegaCli -PDList -aALL
Physical drive list
MegaCli -PDInfo -PhysDrv [E:S] -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

Virtual drive management

Create RAID 0, 1, 5 drive
MegaCli -CfgLdAdd -r(0|1|5) [E:S, E:S, ...] -aN
Create RAID 10 drive
MegaCli -CfgSp­anAdd -r10 -Array­0[E­:S,E:S] -Array­1[E­:S,E:S] -aN
Remove drive
MegaCli -CfgLdDel -Lx -aN

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
Rebuild drive start
MegaCli -PDRbld -Start -PhysDrv [E:S] -aN
Rebuild drive stop
MegaCli -PDRbld -Stop -PhysDrv [E:S] -aN
Rebuild drive progress
MegaCli -PDRbld -ShowProg -PhysDrv [E:S] -aN
Clear drive start
MegaCli -PDClear -Start -PhysDrv [E:S] -aN
Clear drive stop
MegaCli -PDClear -Stop -PhysDrv [E:S] -aN
Clear drive progress
MegaCli -PDClear -ShowProg -PhysDrv [E:S] -aN
Bad to good
MegaCli -PDMak­eGood -PhysD­rv[E:S] -aN

Hot spare management

Set global hot spare
MegaCli -PDHSP -Set -PhysDrv [E:S] -aN
Remove hot spare
MegaCli -PDHSP -Rmv -PhysDrv [E:S] -aN
Set dedicated hot spare
MegaCli -PDHSP -Set -Dedicated -Array­N,M,... -PhysDrv [E:S] -aN

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

1. Set the drive offline, if it is not already offline due to an error

MegaCli -PDOffline -PhysDrv [E:S] -aN

2. Mark the drive as missing

MegaCli -PDMar­kMi­ssing -PhysDrv [E:S] -aN

3. Prepare drive for removal

MegaCli -PDPrpRmv -PhysDrv [E:S] -aN

4. Change­/re­place the drive

5. If you’re using hot spares then the replaced drive should become your new hot spare drive

MegaCli -PDHSP -Set -PhysDrv [E:S] -aN

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

Please Note

This emergency cheat sheet is not exhaus­tive, but it should be sufficient in most cases.

For a complete reference either call

MegaCli -h

or refer to the manual at:

http:/­/ww­w.l­si.c­om­/fi­les­/do­cs/­tec­hdo­cs/­sto­rag­e_s­tan­d_p­rod­/sa­s/m­r_s­as_­sw_­ug.pdf (Chapter 3 – MegaRAID Command Tool).


This content has been taken from http:/­/to­ols.ra­pid­sof­t.d­e/p­erc­/pe­rc-­che­at-­she­et.html with sincere thanks to the author for distilling the inform­ation into a usable format.

The original author is:
Moritz Mertinkat
moritz AT mertinkat DOT net


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

          Metasploit 4.5.0-dev.15713 Cheat Sheet
          MegaCLI Cheat Sheet
          Windows Terminal Cheat Sheet

          More Cheat Sheets by richardjh

          RedBeanPHP Class Reference Cheat Sheet
          rsync Cheat Sheet
          sqlite3 Cheat Sheet