ThorneLabs

MegaCli64 Command Usage Cheat Sheet

• Updated November 13, 2018


The MegaCli64 command has a ridiculous amount of command line switches, and I found the syntax of those command line switches to be very confusing.

What follows are the commands I found useful when trying to physically identify a failed disk and then replace it.

Moritz Mertinkat has also put together a MegaCli64 PDF cheat sheet. In the event the source link ever 404s, a mirror can be found here.

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

If you found this post useful and would like to help support this site - and get something for yourself - sign up for any of the services listed below through the provided affiliate links. I will receive a referral payment from any of the services you sign-up for.

Get faster shipping and more with Amazon Prime: About to order something from Amazon but want to get more value out of the money you would normally pay for shipping? Sign-up for a free 30-day trial of Amazon Prime to get free two-day shipping, access to thousands of movies and TV shows, and more.

Thanks for reading and take care.