on 04-27-2011 09:09 AM
MegaCli commands have presented a number of questions among our users for Cisco's Physical Security. Here is an attempt to explain thier meaning and uses.
See also: Cisco VSM RAID Viewer
The parameter -aN (where N is a number starting with zero or the string ALL) specifies the 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.
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).
The parameter -Lx is used for specifying the virtual drive (where x is a number starting with zero or the string all).
Running the executable can be accomplished by:
shell> /opt/MegaRAID/MegaCli/MegaCli <cmd>
or
shell> cd /opt/MegaRAID/MegaCli
shell> ./MegaCli <cmd>
MegaCli -AdpAllInfo -aALL
MegaCli -CfgDsply -aALL
MegaCli -adpeventlog -getevents -f lsi-events.log -a0 -nolog
MegaCli -EncInfo -aALL
MegaCli -LDInfo -Lall -aALL
MegaCli -PDList -aALL
MegaCli -PDInfo -PhysDrv [E:S] -aALL
MegaCli -AdpBbuCmd -aALL
MegaCli -AdpGetProp BatWarnDsbl -a0
MegaCli -AdpSetProp AlarmSilence -aALL
MegaCli -AdpSetProp AlarmDsbl -aALL
MegaCli -AdpSetProp AlarmEnbl -aALL
MegaCli -AdpSetProp BatWarnDsbl -a0
MegaCli -AdpSetProp {RebuildRate -60} -aALL
MegaCli -CfgLdAdd -r(0|1|5) [E:S, E:S, ...] -aN
MegaCli -CfgSpanAdd -r10 -Array0[E:S,E:S] -Array1[E:S,E:S] -aN
MegaCli -CfgLdDel -Lx -aN
MegaCli -PDOffline -PhysDrv [E:S] -aN
MegaCli -PDOnline -PhysDrv [E:S] -aN
MegaCli -PDMarkMissing -PhysDrv [E:S] -aN
MegaCli -PdPrpRmv -PhysDrv [E:S] -aN
MegaCli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN
The number N of the Array parameter is from the "Span Reference:" line you get using MegaCli -CfgDsply -aALL, minus the 0x0 part. For VSM systems it's normally 0. The number N of the row parameter is the Physical Disk in that span or array starting with zero (it can be but is not always the physical disk’s slot!).
MegaCli -PDRbld -Start -PhysDrv [E:S] -aN
MegaCli -PDRbld -Stop -PhysDrv [E:S] -aN
MegaCli -PDRbld -ShowProg -PhysDrv [E:S] -aN
MegaCli -PDRbld -ProgDsply -physdrv [E:S] -aN
MegaCli -PDClear -Start -PhysDrv [E:S] -aN
MegaCli -PDClear -Stop -PhysDrv [E:S] -aN
MegaCli -PDClear -ShowProg -PhysDrv [E:S] -aN
MegaCli -PDMakeGood -PhysDrv[E:S] -aN
Changes drive in state Unconfigured-Bad to Unconfigured-Good.
MegaCli -PDHSP -Set -PhysDrv [E:S] -aN
MegaCli -PDHSP -Rmv -PhysDrv [E:S] -aN
MegaCli -PDHSP -Set -Dedicated -ArrayN,M,... -PhysDrv [E:S] -aN
MegaCli -PDMakeGood -PhysDrv [E:S] -aALL
MegaCli -CfgForeign -Clear -aALL
MegaCli -PDHSP -Set -PhysDrv [E:S] -aN
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 -PDMarkMissing -PhysDrv [E:S] -aN
3. Prepare drive for removal
MegaCli -PDPrpRmv -PhysDrv [E:S] -aN
4. Change/replace 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 -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN
MegaCli -PDRbld -Start -PhysDrv [E:S] -aN
On every instance of a hard drive problem with an MSP server, we need to run the following commands to have any information about the problem:
shell> rm –f MegaSAS.log
shell> /opt/MegaRAID/MegaCli/MegaCli -adpallinfo -a0
shell> /opt/MegaRAID/MegaCli/MegaCli -encinfo -a0
shell> /opt/MegaRAID/MegaCli/MegaCli -ldinfo -lall -a0
shell> /opt/MegaRAID/MegaCli/MegaCli -pdlist -a0
shell> /opt/MegaRAID/MegaCli/MegaCli -adpeventlog -getevents -f lsi-events.log -a0 -nolog
shell> /opt/MegaRAID/MegaCli/MegaCli -fwtermlog -dsply -a0 -nolog > lsi-fwterm.log
Collect the MegaSAS.log, lsi-events.log, and the lsi-fwterm.log files from the directory where the commands are run (they can be run from any directory on the MSP server) and attach the logs to the service request. You may use a program such as WinSCP (freeware) to pull the files off of the server.
Usage example:
I had a couple systems down at a customer site after a power failure. When we got to the consoles the 2 systems that were down we saw they were waiting for someone to acknowledge the battery backup was missing on the raid controllers. After we acknowledged those and allowed them to reboot all the way they came back online. I disabled that feature on the raid controllers with the command: MegaCli -AdpSetProp BatWarnDsbl 1 -a0 They had another system that had a degraded raid. The physical drive (enclosure 16:slot 18) was in an unconfigured(bad) state. There were no media errors so I'm not sure how it got that way. Most likely the power hit had just confused the controller for a moment. I set it to unconfigured(good) with : MegaCli -PDMakeGood -PhysDrv[16:18] -a0 Then I tried to make it a hot spare so the raid would pull it back into the volume set: MegaCli -PDHSP -Set -PhysDrv [16:18] -a0 but that failed. So I looked over the PDinfo for it again and saw it had been marked foreign. I cleared the foreign flag with: MegaCli -CfgForeign -Clear -a0 I was then able to make it a hot spare and the raid took the disk over to start its rebuild.
Hi, I have a big problem with one Raid 5 array. Someone known if we can reintroduce a drive mark failed in the array with MegaCli? I explain my problem:
My enclosure has 12 drives. I put 11 disks in Raid 5 and 1 Hot swap Disk. Monday I lost 1 disk. The HSP disk start to rebuild but after some minute, I lost a second disk. Rebuilt stop and I lost all RAID 5 (19TB). But after some manipulation, I was able to repair one disk (I lost disk 5 and after I lost 3, I repair disk 3 by change the electonic board). When I put Disk 3 in the enclosure, MegaCli mark Foreign, Unconfigure(good). I clear the Foreign but The Array is still Offline and When I list with command :
MegaCli -LdPdInfo -aAll
Disk 3 and Disk 5 have still no info.
So, is-it possible to say at the Array that Disk3 are OK and is part of the array and after that I can transfert my data on other disk (I don't have Backup of that Raid 5 Array)?
====
Answer: With the interface of the bios, I add the disk.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: