Linux: Use smartctl To Check Disk Behind Adaptec RAID Controllers

by on July 7, 2010 · 10 comments· LAST UPDATED July 8, 2010

in

I can use the smartctl -d ata -a /dev/sdb to read hard disk health status directly connected to my system. But, how do I read smartctl command to check disk SAS / SCSI behind Adaptec RAID controller from the shell prompt?

You need to use the following syntax to check SATA or SAS disk which are typically simulate a (logical) disk for each array of (physical) disks to the OS. /dev/sgX can be used as pass through I/O controls providing direct access to each physical disk for Adaptec raid controllers.

SATA Health Check Disk Syntax

# smartctl -d sat --all /dev/sgX
# smartctl -d sat --all /dev/sg1

Run test:
# smartctl -d sat --all /dev/sg1 -H
For SAS disk use the following syntax:
# smartctl -d scsi --all /dev/sgX
# smartctl -d scsi --all /dev/sg1
# smartctl -d scsi --all /dev/sg1 -H

Sample outputs:

smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
Device: SEAGATE  ST3146855SS      Version: 0002
Serial number: xxxxxxxxxxxxxxx
Device type: disk
Transport protocol: SAS
Local Time is: Wed Jul  7 04:34:30 2010 CDT
Device supports SMART and is Enabled
Temperature Warning Enabled
SMART Health Status: OK
Current Drive Temperature:     24 C
Drive Trip Temperature:        68 C
Elements in grown defect list: 0
Vendor (Seagate) cache information
  Blocks sent to initiator = 1857385803
  Blocks received from initiator = 1967221471
  Blocks read from cache and sent to initiator = 804439119
  Number of read and write commands whose size <= segment size = 312098925
  Number of read and write commands whose size > segment size = 45998
Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 13224.42
  number of minutes until next internal SMART test = 42
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:   58984049        1         0  58984050   58984050       3151.730           0
write:         0        0         0         0          0   9921230881.600           0
verify:     1308        0         0      1308       1308          0.000           0
Non-medium error count:        0
No self-tests have been logged
Long (extended) Self Test duration: 1367 seconds [22.8 minutes]

Replace /dev/sg1 with your disk number. If you've raid 10 array with 4 disks than:

  • /dev/sg0 - RAID 10 controller (you will not get any info or /dev/sg0).
  • /dev/sg1 - First disk in RAID 10 array.
  • /dev/sg2 - Second disk in RAID 10 array.
  • /dev/sg3 - Third disk in RAID 10 array.
  • /dev/sg4 - Fourth disk in RAID 10 array.

Another simple command to just check basic status is as follows:
# /usr/StorMan/arcconf getconfig 1 | grep State
# /usr/StorMan/arcconf getconfig 1 | grep -B 3 State

Sample outputs:

----------------------------------------------------------------------
      Device #0
         Device is a Hard drive
         State                              : Online
--
         S.M.A.R.T.                         : No
      Device #1
         Device is a Hard drive
         State                              : Online
--
         S.M.A.R.T.                         : No
      Device #2
         Device is a Hard drive
         State                              : Online
--
         S.M.A.R.T.                         : No
      Device #3
         Device is a Hard drive
         State                              : Online

See also:

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 10 comments… read them below or add one }

1 rick July 7, 2010 at 10:52 am

I have written a script based on arcconf.

You can find it here … http://fir3net.com/Programming/Bourne-/-BASH/adaptec-storage-manager-script-for-esx4.html

Reply

2 Ben July 7, 2010 at 1:18 pm

If you don’t know the drive numbers you can guess, or use sg_scan to determine them.

You may need to install sg_utils

List all generic scsi devices:
# sg_scan -i

Also, unless Adaptec has updated some of the older drivers this will only work with their series 2 and series 5 controllers, not series 3. Some additional information in the comments for this blog post: http://linux.adaptec.com/2008/09/26/smartmontools-and-adaptec-raid-controllers/

Reply

3 nixCraft July 7, 2010 at 1:26 pm

Actually above output came from series 3 controller Adaptec 3405 with latest firmware. However, we don’t have any series 2 controller left here. So I can’t verify series 2. The series 5 also works.

HTH.

Reply

4 Anonymous July 7, 2010 at 1:39 pm

I have series 2 and 5 and have not had issues with either of them. Perhaps Adaptec updated the drivers for series 3.

Reply

5 Xu Ming July 8, 2010 at 1:22 am

On my CentOS 5.5 x64, the smartctrl doesn’t has a -d sata option, but has a -d sat option. Maybe you have it misspelled.

Reply

6 nixCraft July 8, 2010 at 1:25 am

Thanks for the heads up!

Reply

7 Marki October 30, 2012 at 8:45 am

That is a different one. You can have “-d ata” to use ATA commands or newer “-d sat” to use SAT (SCSI/ATA Translation). The later is used usually for USB drives.

Reply

8 ryan July 9, 2010 at 4:17 am

@ Vikas I seriously feel that the quality of the posts of late on this blog is coming down. The reason being that in your above post you have pasted the sample output and you have failed to mention what the output actually means,which indeed is of utmost importance.

What can i make out of the above copy-pasted stuff ?? I feel explaining the outcome of a command is of greater importance than anything else.I personally don’t mean to be scornful or anything as such but seriously the admin of the blog needs to take a second look at his posts to see if they make any sense at all to its readers. Its just a suggestion that i had since i really like your blog.

Reply

9 nixCraft July 9, 2010 at 9:22 am

Seriously? You don’t understand above output? The command find out of, if there are any errors for reading and writing hard disk? The output will tell you if hard disk is going to fail or not in advance (hint #1, SMART Health Status: OK, hint #2 total error counter for uncorrcted error log is 0). Did you went thought two articles I linked at the bottom of the page (See also:) which explains the smartctl command and what to look out when disk fails. If you still don’t get it than I suggest you join our forum to post specific question or go through smartctl man page.

HTH,

PS: My name is vivek.

Reply

10 Greg Smith July 17, 2013 at 4:53 pm

Note that some servers may not load the drivers needed to expose /dev/sg* interfaces. If you don’t see any of those devices on a system with Adaptec aacraid driver, try:

modprobe sg

To load the “scsi generic” driver that creates them.

Also, it’s useful to know that every unit in the array will respond to “-d scsi” style requests. Things like the logical drives will only give data that way. However, if there is actually a SATA drive connected to that device, then you can also request its SATA specific data via “-d sat” style commands.

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: