MegaCLI CheatSheet (2)

0
1045

Get raid controller log

  • MegaCli64 -adpeventlog -getevents -f lsi-events.log -a0 -nolog

Raid Controller and Drive Status

  • /opt/MegaRAID/MegaCli/MegaCli -LDInfo -LAll -aAll -a0
      [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli -LDInfo -LAll -aAll
      Adapter 0 -- Virtual Drive Information:
      Virtual Drive: 0 (Target Id: 0)
      Name                :
      RAID Level          : Primary-6, Secondary-0, RAID Level Qualifier-3
      Size                : 3.635 TB
      Is VD emulated      : No
      Parity Size         : 3.635 TB
      State               : Optimal
      Strip Size          : 64 KB
      Number Of Drives    : 4
      Span Depth          : 1
      Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
      Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
      Default Access Policy: Read/Write
      Current Access Policy: Read/Write
      Disk Cache Policy   : Enabled
      Encryption Type     : None
      Bad Blocks Exist: No
      Is VD Cached: No
      
      
      Virtual Drive: 1 (Target Id: 1)
      Name                :
      RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
      Size                : 1.817 TB
      Is VD emulated      : Yes
      Mirror Data         : 1.817 TB
      State               : Optimal
      Strip Size          : 64 KB
      Number Of Drives    : 2
      Span Depth          : 1
      Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
      Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
      Default Access Policy: Read/Write
      Current Access Policy: Read/Write
      Disk Cache Policy   : Enabled
      Encryption Type     : None
      Bad Blocks Exist: No
      Is VD Cached: No
      
      
      Virtual Drive: 2 (Target Id: 2)
      Name                :
      RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
      Size                : 930.390 GB
      Is VD emulated      : No
      Mirror Data         : 930.390 GB
      State               : Optimal
      Strip Size          : 64 KB
      Number Of Drives    : 2
      Span Depth          : 1
      Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
      Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
      Default Access Policy: Read/Write
      Current Access Policy: Read/Write
      Disk Cache Policy   : Enabled
      Encryption Type     : None
      Bad Blocks Exist: No
      Is VD Cached: No 

List any drive errors, warnings etc

  • /MegaCli64 -CfgDsply -a0 | grep -ie “fail\|error\|inquiry\|\warn\|s.m.a.r.t.”

List Disk Groups and Disks

  • ./MegaCli64 -CfgDsply -a0

List drives by Enclosure Device ID and Slot Number

  • MegaCli64 -PDList -a0|grep -E ‘Inquiry|Firmware|Slot|ID’

Autorebuild Status

  • /opt/MegaRAID/MegaCli/MegaCli -AdpAutoRbld -Dsply -a0 *
   * [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli -AdpAutoRbld -Dsply -a0
   Adapter 0: AutoRebuild is Enabled. 

Query Rebuild Rate

  • /opt/MegaRAID/MegaCli/MegaCli -AdpGetProp RebuildRate -a0
   [email protected]:/oldroot/home# /opt/MegaRAID/MegaCli/MegaCli -AdpGetProp RebuildRate -a0
   Adapter 0: Rebuild Rate = 30%
   Exit Code: 0x00 

Enable Disk Drive Cache

  • /opt/MegaRAID/MegaCli/MegaCli -LDSetProp -EnDskCache -Immediate -LAll -aAll
   [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli -LDSetProp -EnDskCache -Immediate -LAll -aAll

   Set Disk Cache Policy to Enabled on Adapter 0, VD 0 (target id: 0) success
   Set Disk Cache Policy to Enabled on Adapter 0, VD 1 (target id: 1) success
   Set Disk Cache Policy to Enabled on Adapter 0, VD 2 (target id: 2) success

   Exit Code: 0x00 

Enable Read-Ahead

  • /opt/MegaRAID/MegaCli/MegaCli -LDSetProp -RA -Immediate -LALL -aALL
   * [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli -LDSetProp -RA -Immediate -LALL -aALL
   Set Read Policy to ReadAhead on Adapter 0, VD 0 (target id: 0) success
   Set Read Policy to ReadAhead
 on Adapter 0, VD 1 (target id: 1) success
   Set Read Policy to ReadAhead on Adapter 0, VD 2 (target id: 2) success
   Exit Code: 0x00 

Enable Write Back Cache on Raid Cntroller

  • */opt/MegaRAID/MegaCli/MegaCli -LDSetProp WB -LALL -aALL *
    • Note: if the battery is low or missing you will see something like this
      [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli -LDSetProp WB -LALL -aALL 
      Adapter 0: Get BBU Status Failed.
      So policy Change to WB will not come into effect immediately
      Set Write Policy to WriteBack on Adapter 0, VD 0 (target id: 0) success
      Adapter 0: Get BBU Status Failed. 

Check Battery Status

  • /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll
      [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll
      BBU status for Adapter: 0
      BatteryType: iBBU
      Voltage: 4029 mV
      Current: 199 mA
      Temperature: 38 C
      Battery State: Degraded(Need Attention

Force Battery Learn Cycle

  • /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -BbuLearn -aALL

Disable Write Cache if battery is bad

  • MegaCli64 -LDSetProp -NoCachedBadBBU -Immediate -Lall -aAll

Enable Write Back Cache even if Battery is dead or missing

  • [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -CachedBadBBU -Immediate -Lall -aAll
      [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -CachedBadBBU -Immediate -Lall -aAll
      Set Write Cache OK if bad BBU on Adapter 0, VD 0 (target id: 0) success
      Set Write Cache OK if bad BBU on Adapter 0, VD 1 (target id: 1) success
      Set Write Cache OK if bad BBU on Adapter 0, VD 2 (target id: 2) success
      Exit Code: 0x00 

Check NCQ status

  • /opt/MegaRAID/MegaCli/MegaCli64 -AdpGetProp -NCQDsply -aALL *
      * [email protected]:~# /opt/MegaRAID/MegaCli/MegaCli64 -AdpGetProp -NCQDsply -aALL
      Adapter 0: NCQ Status is Enabled
      Exit Code: 0x00 

Finding faulty drive

  • MegaCli64 -CfgDsply -a0

Start Blink LED on srive

  • MegaCli64 -PdLocate -start -physdrv[252:0] -aALL
  • Note: Enclosure ID: 252, Slot: 0

Stop Blink LED on srive

  • MegaCli64 -PdLocate -start -physdrv[252:0] -aALL
    • Note: Enclosure ID: 252, Slot: 0

Contoller Information

  • MegaCli/MegaCli64 -adpallinfo -a0

Silence Alarms

Take drive offline

*MegaCli/MegaCli64 -PDOffline -PhysDrv [252:3] -a0

  • Note: * Note: *Enclosure ID: 252, Slot: 3*

Verify drive state

  • MegaCli64 -PdInfo -PhysDrv 252:3] -a0 | grep state
    • Note: * Note: *Enclosure ID: 252, Slot: 3*

Example finding failed disk and blinking the led on it

  • List Drive status – see listing below for output for this example
    • MegaCli64 -CfgDsply -a0
  • Blink Failing drive
    • Note looking at the listing below you will see the following information on the bad drive
      • Enclosure Device ID: 252
      • Slot Number: 0
      • Enclosure position: 0
    • MegaCli64 -PdLocate -start -physdrv[252:0] -aALL
      • We used Enclosure Device ID: 252 and Slot Number: 0
MegaCli64 -CfgDsply -a0
==============================================================================
Adapter: 0
Product Name: LSI 2108 MegaRAID
Memory: 512MB
BBU: Present
Serial No: 
==============================================================================
Number of DISK GROUPS: 3

DISK GROUP: 0
Number of Spans: 1
SPAN: 0
Span Reference: 0x00
Number of PDs: 4
Number of VDs: 1
Number of dedicated Hotspares: 0
Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :
RAID Level          : Primary-6, Secondary-0, RAID Level Qualifier-3
Size                : 3.635 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 4
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
Access Policy       : Read/Write
Disk Cache Policy   : Enabled
Encryption Type     : None
Bad Blocks Exist: No
Physical Disk Information:
Physical Disk: 0
Enclosure Device ID: 252
Slot Number: 0
Enclosure position: 0
Device Id: 5
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 1
Last Predictive Failure Event Seq Number: 347191
PD Type: SAS
Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.817 TB [0xe8b6d000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x5000c50025e6fbb1
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: SEAGATE ST32000444SS    00069WM345GE            
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :44C (111.20 F)



Physical Disk: 1
Enclosure Device ID: 252
Slot Number: 1
Enclosure position: 0
Device Id: 6
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.817 TB [0xe8b6d000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x5000c50062bcffb1
SAS Address(1): 0x0
Connected Port Number: 6(path0) 
Inquiry Data: SEAGATE ST2000NM0023    0004Z1X3KAP4            
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :45C (113.00 F)



Physical Disk: 2
Enclosure Device ID: 252
Slot Number: 2
Enclosure position: 0
Device Id: 7
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.817 TB [0xe8b6d000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x5000c50062bd14cd
SAS Address(1): 0x0
Connected Port Number: 1(path0) 
Inquiry Data: SEAGATE ST2000NM0023    0004Z1X3KA7L            
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :44C (111.20 F)



Physical Disk: 3
Enclosure Device ID: 252
Slot Number: 3
Enclosure position: 0
Device Id: 8
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.817 TB [0xe8b6d000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x5000c50025e5fad5
SAS Address(1): 0x0
Connected Port Number: 3(path0) 
Inquiry Data: SEAGATE ST32000444SS    00069WM33DYT            
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :39C (102.20 F)



DISK GROUP: 1
Number of Spans: 1
SPAN: 0
Span Reference: 0x01
Number of PDs: 2
Number of VDs: 1
Number of dedicated Hotspares: 0
Virtual Drive Information:
Virtual Drive: 1 (Target Id: 1)
Name                :
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 1.817 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
Access Policy       : Read/Write
Disk Cache Policy   : Enabled
Encryption Type     : None
Bad Blocks Exist: No
Physical Disk Information:
Physical Disk: 0
Enclosure Device ID: 252
Slot Number: 4
Enclosure position: 0
Device Id: 10
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.817 TB [0xe8b6d000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x4433221104000000
Connected Port Number: 7(path0) 
Inquiry Data:      WD-WCAZA8177192WDC WD20EARS-00MVWB0                    51.0AB51
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 3.0Gb/s 
Link Speed: 3.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :30C (86.00 F)



Physical Disk: 1
Enclosure Device ID: 252
Slot Number: 5
Enclosure position: 0
Device Id: 9
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.817 TB [0xe8b6d000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x4433221105000000
Connected Port Number: 2(path0) 
Inquiry Data:      WD-WMAZA6728709WDC WD20EARX-00PASB0                    51.0AB51
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :36C (96.80 F)



DISK GROUP: 2
Number of Spans: 1
SPAN: 0
Span Reference: 0x02
Number of PDs: 2
Number of VDs: 1
Number of dedicated Hotspares: 0
Virtual Drive Information:
Virtual Drive: 2 (Target Id: 2)
Name                :
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 930.390 GB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU
Access Policy       : Read/Write
Disk Cache Policy   : Enabled
Encryption Type     : None
Bad Blocks Exist: No
Physical Disk Information:
Physical Disk: 0
Enclosure Device ID: 252
Slot Number: 6
Enclosure position: 0
Device Id: 11
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 931.512 GB [0x74706db0 Sectors]
Non Coerced Size: 931.012 GB [0x74606db0 Sectors]
Coerced Size: 930.390 GB [0x744c8000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x4433221106000000
Connected Port Number: 4(path0) 
Inquiry Data:      WD-WMATV0360069WDC WD1002FBYS-01A6B0                   03.00C05
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 3.0Gb/s 
Link Speed: 3.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :44C (111.20 F)



Physical Disk: 1
Enclosure Device ID: 252
Slot Number: 7
Enclosure position: 0
Device Id: 4
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 931.512 GB [0x74706db0 Sectors]
Non Coerced Size: 931.012 GB [0x74606db0 Sectors]
Coerced Size: 930.390 GB [0x744c8000 Sectors]
Firmware state: Online, Spun Up
SAS Address(0): 0x4433221107000000
Connected Port Number: 5(path0) 
Inquiry Data:      WD-WMATV0407068WDC WD1002FBYS-01A6B0                   03.00C05
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 3.0Gb/s 
Link Speed: 3.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :46C (114.80 F)

LEAVE A REPLY

Please enter your comment!
Please enter your name here