MEGACLI Commands to check Hardware RAID config and Setup

To know the Hardware RAID controller and other information use the lspci command.

lspci | grep -i raid

O/P:

01:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)

The above command shows the RAID controller vendor details.

Installation of Megacli in Centos:

RAID commands:

The MegaCli64 commands are formed as given below:

MegaCli64 –command –arguments/directives -a adapter info

View information about the RAID adapter:

/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllinfo -aALL

Results:

Adapter #0

Versions

  • Product Name : LSI MegaRAID SAS 9260-8i
  • Serial No : SV31519225
  • FW Package Build: 12.12.0-0111

Mfg. Data

  • Mfg. Date : 04/10/13
  • Rework Date : 00/00/00
  • Revision No : 85B
  • Battery FRU : N/A

Image Versions in Flash:

  • FW Version : 2.130.353-1663
  • BIOS Version : 3.24.00_4.12.05.00_0x05160000
  • Preboot CLI Version: 04.04-020:#%00009
  • WebBIOS Version : 6.0-49-e_45-Rel
  • NVDATA Version : 2.09.03-0032
  • Boot Block Version : 2.02.00.00-0000
  • BOOT Version : 09.250.01.219

To Know information in PDrives:

/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL

Output:

  • Adapter #0
  • Enclosure Device ID: 252
  • Slot Number: 0
  • Drive’s position: DiskGroup: 0, Span: 0, Arm: 0
  • Enclosure position: N/A
  • Device Id: 10
  • WWN: 5000c5005c34c105
  • 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

To know the PATROL read which explore disk error and the patrol read state and the delay between patrol read runs:

/opt/MegaRAID/MegaCli/MegaCli64 -AdpPR -Info -aALL

Output:

  • Adapter 0: Patrol Read Information:
  • Patrol Read Mode: Auto
  • Patrol Read Execution Delay: 168 hours
  • Number of iterations completed: 78
  • Next start time: 05/02/2015, 03:00:00
  • Current State: Stopped
  • Patrol Read on SSD Devices: Disabled

To check Current patrol read rate:

/opt/MegaRAID/MegaCli/MegaCli64 -AdpGetProp PatrolReadRate -aALL

Adapter 0: Patrol Read Rate = 30%

Get the Number of Virtual Drives Configured on Each Adapter

/opt/MegaRAID/MegaCli/MegaCli64 -LdGetNum -aAll

Number of Virtual Drives Configured on Adapter 0: 2

To know Battery backup information

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

BBU status for Adapter: 0

  • BatteryType: iBBU
  • Voltage: 4085 mV
  • Current: 0 mA
  • Temperature: 29 C
  • Battery State: Optimal
  • BBU Firmware Status:

Display configuration:

/opt/MegaRAID/MegaCli/MegaCli64 -CfgDsply -aAll

  • Adapter: 0
  • Product Name: LSI MegaRAID SAS 9260-8i
  • Memory: 512MB
  • BBU: Present
  • Serial No: SV31519225

Number of DISK GROUPS: 2

  • SPANNED DISK GROUP: 0
  • Number of Spans: 2
  • SPAN: 0
  • Number of PDs: 2
  • Span Reference: 0x00
  • Number of VDs: 1
  • Virtual Drive Information:
  • Number of dedicated Hotspares: 0
  • Virtual Drive: 0 (Target Id: 0)

Enable Forced Write Back Cache:
/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -ForcedWB -Immediate -Lall -aAll

To Disable cache with a bad BBU with MegaCLI:
/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -NoCachedBadBBU -Immediate -Lall -aAll

To Enable Drive Caches with MegaCLI:
/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -EnDskCache -Immediate -Lall -aAll

Hope it helps. If you need any assistance Contact Us

Here is a related post you maybe interested in: Find open ports on linux server using a script

To get updates follow us on Facebook, Twitter, LinkedIn

Subscribe to get free blog content to your Inbox
Loading

Written by actsupp-r0cks