Thursday, February 2, 2012

hpacucli - Check RAID Information from Linux Shell

Have you ever tried to check how the hardware RAID Array configured on server from your Linux Shell? Have you ever wanted to change or modify your Hardware RAID configurations without rebooting the server and without leaving your Linux shell?

hpacucli utility is there to help you, If your server is HP Hardware. hpacucli  (HP Array Configuration Utility CLI) is a command line based disk configuration program for Smart Array Controllers and RAID Array Controllers. You can download and  install hpacucli tool from HP website.

Quick Abbreviations:
chassisname = ch
controller = ctrl
logicaldrive = ld
physicaldrive = pd
drivewritecache = dwc

As root, just type "hpacucli" and you will be into hpacucli command line interface. Let me give you a quick example of what you can do with this hpacucli.

To Get the quick details about the RAID controller and its Health:
=> ctrl all show status

Smart Array P400 in Slot 9
   Controller Status: OK
   Cache Status: OK
   Battery Status: OK

=>
To get a quick idea of How the disks are grouped and which raid level used:

=> ctrl all show

Smart Array P400 in Slot 9           (sn: PXXXXXXXXXXXXX)

=> ctrl all show config

Smart Array P400 in Slot 9           (sn: P6YYYYYYYYYYYY)

   array A (SAS, Unused Space: 0 MB)

      logicaldrive 1 (68.3 GB, RAID 1, OK)

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 72 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 72 GB, OK)

To Get complete details about how the raid configured in the server:

=> ctrl all show config detail

Smart Array P400 in Slot 9
   Bus Interface: PCI
   Slot: 9
   Serial Number: PXXXXXXXXX
   Cache Serial Number: PAXXXXXXXXT
   RAID 6 (ADG) Status: Enabled
   Controller Status: OK
   Chassis Slot:
   Hardware Revision: Rev D
   Firmware Version: 7.08
   Rebuild Priority: Medium
   Expand Priority: Medium
   Surface Scan Delay: 15 secs
   Post Prompt Timeout: 0 secs
   Cache Board Present: True
   Cache Status: OK
   Accelerator Ratio: 25% Read / 75% Write
   Drive Write Cache: Disabled
   Total Cache Size: 512 MB
   Battery Pack Count: 1
   Battery Status: OK
   SATA NCQ Supported: True

   Array: A
      Interface Type: SAS
      Unused Space: 0 MB
      Status: OK

      Logical Drive: 1
         Size: 68.3 GB
         Fault Tolerance: RAID 1
         Heads: 255
         Sectors Per Track: 32
         Cylinders: 17562
         Stripe Size: 128 KB
         Status: OK
         Array Accelerator: Enabled
         Unique Identifier: 600508XXXXXXXXXXXXXXXX0002
         Disk Name: /dev/cciss/c0d0
         Mount Points: /boot 103 MB, swap 8.0 GB
         Logical Drive Label: A08923XXX61630G9SVI3RJCC0A
         Mirror Group 0:
            physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 72 GB, OK)
         Mirror Group 1:
            physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 72 GB, OK)

      physicaldrive 1I:1:1
         Port: 1I
         Box: 1
         Bay: 1
         Status: OK
         Drive Type: Data Drive
         Interface Type: SAS
         Size: 72 GB
         Rotational Speed: 10000
         Firmware Revision: HPDA
         Serial Number:         PXXXXXXA
         Model: HP      DG072A4951
         PHY Count: 1
         PHY Transfer Rate: Unknown
      physicaldrive 1I:1:2
         Port: 1I
         Box: 1
         Bay: 2
         Status: OK
         Drive Type: Data Drive
         Interface Type: SAS
         Size: 72 GB
         Rotational Speed: 10000
         Firmware Revision: HPDA
         Serial Number:         PXXXXXXA
         Model: HP      DG072A4951
         PHY Count: 1
         PHY Transfer Rate: Unknown

=>
 Be sure to verify your version of hpacucli and refer the ReadMe always, before you trying to modify the configuration of RAID or Smart Array controllers.