Search This Blog

2013-04-15

MegaCLI (LSI) Common Commands

Display Adapter Status

The following command will give you:
  • Global information/settings on the physical adapter
  • Adapter capabilities (RAID levels, Drive Types)
  • Image/Firmware Revisions
  • Serial Number
  • Product Name
MegaCli -AdpAllInfo -aAll

Viewing Logical Disk (RAID Volume) Configuration

The following will show all logical device configuration. All configured RAID arrays will be displayed as well as the options used to configured the arrays.

MegaCli -LDInfo -Lall -aAll

Viewing Physical Disk Info

The following will give you information about individual drives and provide:
  • SMART Statistics
  • Size
  • Drive Model
  • Link SPeed
  • Temperature
MegaCli -PDList -aAll

Rebuild Status

When you remove a drive and start rebuilding it's nice to know the progression of the rebuild this can be done by finding out the Enclosure ID and the Physical Disk ID using the "Viewing Physical Disk Info" Section

This will give you a text base progress once you give it the enclosure id and drive id
MegaCli -PDRbld -ShowProg -PhysDrv [32:1] -aALL


The following will give you a visual representation of rebuild progress
MegaCli -PDRbld -ProgDsply [:] -aALL 

Rebuild progress of physical drives...

  Enclosure:Slot               Percent Complete                       Time Elps
       032 :00     ***********************01 %*********************** 00:00:15

    Press  key to quit...

Verifying Battery Status

The following will give you:
  • charge information
  • battery capacity
  • design capacity
MegaCli -AdpBbuCmd -aALL

To ensure the battery is in good health we can do a grep to check some main indicators

MegaCli -AdpBbuCmd -GetBbuStatus -aALL | grep -e '^isSOHGood' -e '^Charger Status' -e '^Remaining Capacity'
This will show is how much capacity the battery has remaining and if its in good status

Show more capacity info

MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aAll

Force a battery re-learn

MegaCli -AdpBbuCmd -BbuLearn -aALL

Change Read Cache Policy

Change to adaptive read ahead

MegaCli -LDSetProp ADRA -LALL -aALL

Change Write Cache Policy

Allows you to change all logical disks to WriteBack cache with battery backup

MegaCli -LDSetProp WB -LALL -aALLTo ensure we only enable write caching when we have a battery backup 

MegaCli -LDSetProp NoCachedBadBBU -LALL -aALLTo force enable write cache even when we do NOT have battery (use only if you have a UPS or do not mind data corruption) 

MegaCli -LDSetProp CachedBadBBU -LALL -aALL

Display RAID Array (Logical Disk) Info

Allows you to view all of the logical arrays configured on the device and their settings/caching policies

MegaCli  -LDInfo -Lall -aAll

Enable/Disable Disk Caching

Enable local caching on disk (not recommended unless protected by UPS)

MegaCli -LDSetProp EnDskCache -LAll -aAllDisable local caching on disk 

MegaCli -LDSetProp DisDskCache -LAll -aAll

Set Time and Date on Controller

MegaCli –AdpSetTime yyyymmdd HH:mm:ss -aN|-a0,1,2|-aALL

Show time and Date

MegaCli –AdpGetTime -aN


Run A RAM Diagnosis

MegaCli64 -AdpDiag 30 -aAll
Afterwards you can grab the log to see the results with "Create an Event log for All Adapter Operations"

Create an Event log for All Adapter Operations

MegaCli -AdpEventLog -GetEvents -f events.log -aALL
It will store a file in the pwd that has all of the adapter configuration changes logged.


Get number of logs on MegaCli Controller

MegaCli64 -AdpEventLog -GetEventLogInfo -aAll

Adapter #0

Newest Seqnum: 0x00011f27
Oldest Seqnum: 0x00005651
Clear Seqnum: 0x00011eac
Shutdown Seqnum: 0x00011f1e
Reboot Seqnum: 0x00011f04

Success in AdpEventLog

Exit Code: 0x00

Get only a certain subset of events

MegaCli -AdpEventLog -GetEvents {-info -warning -critical -fatal} {-f } -aN|-a0,1,2|-aALL

Number of Fatal events since shutdown

MegaCli64 -AdpEventLog -GetSinceShutdown -fatal -f fatal-sinceshut.log -aAll

Success in AdpEventLog

Exit Code: 0x01

Get 10 most recent logs

MegaCli64 -AdpEventLog -GetLatest 10 -f latest.log -aAll

Get PHY Error Counters

MegaCli64 -PhyErrorCounters -aAll

Adapter #0

================
Phy No: 0
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0

Phy No: 1
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0

Phy No: 2
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0

Phy No: 3
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0

Phy No: 4
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0

Phy No: 5
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0

Phy No: 6
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0

Phy No: 7
Invalid DWord Count           : 0
Running Disparity Error Count : 0
Loss of DWord Synch Count     : 0
Phy Reset problem Count       : 0


Exit Code: 0x00

Clear the event log

MegaCli -AdpEventLog -Clear -aN|-a0,1,2|-aALL

No comments:

Post a Comment