MegaCli64 Command Usage Cheat Sheet

Friday, February 1, 2013

The MegaCli64 command has a ridiculous amount of command line switches and the syntax is a bit bizarre as well.

The following commands I found useful when trying to physically identify a failed disk and replace it.

Here is a MegaCli64 PDF cheat sheet created by Moritz Mertinkat.

Get Information from All Physical Disks

The -a command line switch specifies the Array ID, in this case All Array IDs.

MegaCli64 -PdList -aAll

Get Virtual Disk Information

The -a command line switch specifies the Array ID, in this case All Array IDs.

MegaCli64 -LDInfo -Lall -aAll

Get the Number of Virtual Drives Configured on Each Adapter

The -a command line switch specifies the Array ID, in this case All Array IDs.

MegaCli64 -LdGetNum -aAll

Get the Number of Array Controllers

MegaCli64 -adpCount

Start Blinking

The -a command line switch specifies the Array ID, in this case Array ID 0.

MegaCli64 -PdLocate -start -physdrv[<ENCLOSURE>:<DRIVE>] -a0

Stop Blinking

The -a command line switch specifies the Array ID, in this case Array ID 0.

MegaCli64 -PdLocate -stop -physdrv[<ENCLOSURE><DRIVE>] -a0

Set Dedicated Hot Spare

The following physical drive was Unconfigured(good):

Enclosure Device ID: 4
Slot Number: 16
Device Id: 154
Sequence Number: 1
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 140014MB [0x11177328 Sectors]
Non Coerced Size: 139502MB [0x11077328 Sectors]
Coerced Size: 139392MB [0x11040000 Sectors]
Firmware state: Unconfigured(good)
SAS Address(0): 0x500000e117951c52
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: FUJITSU MBE2147RC       D905D304PB30AAGJ

When looking at all of the physical drives by running MegaCli64 -PdList -aAll, Array #: 0, 1, 2, 3, 4 were missing a hotspare.

The following command added the Unconfigured(good) physical drive above as a dedicated hotspare:

The -a command line switch specifies the Array ID, in this case Array ID 0.

MegaCli64 -PDHSP -Set -Dedicated -Array0,1,2,3,4 -PhysDrv [4:16] -a0

References

DELL PowerEdge RAID Controller (PERC)

LSIlogic MegaRAID SAS and the self explaining CLI

Managing hardware RAID with MegaCLI

LSI MegaRAID - megacli

Using MegaCli set disk to HotSpare mode in linux



comments powered by Disqus