Smartmontools with MegaRAID Controller

From Thomas-Krenn-Wiki
Jump to: navigation, search

The smartctl Command Line Tool of Smartmontools is primarily used to query SMART attributes of hard drives and SSDs that are connected directly to the motherboard or to an HBA on a server. In addition to this conventional way the Smartmontools also support querying SMART attributes of hard drives/SSDs, which are connected to an LSI RAID controller.[1]

This article shows you how to query SMART attributes of hard drives and SSDs that are connected to an LSI RAID controller.

Checking for hard disk access

Using

cat /proc/scsi/scsi

can display which disks of the RAID controller are accessible.
Output example:

Attached devices:
Host: scsi0 Channel: 02 Id: 00 Lun: 00
  Vendor: LSI      Model: MR9271-4i        Rev: 3.27
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 02 Id: 01 Lun: 00
  Vendor: LSI      Model: MR9271-4i        Rev: 3.27
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: WDC WD5003ABYX-0 Rev: 01.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi3 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: WDC WD5003ABYX-0 Rev: 01.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05

RAID volumes in this example are marked by the string "Vendor: LSI". One or more hard drives or SSDs can hide behind each RAID volume.

Access to hard disks with smartctl

smartctl provides integrated support for MegaRAID controller. Access is made in the following manner:

sudo smartctl -a -d megaraid,N  /dev/sdX

Where <N> stands for the device ID on the RAID controller. These can be displayed via the StorCLI (column DID).

sudo storcli /c0 /eall /sall show

Output example:

Controller = 0
Status = Success
Description = Show Drive Information Succeeded.


Drive Information :
=================

------------------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model                  Sp 
------------------------------------------------------------------------------
252:0     7 Onln   0 465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U  
252:1     6 Onln   1 465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U  
252:2     5 Onln   2   74.0 GB SATA SSD N   N  512B INTEL SSDSC2BB080G4    U  
252:3     4 Onln   2   74.0 GB SATA SSD N   N  512B INTEL SSDSC2BB080G4    U  
------------------------------------------------------------------------------

EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup
DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare
UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface
Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info
SeSz-Sector Size|Sp-Spun|U-Up|D-Down|T-Transition|F-Foreign
UGUnsp-Unsupported

The type of block devices is necessary, but the SMART data on the disk that has the appropriate device ID will always be displayed on the RAID controller. For example, this can also display SMART data from hard disks that has not been passed on by the RAID controller to the operating system. So, for example, it shows the following commands of different SMART data, although the same block device was specified.

sudo smartctl -a -d megaraid,5  /dev/sdc
sudo smartctl -a -d megaraid,6  /dev/sdc

References

  1. Supported RAID-Controllers (Smartmontools Wiki)

Related articles

Setting the LSI RAID Monitoring Plugin on a 2012 Windows Server
StorCLI
SMART tests with smartctl