Linux : getting drive data from megaraid cards

Recently I have been tasked with getting increased data out of a megaraid card on Linux. There are good tools that LSI provide to get such data out (MegaCli and MegaCli64) the problem is that it requires additional software to be installed which then needs to be maintained separately and could become a security problem. Here is a simple way to see what the underlying PD health is of a Megaraid VD (raid volume).

smartctl –all -d megaraid,N /dev/<megaraid_volume>

One such example on my production system is as follows

smartctl –all -d megaraid,1 /dev/sda

This provides me with the following output.

smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen,
 Device: SEAGATE  ST9300603SS      Version: 0006
 Serial number: SCRUBBED
 Device type: disk
 Transport protocol: SAS
 Local Time is: Mon Aug 12 19:20:40 2013 CDT
 Device supports SMART and is Enabled
 Temperature Warning Enabled
 SMART Health Status: OK
 Current Drive Temperature:     33 C
 Drive Trip Temperature:        68 C
 Elements in grown defect list: 0
 Vendor (Seagate) cache information
 Blocks sent to initiator = 501792691
 Blocks received from initiator = 3260523804
 Blocks read from cache and sent to initiator = 3163470047
 Number of read and write commands whose size <= segment size = 1459077268
 Number of read and write commands whose size > segment size = 2
 Vendor (Seagate/Hitachi) factory information
 number of hours powered up = 18721.98
 number of minutes until next internal SMART test = 45
Error counter log:
 Errors Corrected by           Total   Correction     Gigabytes    Total
 ECC          rereads/    errors   algorithm      processed    uncorrected
 fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
 read:   974899527        0         0  974899527   974899527      60079.969           0
 write:         0        0         0         0          0      54608.558           0
 verify: 11553876        0         0  11553876   11553876       1242.795           0
 Non-medium error count:        0
 [GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
 No self-tests have been logged
 Long (extended) Self Test duration: 7200 seconds [120.0 minutes]

Easy.. now we can get the underlying disk SMART health data without needing to manage tools outside of the Linux distribution tree.


Tags: , ,