Opened 8 years ago

Closed 8 years ago

#811 closed defect (worksforme)

Replace -d scsi by -d sat, due to "no SMART info" by -d scsi, when use smartctl --scan

Reported by: shadbarton Owned by:
Priority: minor Milestone:
Component: smartctl Version: 6.4
Keywords: linux Cc:

Description

Problem:

Can't use smartctl --scan results for scripting due to incorrect device discovering. When i use default -d scsi value, get no SMART health status and no SMART attributes.

Output 1:

smartctl --scan

/dev/sdb -d scsi # /dev/sdb, SCSI device

Output 2:

smartctl -a /dev/sdb -d scsi

smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.16.0-4-amd64] (local build) Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

User Capacity:        500,107,862,016 bytes [500 GB]
Logical block size:   512 bytes
Rotation Rate:        7200 rpm
Logical Unit id:      0x50014ee003b89f21
Serial number:        WD-WMAYP7267562
Device type:          disk
Local Time is:        Tue Feb 28 02:51:56 2017 PST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported

=== START OF READ SMART DATA SECTION ===
Log Sense failed, IE page [scsi response fails sanity test]
Error Counter logging not supported

Output 3:

smartctl -a /dev/sdb -d sat

smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.16.0-4-amd64] (local build) Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital RE4
Device Model:     WDC WD5003ABYZ-011FA0
Serial Number:    WD-WMAYP7267562
LU WWN Device Id: 5 0014ee 003b89f21
Firmware Version: 01.01S03
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Tue Feb 28 03:03:41 2017 PST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x84) Offline data collection activity
                                        was suspended by an interrupting command from host.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever 
                                        been run.
Total time to complete Offline 
data collection:                ( 8100) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (  82) minutes.
Conveyance self-test routine
recommended polling time:        (   5) minutes.
SCT capabilities:              (0x303f) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   100   253   021    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       4
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   093   093   000    Old_age   Always       -       5144
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       4
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       6
194 Temperature_Celsius     0x0022   113   089   000    Old_age   Always       -       30
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1

Change History (4)

comment:1 by Christian Franke, 8 years ago

Keywords: linux added; sat scsi smartctl --scan removed
Milestone: undecided

SAT detection relies on SCSI INQUIRY result which is only available if the device is opened.

Try smartctl --scan-open.

comment:2 by shadbarton, 8 years ago

It works perfectly
smartctl --scan-open
/dev/sdb -d sat # /dev/sdb [SAT], ATA device
May be it has to be used as default action while smartctl --scan?

comment:3 by Christian Franke, 8 years ago

It depends on use case. If only --scan is used, run smartctl with device name only and without the -d option. Then the same auto detection as with --scan-open is in effect: -d scsi is guessed from device name, device is opened, SCSI INQUIRY is issued and -d sat detected from its result.

comment:4 by Christian Franke, 8 years ago

Milestone: undecided
Resolution: worksforme
Status: newclosed

If smartctl --scan-open is used, correct device type -d sat is reported.

Note: See TracTickets for help on using tickets.