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, you can help support this site and get something for yourself by signing up for any of the services listed below through the provided links.

The following links are part of affiliate programs, and I will receive a referral payment from any of the services you sign-up for.

  • Get Faster Shipping: Perhaps you're about to order some stuff on 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.
  • Start Investing Now: Are you looking to start investing some of your disposable saved income? Get started by opening an account with Webull, where upon sign-up and opening a brokerage account with an initial deposit of at least $100 you will receive 1 stock valued (subject to change based on normal market movement) between $8 and $1600.

Thanks for reading and take care.