Monitoring RAID drive health using StorCLI and MegaCLI plus other useful commands


S.M.A.R.T – Self-Monitoring, Analysis and Reporting Technology can be used to monitor and report on the health of storage devices attached to JBOD drive controller. Each storage device maintains SMART counters that can provide detailed information on the status of each storage device. To monitor the health of storage devices attached to RAID controllers requires the use of WebCLI, StorCLI or MegaCLI. LSI StorCLI is the successor of the MegaCLI tool and provides a commandline interface to LSI and IBM MegaRAID drive controllers.

In this article we present a number of examples of useful StorCLI & MegaCLI commands.

Installation

Utilization

Information for general use:

  • /cx bzw. /vx stands for the Controller/Virtual Drive Number.
  • /ex bzw. /sx stands for the Enclosure/Slot ID.

Additional information is also available in the LSI StorCLI Manual (www.lsi.com)

Information on the existing hard drives and their status (IDs,…)

sudo storcli /cx /eall /sall show (all)
Example: sudo storcli /c0 /eall /sall show

Information on the Controller and Configuration

sudo storcli /cx show all
Example: sudo storcli /c0 show all

Information on the existing virtual drives and their status

sudo storcli /cx /vall show (all)
Example: sudo storcli /c0 /vall show

View current status of all rebuilds

sudo storcli /cx /eall /sall show rebuild
Example: sudo storcli /c0 /eall /sall show rebuild

Firmware Update

sudo storcli /cx download file=/path/to/firmware.rom

Activation of Features (e.g. CacheCade, FastPath,…)

 sudo storcli /cx set aso key=AAAAAAAABBBBBBBBCCCCCCCC

Creating a Virtual Drive

sudo storcli /cx add vd type=[RAID0(r0)|RAID1(r1)|...] drives=[EnclosureID:SlotID|:SlotID-SlotID|:SlotID,SlotID]

Example:

sudo storcli /cx add vd type=r1 drives=252:0-2

Initializing a VD

sudo storcli /cx/vx start init (force)

Progress can be monitored using the following command:

sudo storcli /cx/vx show init

Removing a VD

sudo storcli /cx/vx del (force)

Creating a CacheCade device

sudo storcli /cx add vd cc type=r[0,1,10] drives=[EnclosureID:SlotID|:SlotID-SlotID|:SlotID,SlotID]  WT|WB (assignvds=0,1,2)

Example:

sudo storcli /c0 add vd cc type=r1 drives=252:2-3 WB

CacheCade activation/deactivation

sudo storcli /cx/[vx|vall] set ssdCaching=[on|off]

Example:

sudo storcli /c0/v1 set ssdCaching=on

Removing a CacheCade device

sudo storcli /cx/vx del cc

MegaCLI

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

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

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!).

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 as I like to call it)

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

This changes drive in state Unconfigured-Bad to Unconfigured-Good.

Walkthrough: Change/replace 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 -PDMarkMissing -PhysDrv [E:S] -aN

Prepare drive for removal

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

Change/replace the drive

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