Control and Monitor Utility for SMART Disks

Self-Monitoring, Analysis and Reporting Technology (SMART), incorperated in the disk firmware, monitors the reliability of hard drives and attempts to predict failures, and perform self-tests.

smartctl retrieves and displays status, error logs and controls the execution of self-tests.

I have split the documentation into 2 parts, this is the basic part. The more exotic part is here

/usr/local/sbin/smartctl [/dev/device] [options]

  1. examples
  2. Read and display SMART data
      (In increasing levels of detail)
    1. health
    2. info
    3. attributes (Spin_Up_Time , Power_On_Hours, Temperature, Reallocated_Sector_Ct, …)
    4. nearly all ( info, data, capabilities, error Log, self-test log )
    5. xall Extended(temperature isummary and history, …)
  3. Run-Time Behavior
  4. Enable/Disable features
  5. Run/Abort offline test and self-test options
Having problems with a hard drive?
I have had many drives fail in recent years and S.M.A.R.T. has never suggested there was an impending problem.

Please participate in a survey about your experience with S.M.A.R.T.

2016-05-07: version 6.5 From Source Forge SMARTMonTools download and updates.

(see Reference )

Device paths:

If - is specified as the device path, smartctl reads and interprets it's debug output from standard input.

Based on the device path, smartctl will infer the device type (ATA or SCSI).
-d over-rides this

SMART status is based on information that it has gathered from online and offline tests, which were used to determine/update its SMART vendor-specific Attribute values.


By category: Information, Enable/Disable, Display data, Run/Abort Tests.


read and display SMART data


Scans for devices and outputs each device name, type and protocol info.
With -d TYPE restricts the scan.
See also info about platform specific device scan and the DEVICESCAN directive at smartd.

/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sda -d scsi # /dev/sda, SCSI device
-H /dev/disk
Retrieve and display SMART health status or pending TapeAlert messages.
Example output:
 SMART overall-health self-assessment test result: PASSED 

If the device reports failing health status, it has already failed, or
is predicting failure within the next 24 hours.
use --all to get more information, and
Get your data off the disk and to someplace safe as soon as you can.

Log Sense failed. IE page [scsi response fails sanity test]
Very Bad
-i /dev/disk
Displays the device model number, serial number, … . example

Features implemented and how the device will respond to some SMART commands. For example if the device logs errors, supports offline surface scanning.
If the device can perform self-tests, shows the estimated time to run tests.
General SAMRT Values:
Offline data collection status: ...
Self-test execution status:...
Total time to complete offline 
data collection             ...

Offline data collection capabilities...

Smart Calabilities: ...

Error loggoinf capabilies:...
Short sel-test routine
recommended [polling time   

Extended self-test routine
recommended [polling time   

Conveyance self-test routine
recommended [polling time   

See references


SMART Attributes

Numbered from 1 to 253 each has a specific name and ID number.
For example:
  3 Spin_Up_Time         0x0007   164  164   033    Pre-fail  Always     -       2
 12 Power_Cycle_Count    0x0032   100  100   000    Old_age   Always     -       1164

  1. Each has a "Normalized" (VALUE) and a "Raw" (RAW_VALUE) value.

    In the Power_Cycle_Count example the "Raw Value" is the number of times that the disk has been power-cycled, in this case 1,164. If the disk has been turned on once per day for a year 365 would be shown.

    The "Standard" does not specify the relationship between value and RAW_VALUE. Each vendor uses their own algorithm in the disk's firmware to do the intrepretation.

  2. WORST value is the smallest (closest to failure) value the disk has recorded during its lifetime (while SMART was enabled).

  3. THRESH (Threshold)
    Used by the firmware to evaluate the status, If the attribute TYPE is pre-failure failure is expected.

  4. TYPE
    1. Pre-failure this attribute is used buy the firmware to evaluate conditions that would indicate pending disk failure.
    2. In_the_past.
    3. Old_age or usage Attributes. Indicate end-of-product life from old-age or normal aging and wearout.

  5. UPDATED shows when the Attribute is updated
    1. Always Both during normal operation and off-line testing
    2. Offline only during offline testing.
  6. WHEN_FAILED no entry (a dash: - then this Attribute is OK now (not failing) and has also never failed in the past. Set by the firmware after evaluating condiditon of the disk.
    The set to FAILING_NOW if the attribute is a Pre-failure TYPE.

smartctl does not calculate any of the Attribute information, this is done by the disk firmware.

displays nearly all SMART information
./smartctl -a /dev/disk0
smartctl 5.39.1 2010-01-28 r3054 [x86_64-apple-darwin10.4.0] (local build)
Copyright (C) 2002-10 by Bruce Allen,

Device Model:     Hitachi HTS545032B9SA02
Serial Number:    091030PBDC00QDKA2NHN
Firmware Version: PB3AC60T
User Capacity:    320,072,933,376 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 6
Local Time is:    Fri Jul 23 22:24:51 2010 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.  
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.  
                   (nnn Self-test routine in progress...
                                n0% of test remaining.  
Total time to complete Offline 
data collection:         ( 645) seconds.
Offline data collection
capabilities:            (0x5b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    Offline surface scan supported.
                    Self-test supported.
                    No 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:    ( 106) minutes.
SCT capabilities:          (0x003d) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:

  1 Raw_Read_Error_Rate     0x000b   100   100   062    Pre-fail  Always     -     0
  1 Raw_Read_Error_Rate     PO-R--   100   100   050    -    0
  2 Throughput_Performance  P-S---   100   100   050    -    0
  3 Spin_Up_Time            POS--K   100   100   001    -    1041
  4 Start_Stop_Count        -O--CK   100   100   000    -    1915
  5 Reallocated_Sector_Ct   PO--CK   100   100   050    -    0        once saw   121
  7 Seek_Error_Rate         PO-R--   100   100   050    -    0
  8 Seek_Time_Performance   P-S---   100   100   050    -    0
  9 Power_On_Hours          -O--CK   074   074   000    -    10408
 10 Spin_Retry_Count        PO--CK   138   100   030    -    0
 12 Power_Cycle_Count       -O--CK   100   100   000    -    1025
191 G-Sense_Error_Rate      0x000a   100   100   000    -     644245094400
192 Power-Off_Retract_Count -O--CK   100   100   000    -    38
193 Load_Cycle_Count        -O--CK   094   094   000    -    66646
194 Temperature_Celsius     -O---K   100   100   000    -    10 (Min/Max 8/57)
195 Hardware_ECC_Recovered  0x000a   100   100   000    -     0
196 Reallocated_Event_Count -O--CK   100   100   000    -    0
197 Current_Pending_Sector  -O--CK   100   100   000    -    1
198 Offline_Uncorrectable   ----CK   100   100   000    -    0
199 UDMA_CRC_Error_Count    -O--CK   200   253   000    -    0
220 Disk_Shift              -O----   100   100   000    -    133
222 Loaded_Hours            -O--CK   076   076   000    -    9735
223 Load_Retry_Count        -O--CK   100   100   000    -    0
224 Load_Friction           -O---K   100   100   000    -    0
226 Load-in_Time            -OS--K   100   100   000    -    385
240 Head_Flying_Hours       P-----   100   100   001    -    0
254 Free_Fall_Sensor        0x0032   077   077   000    -     8589940590
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning


For ATA devices this is equivalent to:
--health -i -A -l error -l selftest -l selective
for ATA disks this does not enable the non-SMART options and the SMART options which require support for 48-bit ATA commands. For SCSI this is equivalent to:
--health -i -A -l error -l selftest
outputs all SMART and non-SMART information about the device.
For ATA devices this is equivalent to
--health -i -c -A -l xerror,error -l xselftest,selftest -l selective -l directory -l scttemp -l sataphy.

For SCSI, this is equivalent to
--health -i -A -l error -l selftest -l background -l sasphy.

example of additional entries shown with -x not shown with -a

displays logs

 Displays the Summary error log. SMART disks maintain a log of the most recent five non-trivial errors. For each of these errors, the disk power-on lifetime at which the error occurred is displayed, as is the device status (idle, standby, etc) at the time of the error.
For some common types of errors, the Error Register (ER) and Status Register (SR) values are decoded and displayed as text.
ABRT Command ABoRTed
AMNF Address Mark Not Found
CCTO Command Completion Timed Out
EOM End Of Media
ICRC Interface Cyclic Redundancy Code (CRC) error
IDNF IDentity Not Found
ILI (packet command-set specific)
MC Media Changed
MCR Media Change Request
NM No Media
obs obsolete
TK0NF TracK 0 Not Found
UNC UNCorrectable Error in Data
WP Media is Write Protected

Up to the last five commands that preceded the error are listed, along with a timestamp measured from the start of the corresponding power cycle. This is displayed in the form Dd+HH:MM:SS.msec where D is the number of days, HH is hours, MM is minutes, SS is seconds and msec is milliseconds. .
The key ATA disk registers are also recorded in the log. The final column of the error log is a text-string description of the ATA command defined by the Command Register (CR) and Feature Register (FR) values. Commands that are obsolete in the most current (ATA-7) spec are listed like this: READ LONG (w/ retry) [OBS-4], indicating that the command became obsolete with or in the ATA-4 specification. Similarly, the notation [RET-N] is used to indicate that a command was retired in the ATA-N specification. Some commands are not defined in any version of the ATA specification but are in common use nonetheless; these are marked [NS], meaning non-standard.

The ATA Specification (ATA-5 Revision 1c, Section says: "Error log structures shall include UNC errors, IDNF errors for which the address requested was valid, servo errors, write fault errors, etc. Error log data structures shall not include errors attributed to the receipt of faulty commands such as command codes not implemented by the device or requests with invalid parameters or invalid addresses."
The definitions of these terms are:
UNC (UNCorrectable): data is uncorrectable. This refers to data which has been read from the disk, but for which the Error Checking and Correction (ECC) codes are inconsistent. In effect, this means that the data can not be read.
IDNF (ID Not Found): user-accessible address could not be found. For READ LOG type commands, IDNF can also indicate that a device data log structure checksum was incorrect.

If the command that caused the error was a READ or WRITE command, then the Logical Block Address (LBA) at which the error occurred will be displayed in base 10 and base 16. The LBA is a linear address, which counts 512-byte sectors on the disk, starting from zero. (Because of the limitations of the SMART error log, if the LBA is greater than 0xfffffff, then either no error log entry will be made, or the error log entry will have an incorrect LBA. This may happen for drives with a capacity greater than 128 GiB or 137 GB.) On Linux systems the smartmon- tools web page has instructions about how to convert the LBA address to the name of the disk file containing the erroneous disk sector.

Some manufacturers ignore the ATA specifications, and make entries in the error log if the device receives a command which is not implemented or is not valid.

--log=error [SCSI] displays the error counter log pages for reads, write and verifies. The verify row is only output if it has an element other than zero.
[ATA only] displays the Extended Comprehensive SMART error log (General Purpose Log address 0x03). Unlike the Summary SMART error log (see --log=error) provides sufficient space to log the contents of the 48-bit LBA register set introduced with ATA-6. It also supports logs with more than one sector. Each sector holds up to 4 log entries. The actual number of log sectors is vendor specific, typical values for HDD are 2 (Samsung), 5 (Seagate) or 6 (WD). Some recent SSD devices have much larger error logs.

Only the 8 most recent error log entries are displayed by default. This number can be changed by the optional parameter NUM.

If ,error is appended and the Extended Comprehensive SMART error log is not supported, the Summary SMART self-test log is displayed.

Some recent (e.g. Samsung) drives report errors only in the Comprehensive SMART error log. The Summary SMART error log can be read but is always empty.

--log=selftest [ATA] displays the SMART self-test log.
The disk maintains a self-test log, which can be run using -t
For each of the most recent twenty-one self-tests, the log shows the type of test (short or extended, off-line or captive) and the final status of the test.
If the test did not complete successfully, then the percentage of the test remaining is shown. The time at which the test took place, measured in hours of disk lifetime, is also displayed. [this time stamp wraps after 2^16 hours, or 2730 days and 16 hours, or about 7.5 years.]
If any errors were detected, the Logical Block Address (LBA) of the first error is displayed in decimal notation.
On Linux systems the smartmontools web page has instructions about how to convert this LBA address to the name of the disk file containing the erroneous block. Time required to run the Immediate Offline Test (listed in seconds) is variable. issue a command to perform an Immediate Offline test with the -t offline option, then the time may jump to a larger value and then count down as the Immediate Offline Test is carried out.
 > smartctl --log=xselftest,2,selftest /dev/disk0
General Purpose Logging (GPL) feature set supported
ATA_READ_LOG_EXT (addr=0x00:0x00, page=0, n=1) failed: 48-bit ATA commands not supported
Read GP Log Directory failed.
SMART Extended Self-test Log (GP Log 0x07) not supported
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%     14148         -
# 2  Short offline       Completed without error       00%     14146         -
# 3  Short offline       Completed without error       00%     10866         -
# 4  Extended offline    Completed without error       00%      9253         -
# 5  Short offline       Completed without error       00%      9252         -
# 6  Short offline       Completed without error       00%      6290         -
# 7  Short offline       Completed without error       00%      5386         -
# 8  Extended offline    Completed without error       00%      5385         -
# 9  Short offline       Completed without error       00%      5369         -
--log=selftest [SCSI] the self-test log for a SCSI device has a slightly different format than for an ATA device. For each of the most recent twenty self-tests, it shows the type of test and the status (final or in progress) of the test. SCSI standards use the terms "foreground" and "background" (rather than ATA's corresponding "captive" and "off-line") and "short" and "long" (rather than ATA's corresponding "short" and "extended") to describe the type of the test.
The displayed segment number is only relevant when a test fails in the third or later test segment. It identifies the test that failed and consists of either the number of the segment that failed during the test, or the number of the test that failed and the number of the segment in which the test was run, using a vendor-specific method of putting both numbers into a single byte.
The Logical Block Address (LBA) of the first error is displayed in hexadecimal notation. On Linux systems the smartmontools web page has instructions about how to convert this LBA address to the name of the disk file containing the erroneous block. If provided, the SCSI Sense Key (SK), Additional Sense Code (ASC) and Additional Sense Code Qualifier (ASQ) are also displayed.
The self tests can be run using -t (using the ATA test terminology).
[ATA] displays the Extended SMART self-test log (General Purpose Log address 0x07). Supports 48-bit LBA and logs with more than one sector. Each sector holds up to 19 log entries. The actual number of log sectors is vendor specific, typical values are 1 (Seagate) or 2 (Samsung).

Most recent n log entries displayed by default: 25.

If ,selftest is appended and the Extended SMART self-test log is not supported, the old SMART self-test log is displayed.

--log=selective [ATA only] see -t select for a description of selective self-tests.
The selective self-test log shows the start/end Logical Block Addresses (LBA) of each of the five test spans, and their current test status. If the span is being tested or the remainder of the disk is being read-scanned, the current 65,536-sector block of LBAs being tested is also displayed. The selective self-test log also shows if a read-scan of the remainder of the disk will be carried out after the selective self-test has completed (see -t afterselect option) and the time delay before restarting this read-scan if it is interrupted (see -t pending option). This is a new smartmontools feature; please report unusual or incorrect behavior to the smartmontools-support mailing list.
--log=directory[,g|s] [ATA only]
General Purpose Logging feature.
Displays the Log Directory (the log at address 0).
Shows available logs and their length in sectors (512 bytes).
The output can be restricted to the GPL directory or SL directory by
--log=directory,g or --log=directory,s .
--log=background [SCSI only]
The background scan results log contains information derived from Background Media Scans (BMS) done after power up and/or periodocally (e.g. every 24 hours) on SCSI disks.
Status a background scan is in progress (and progress percentage), the amount of time the disk has been powered up and the number of scans already completed.
Background scan "event"s are typically recovered or unrecoverable errors which need intervention.
--log=scttempsts |
      scttemphist |
[ATA only] displays the disk temperature information provided by the SMART Command Transport (SCT) commands.
scttempsts displays current temperature and temperature ranges
Current Temperature:                    35 Celsius
Power Cycle Min/Max Temperature:     18/35 Celsius
Lifetime    Min/Max Temperature:      6/46 Celsius
Lifetime    Average Temperature:        30 Celsius
Under/Over Temperature Limit Count:   0/0
scttemphist displays temperature limits and the temperature history table
Temperature Sampling Period:         1 minute
Temperature Logging Interval:        1 minute
Min/Max recommended Temperature:      5/60 Celsius
Min/Max Temperature Limit:           -40/65 Celsius
Temperature History Size (Index):    478 (232)

Index    Estimated Time   Temperature Celsius
 233    2016-11-28 13:11    26  *******
 234    2016-11-28 13:12    28  *********
 235    2016-11-28 13:13    29  **********
 236    2016-11-28 13:14    29  **********
 237    2016-11-28 13:15    30  ***********
 238    2016-11-28 13:16    31  ************
 239    2016-11-28 13:17    31  ************
 240    2016-11-28 13:18    32  *************
 241    2016-11-28 13:19    32  *************
 242    2016-11-28 13:20    33  **************
 243    2016-11-28 13:21    33  **************
 244    2016-11-28 13:22    34  ***************
 245    2016-11-28 13:23    34  ***************
 246    2016-11-28 13:24    35  ****************
 ...    ..(  2 skipped).    ..  ****************
 249    2016-11-28 13:27    35  ****************
 250    2016-11-28 13:28    36  *****************
 ...    ..(  3 skipped).    ..  *****************
 254    2016-11-28 13:32    36  *****************
 255    2016-11-28 13:33    37  ******************
 ...    ..(  3 skipped).    ..  ******************
 259    2016-11-28 13:37    37  ******************
 260    2016-11-28 13:38    38  *******************
 ...    ..(  9 skipped).    ..  *******************
 270    2016-11-28 13:48    38  *******************
 271    2016-11-28 13:49    19  -
 272    2016-11-28 13:50    20  *
 273    2016-11-28 13:51    21  **
 274    2016-11-28 13:52    23  ****
 275    2016-11-28 13:53    24  *****
 276    2016-11-28 13:54    25  ******
 277    2016-11-28 13:55    26  *******
 278    2016-11-28 13:56    27  ********
 279    2016-11-28 13:57    28  *********
 280    2016-11-28 13:58    29  ********
144    2016-11-28 19:40    35  ****************
 145    2016-11-28 19:41    23  ****
 146    2016-11-28 19:42    23  ****
 147    2016-11-28 19:43    19  -
 148    2016-11-28 19:44    19  -
 149    2016-11-28 19:45    18  -
 150    2016-11-28 19:46    18  -
 151    2016-11-28 19:47    19  -
 152    2016-11-28 19:48    21  **
 153    2016-11-28 19:49    22  ***
 154    2016-11-28 19:50    23  ****
 155    2016-11-28 19:51    24  *****
 156    2016-11-28 19:52    25  ******
 157    2016-11-28 19:53    26  *******
 158    2016-11-28 19:54    27  ********
 159    2016-11-28 19:55    28  *********
 160    2016-11-28 19:56    28  *********
 161    2016-11-28 19:57    29  **********
 162    2016-11-28 19:58    30  ***********
 163    2016-11-28 19:59    30  ***********
 164    2016-11-28 20:00    31  ************
 165    2016-11-28 20:01    31  ************
 166    2016-11-28 20:02    32  *************
 167    2016-11-28 20:03    31  ************
 205    2016-11-28 20:41    33  **************
 206    2016-11-28 20:42    34  ***************
 ...    ..( 17 skipped).    ..  ***************
 224    2016-11-28 21:00    34  ***************
 225    2016-11-28 21:01    35  ****************
 ...    ..(  6 skipped).    ..  ****************
 232    2016-11-28 21:08    35  ****************
scttemp displays both.

The temperature values are preserved across power cycles.
The default temperature logging interval is 1 minute and can be configured with the -t scttempint,N[,p]

--log=sataphy[,reset] [SATA only]
displays values and descriptions of the SATA Phy Event Counters (General Purpose Log address 0x11).
If -l sataphy,reset is specified, all counters are reset after reading the values.
--log=sasphy[,reset] [SAS (SCSI) only]
displays values and descriptions of the SAS (SSP) Protocol Specific log page (log page 0x18).
If -l sasphy,reset is specified, all counters are reset after reading the values.
[ATA only] displays a hex dump of any log accessible via General Purpose Logging (GPL) feature.
The log address ADDR is the hex address listed in the log directory (see --log directory ).
The range of log sectors (pages) can be specified by decimal values FIRST-LAST or FIRST+SIZE. FIRST defaults to 0, SIZE defaults to 1. LAST can be set to 'max' to specify the last page of the log.

[ATA only] displays a hex dump of any log accessible via SMART Read Log command. See --log=gplog,... above for parameter syntax.

For example, all these commands:

smartctl -l gplog,0x80,10-15 /dev/sda
smartctl -l gplog,0x80,10+6 /dev/sda
smartctl -l smartlog,0x80,10-15 /dev/sda
display pages 10-15 of log 0x80 (first host vendor specific log).

The hex dump format is compatible with the 'xxd -r' command.

smartctl -l gplog,0x11 /dev/sda | grep ^0 | xxd -r >log.bin
writes a binary representation of the one sector log 0x11 (SATA Phy Event Counters) to file log.bin.

expert options to format SMART data using custom formatting


Sets a vendor-specific raw value display FORMAT and optional NAME for Attribute ID. Expert options

[ATA only] Modifies the behavior of smartctl to compensate for some known and understood device firmware or driver bug. Except swapid the arguments to this option are exclusive, the final option given is used.
none Assume that the device firmware obeys the ATA specifications. This is the default, unless the device has presets for -F in the device database (see below).
samsung In some Samsung disks (example: model SV4012H Firmware Version: RM100-08) some of the two- and four-byte quantities in the SMART data structures are byte-swapped (relative to the ATA specification). Enabling this option tells smartctl to evaluate these quantities in byte-reversed order. Some signs that your disk needs this option are (1) no self-test log displayed, even though you have run self-tests; (2) very large numbers of ATA errors recorded in the ATA error log; (3) strange and impossible values for the ATA error log timestamps.
samsung2 In more recent Samsung disks (firmware revisions ending in "-23") the number of ATA errors reported is byte swapped. Enabling this option tells smartctl to evaluate this quantity in byte-reversed order. An indication that your Samsung disk needs this option is that the self-test log is displayed correctly, but there are a very large number of errors in the SMART error log. This is because the error count is byte swapped. Thus a disk with five errors (0x0005) will appear to have 20480 errors (0x5000).
samsung3 Some Samsung disks (at least SP2514N with Firmware VF100-37) report a self-test still in progress with 0% remaining when the test was already completed. Enabling this option modifies the output of the self-test execution status (see -c or -a )

an explicit F on the command line will over-ride any preset values for F (see the P )

swapid - byte swapped ATA identify strings (device name, serial number, firmware version)

Run-Time Behavior
[ATA only] Specifies if smartctl should exit before performing any checks when the device is in a low-power mode,

May prevent a spin-up by smartctl.

no check never i.e. always, display the power mode if -i is specified.
no check if sleep.
no check if standby
        In these modes most disks are not spinning, used this to prevent a disk from spinning up, .
no check if idle or SLEEP or STANDBY .
In the IDLE state, most disks are still spinning, so this is probably not what you want.

run in one of the quiet modes:
errorsonly only display:
--log=error if nonzero, the number of errors recorded in the SMART error log and the power-on time when they occurred
--log=selftest errors recorded in the device self-test log
--health SMART "disk failing" status or device Attributes (pre-failure or usage) which failed either now or in the past
--all device Attributes (pre-failure or usage) which failed either now or in the past.
silent No output. Use the exit status to determine results (see RETURN VALUES ).
noserial Do not display the serial number

-d dev
dev : ata, scsi, sat, marvell, 3ware,N, areca,N, usbcypress, usbjmicron, usbsunplus, cciss,N, hpt,L/M (or hpt,L/M/N), and test.

Without -d smartctl determins the device type from the device name or from controller type info provided by the operating system.

test smartctl displays the dev name, then opens the device and displays the (possibly changed) dev name and exits.

sat for ATA disks that have a SCSI to ATA Translation (SAT) Layer (SATL) between the disk and the operating system.
SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and the other 16 bytes long that smartctl will utilize when this device type is selected. The default is the 16 byte variant which can be overridden with either d sat,12 or d sat,16

usbcypress for ATA disks that are behind a Cypress usb-pata bridge. Uses ATACB proprietary scsi. Check device usb id (most Cypress usb ata bridge vid=0x04b4, pid=0x6830) The default scsi operation code is 0x24, overridden with -d usbcypress,0xn, where n is the scsi operation code BEWARE!

usbjmicron device type is for SATA disks that are behind a JMicron USB to PATA/SATA bridge. The 48-bit ATA commands (required e.g. for --log=xerror, see below do not work with all of these and are disabled by default. Enabled by -d usbjmicron,x. The port is specified by -d usbjmicron[,x],PORT where PORT is 0 (master) or 1 (slave). This is not necessary if only one disk is connected to the USB bridge.

Marvell SATA controllers under Linux, look at SATA disks behind (using Marvell's 'linuxIAL' driver rather than libata driver) use -d marvell Such controllers show up as Marvell Technology Group Ltd. SATA I or II controllers using lspci, or using lspci -n show a vendor ID 0x11ab and a device ID of either 0x5040, 0x5041, 0x5080, 0x5081, 0x6041 or 0x6081. The 'linuxIAL' driver seems not (yet?) available in the Linux kernel source tree, but should be available from system vendors ( is known to provide a patch with the driver).

LSI MegaRAID controllers under Linux look at SCSI/SAS disks use syntax such as:

smartctl -a -d megaraid,2 /dev/sda
smartctl -a -d megaraid,0 /dev/sdb
where in the argument megaraid,N, the integer N is the physical disk number within the MegaRAID controller. This interface will also work for Dell PERC controllers. The following /dev/XXX entry must exist:
For PERC2/3/4 controllers: /dev/megadev0
For PERC5/6 controllers:

3ware SCSI RAID under Linux and FreeBSD look at ATA disks behind controllers, use syntax such as:

 smartctl -a -d 3ware,0 /dev/twe0
smartctl -a -d 3ware,1 /dev/twa0
where in the argument 3ware,N, the integer N is the disk number (3ware 'port') within the 3ware ATA RAID controller. The first two forms, which refer to devices /dev/sda-z and /dev/twe0-15, may be used with 3ware series 6000, 7000, and 8000 series controllers that use the 3x-xxxx driver.
The final form, which refers to devices /dev/twa0-15, must be used with 3ware 9000 series controllers, which use the 3w-9xxx driver.

If the special character device nodes /dev/twa? and /dev/twe? do not exist, or exist with the incorrect major or minor numbers, smartctl will recreate them on the fly. Typically /dev/twa0 refers to the first 9000-series controller, /dev/twa1 refers to the second 9000 series controller, and so on. Likewise /dev/twe0 refers to the first 6/7/8000-series controller, /dev/twa1 refers to the second 6/7/8000 series controller, and so on.

For the 6/7/8000 controllers, any of the physical disks can be queried or examined using any of the 3ware's SCSI logical device /dev/sd? entries. Thus, if logical device /dev/sda is made up of two physical disks (3ware ports zero and one) and logical device /dev/sdb is made up of two other physical disks (3ware ports two and three) then you can examine the SMART data on any of the four physical disks using either SCSI device /dev/sda or /dev/sdb. If you need to know which logical SCSI device a particular physical disk (3ware port) is associated with, use the dmesg or SYSLOG output to show which SCSI ID corresponds to a particular 3ware unit, and then use the 3ware CLI or 3dm tool to determine which ports (physical disks) correspond to particular 3ware units.

If the value of N corresponds to a port that does not exist on the 3ware controller, or to a port that does not physically have a disk attached to it, the behavior of smartctl depends upon the specific controller model, firmware, Linux kernel and platform. In some cases you will get a warning message that the device does not exist. In other cases you will be presented with 'void' data for a non-existent device.

If the /dev/sd? addressing form is used, then older 3w-xxxx drivers do not pass the "Enable Autosave" ('-S on') and "Enable Automatic Offline" ('-o on') commands to the disk, and produce these types of harmless syslog error messages instead: "3w-xxxx: tw_ioctl(): Passthru size (123392) too big". This can be fixed by upgrading to version or later of the 3w-xxxx driver, or by applying a patch to older versions. See http://smartmontools.source- for instructions. Alternatively, use the character device /dev/twe0-15 interface.

The selective self-test functions (-t select,A-B) are only supported using the character device interface /dev/twa0-15 and /dev/twe0-15. The necessary WRITE LOG commands can not be passed through the SCSI interface.

Areca SATA RAID controllers are currently supported under Linux only. To look at SATA disks behind Areca RAID controllers, use syntax such as:

smartctl -a -d areca,2 /dev/sg2
smartctl -a -d areca,3 /dev/sg3
where in the argument areca,N, the integer N is the disk number (Areca 'port') within the Areca SATA RAID controller. The allowed values of N are from 1 to 24 inclusive. The first line above addresses the second disk on the first Areca RAID controller. The second line addresses the third disk on the second Areca RAID controller. To help identify the correct device, use the command:
cat /proc/scsi/sg/device_hdr /proc/scsi/sg/devices
to show the SCSI generic devices (one per line, starting with /dev/sg0). The correct SCSI generic devices to address for smartmontools are the ones with the type field equal to 3. If the incorrect device is addressed, please read the warning/error messages carefully. They should provide hints about what devices to use.

The Areca controller must have firmware version 1.46 or later. Lower-numbered firmware versions will give (harmless) SCSI error messages and no SMART information.

To look at (S)ATA disks behind HighPoint RocketRAID controllers, use syntax such as:

smartctl -a -d hpt,1/3 /dev/sda    (under Linux)
smartctl -a -d hpt,1/2/3 /dev/sda    (under Linux)
smartctl -a -d hpt,1/3 /dev/hptrr    (under FreeBSD)
smartctl -a -d hpt,1/2/3 /dev/hptrr    (under FreeBSD)
where in the argument hpt,L/M or hpt,L/M/N, the integer L is the controller id, the integer M is the channel number, and the integer N is the PMPort number if it is available. The allowed values of L are from 1 to 4 inclusive, M are from 1 to 8 inclusive and N from 1 to 5 if PMPort available. The /dev/sda-z form should be the device node which stands for the disks derived from the HighPoint RocketRAID controllers under Linux and under FreeBSD, it is the character device which the driver registered (eg, /dev/hptrr, /dev/hptmv6). And also these values are limited by the model of the HighPoint RocketRAID controller.

HighPoint RocketRAID controllers are currently ONLY supported under Linux and FreeBSD.

cciss controllers are currently ONLY supported under Linux and FreeBSD.

-T tol
[ATA only] Specifies how tolerant smartctl should be of ATA and SMART command failures.

The behavior of smartctl depends upon whether the command is optional or mandatory".
mandatory : "required by the ATA/ATAPI-5 Specification if the device implements the SMART command set" and
optional "not required by the ATA/ATAPI-5 Specification even if the device implements the SMART command set."
The "mandatory" ATA and SMART commands are:


tol :

normal exit on failure of any mandatory SMART command, and ignore all failures of optional SMART commands. This is the default. On some devices, issuing unimplemented optional SMART commands doesn't cause an error. This can result in misleading smartctl messages such as "Feature X not implemented", followed shortly by "Feature X: enabled". In most such cases, contrary to the final message, Feature X is not enabled.

conservative exit on failure of optional SMART command.

permissive ignore failure(s) of mandatory SMART commands. This option may be given more than once. Each additional use of this option will cause one more additional failure to be ignored. The use of this option can lead to messages like "Feature X not implemented", followed shortly by "Error: unable to enable Feature X". In a few such cases, contrary to the final message, Feature X is enabled.

verypermissive equivalent to giving a large number of -T permissive options: ignore failures of any number of mandatory SMART commands. see the above.

-b action
[ATA only] action smartctl if a checksum error is detected in the:
(1) Device Identity Structure
(2) SMART Self-Test Log Structure
(3) SMART Attribute Value Structure,
(4) SMART Attribute Threshold Structure, or
(5) ATA Error Log Structure.

warn report the incorrect checksum but carry on in spite of it, default.
ignore continue silently without issuing a warning.

-r ctl
used by developers on non-conforming or poorly conforming hardware. reports details of smartctl transactions with the device. The option can be used multiple times.
When used once, it shows a record of the ioctl() transactions with the device. When used more than once, the detail of these ioctl() transactions are reported in greater detail.

sioctl - report all ioctl() transactions.

ataioctl - report only ioctl() transactions with ATA devices.

scsiioctl - report only ioctl() transactions with SCSI devices. Invoking this once shows the SCSI commands in hex and the corresponding status. Invoking it a second time adds a hex listing of the first 64 bytes of data send to, or received from the device.

Any argument may include a positive integer to specify the level of detail that should be reported. The argument should be followed by a comma then the integer with no spaces. For example, ataioctl,2 The default level is 1 so -r ataioctl,1 and -r ataioctl are equivalent.

For testing purposes, the output of -r ataioctl,2 can later be parsed by smartctl if - is used as device path argument. The ATA command input parameters, sector data and return values are reconstructed from the debug report read from stdin. Then smartctl internally simulates an ATA device with the same behaviour. (not for SCSI devices yet).

SMART feature enable/disable commands:

if multiple options are used to both enable and disable a feature, the enable will be issued before the disable .

-s on|off
Enables or Disables SMART.
The command --smart on (perhaps used with with the o on and S on options) should be placed in a start-up script, for example in rc.local or rc.sysinit. The SMART feature settings are preserved over power-cycling.
For the TapeAlert messages it is not necessary (or useful) to enable SMART .
-o on|off
Enables|Disables automatic offline test, which scans the drive every four hours for disk defects.
This can be issued during normal system operation. [ATA only]

Althought listed as "Obsolete" in the ATA and ATA/ATAPI Specifications it was originally part of the SFF-8035i Revision 2.0 specification, but was never part of any ATA specification. It is implemented by many vendors. [See documentation in IBM's Official Published Disk Specifications. For example the IBM Travelstar 40GNX Hard Disk Drive Specifications (Revision 1.1, 22 April 2002, Publication # 1541, Document S07N-7715-02) page 164. or SFF-8035i Specification -- see REFERENCES below.]

To determine if automatic offline testing is supported refer to the 'Auto Offline Data Collection'
part of the SMART capabilities report (displayed with -c after issuing --offlineauto=on

SMART provides several categories of "testing".
  1. online "testing", has no effect on the performance. To enabled smartctl -s on /dev/hda .

  2. offline "testing",has no effect on the performance. To enabled smartctl -o on /dev/hda . causes testing to be carried out, on a regular scheduled basis. The disk will suspend offline testing while O/S initiated disk accesses are taking place, and resume testing when the disk would otherwise be idle.
    A offline test can be initiated by using smartctl -t offline /dev/hda

    online and offline testing should be described as online and offline "data collection".
    The results are reflected in the values of the SMART Attributes.
    Problems or errors are detected when the value of an Attribute go below its failure threshold.
    Some of errors are recorded in the error log and are displayed with -A and --log=error .

    Some attribute are updated only during offline data collection activities; others are updated during normal operation (ALWAYS) as shown in the attribute table display.

  3. -t and -X carry out and abort self-tests in the category for where 'testing' is really an appropriate choice is "self" testing is performed when a command is issued.

    Any errors detected in the self testing will be shown in the SMART self-test log, examined using --log=selftest.

    in this manual page, the word "Test" is used in connection with the second category just described, e.g. for the "offline" testing.
    "Self-test" are used in connection with the third category.

-S on|off
Enables or disables SMART autosave of vendor-specific Attributes, and is preserved across power cycles,

For SCSI devices this toggles the value of the Global Logging Target Save Disabled (GLTSD) bit in the Control Mode Page. Some disk manufacturers set this bit by default. This prevents error counters, power-up hours and other useful data from being placed in non-volatile storage, so these values may be reset to zero the next time the device is power-cycled. If the GLTSD bit is set then 'smartctl -a' will issue a warning. Use on to clear the GLTSD bit and thus enable saving counters to non-volatile storage.
For extreme streaming-video type applications consider using off to set the GLTSD bit.

-P type
[ATA only] Specifies use of preset options that are available for this drive.
By default, presets are used.
smartctl sets appropriate options for known drives. For example, the Maxtor 4D080H4 uses Attribute 9 to store power-on time in minutes most drives use hours.
The command-line -v 9,minutes specifies minutes for unknown drives.

The argument shows preset options show all known drives in the smartmontools database, along with their preset options.
If there are no presets for your drive for example, a -v or -F option is needed to get smartctl to display correct values) please contact the smartmontools developers so that this information can be added

use if a drive is recognized, then use the stored presets for it. This is the default. that presets will NOT over-ride additional Attribute interpretation ('-v N,something') command-line options or explicit -F' command-line options..
ignore do not use presets.
show show if the drive is recognized in the database, and if so, its presets, then exit.
showall [model[firmware]] list all recognized drives and presets, then exit.
> smartctl -P showall
MODEL FAMILY:       Apple SSD SM128
ATTRIBUTE OPTIONS:  None preset; no -v options are required.

ATTRIBUTE OPTIONS:  009 Power_On_Half_Minutes
                    194 Temperature_Celsius_x10
OTHER PRESETS:      Fixes byte order in some SMART data (same as -F samsung)
MODEL FAMILY:       Hitachi Endurastar J4K20/N4K20 (formerly DK23FA-20J)
ATTRIBUTE OPTIONS:  009 Power_On_Minutes
                    193 Load_Cycle_Count

-B [+]FILE
Read the drive database from FILE. The new database replaces the built in database by default. expert DriveDB
Run/Abort offline test and self-test options:
-t test
-C used with -t runs in captive mode (known as "foreground mode" for SCSI devices).
Only one test type can be run at a time
If shutdown or power cycled during a self-test, no harm should result and the self-test may resume.

-t offline Used during normal system operation, updates the SMART Attribute values, and if errors are found they will appear in the SMART error log, dispayed with --log=error.
[for SCSI devices runs the default self test in foreground. No entry is placed in the self test log.]

If -c shows "Suspend Offline collection upon new command", track the progress of the test using -c .
If -c show "Abort Offline collection upon new command" then most commands will abort the Immediate Offline Test, do not track the progress of the test.

-t short (usually under ten minutes).
Can be given during normal system operation .

This is a test in a different category than the immediate or automatic offline tests, as it checks the electrical and mechanical performance as well as the read performance.
Results are recorded in the Self Test Error Log, displayed with --log=selftest at anytime in the future. On some disks the progress of the self-test can be monitored by watching this log during the self-test;
OR use the -c option to monitor progress.

-t long Extended Self Test (tens of minutes).
Can be given during normal system operation .
-t conveyance [ATA only] runs a Conveyance Self Test (minutes) intended to identify damage incurred during transporting of the device. Can be given during normal system operation

selective tests
-t select,N-M, select,N+SIZE [ATA only] runs a SMART Selective Self Test, to test a range of disk Logical Block Addresses (LBAs), rather than the entire disk.
Each range of LBAs that is checked is called a "span" and is specified by a starting LBA (N) and an ending LBA (M) with N less than or equal to M. The range can also be specified as N+SIZE. A span at the end of a disk can be specified by N‑max.

For example:

smartctl -t select,10-20 /dev/hda
smartctl -t select,10+11 /dev/hda
both run a self test on one span consisting of LBAs ten through twenty

smartctl -t select,100000000-max /dev/hda
Run a self test from LBA 100000000 up to the end of the disk.
-t can be given up to five times.
Example :
smartctl -t select,0-100 -t select,1000-2000 /dev/hda
runs a self test on two spans. The first span consists of 101 LBAs and the second span consists of 1001 LBAs.
The spans can overlap
for example:
smartctl -t select,0-10 -t select,5-15 -t select,10-20 /dev/hda

The results of the are be obtained (both during and after the test) by using -l selftest.

Selective self-tests are helpful if (based on SYSLOG error messages, previous failed self-tests, or SMART error log entries) you suspect that a disk is having problems at a particular range of Logical Block Addresses (LBAs).

Can be run during normal system operation.

The kernel must be compiled with CONFIG_IDE_TASKFILE_IO.

The variants of the selective self-test command use spans based on the ranges from past tests stored on the disk:

-t select,redo[+SIZE] [ATA only] redo the last Test using the same LBA range. The starting LBA is the same as the last test. The ending LBA will be different if a span size is specified by +SIZE.

For example the commands:

smartctl -t select,10-20 /dev/hda
smartctl -t select,redo /dev/hda
smartctl -t select,redo+20 /dev/hda
have the same effect as:
smartctl -t select,10-20 /dev/hda
smartctl -t select,10-20 /dev/hda
smartctl -t select,10-29 /dev/hda

-t select,next[+SIZE] - [ATA only] runs a SMART Selective Self Test on the LBA range which follows the range of the last test. The starting LBA is set to (ending LBA +1) of the last test. A new span size may be specified by the optional +SIZE argument.

For example the commands:

smartctl -t select,0-999 /dev/hda
smartctl -t select,next /dev/hda
smartctl -t select,next+2000 /dev/hda
have the same effect as:
smartctl -t select,0-999 /dev/hda
smartctl -t select,1000-1999 /dev/hda
smartctl -t select,2000-3999 /dev/hda

If the last test ended at the last LBA of the disk, the new range starts at LBA 0. The span size of the last span of a disk is adjusted such that the total number of spans to check the full disk will not be changed by future uses of -t select,next'.

-t select,cont[+SIZE] [ATA only] performs a 'redo' (above) if the self test status reports that the last test was aborted by the host. Otherwise it run the 'next' (above) test.
-t afterselect,on [ATA only] perform an offline read scan after a Selective Self-test has completed. This option must be used together with one or more of the select,N-M options above. If the LBAs that have been specified in the Selective self-test pass the test with no errors found, then read scan the remainder of the disk. If the device is powered-cycled while this read scan is in progress, the read scan will be automatically resumed after a time specified by the pending timer (see below). The value of this option is preserved between selective self-tests.
-t afterselect,off [ATA only] do not read scan the remainder of the disk after a Selective self-test has completed.
This option must be use together with one or more of the select,N-M options above. The value of this option is preserved between selective self-tests.
-t pending,N [ATA only] set the pending offline read scan timer to N minutes. N is an integer in the range from 0 to 65,535 .
If the device is powered off during a read scan after a Selective self-test, then resume the test automatically N minutes after power-up.
This option must be use together with one or more of the select,N-M options above.
The value of this option is preserved between selective self-tests.
-t scttempint,N[,p] [ATA only] set the time interval for SCT temperature logging to N minutes.
With p the setting is preserved across power cycles. Otherwise, it will revert to last non-volatile setting by the next hard reset.
This clears the temperature history table. See --log=scttemp
Runs self-tests in captive mode. This has no effect with -t offline or if the -t option is not used. [for SCSI devices, this command option runs the self-test in "Foreground" mode.]

WARNING: Tests run in captive mode may busy out the drive for the length of the test. Only run captive tests on drives without any mounted partitions!

Aborts non-captive SMART Self Tests. this command will abort the Offline Immediate Test routine only if your disk has the "Abort Offline collection upon new command" capability.

displays a usage message to STDOUT and exits. slightly modified to reduce screen size (ed)

smartctl 5.39.1 2010-01-28 r3054 [x86_64-apple-darwin10.4.0] (local build)
Copyright (C) 2002-10 by Bruce Allen,

Usage: smartctl [options] device 
  -h, --help, --usage Display this help and exit 
  -V, --version, --copyright, --license display license, copyright, and version info and exit 
  -i, --info       Show identity information for device 
  -a, --all        Show all SMART information for device (see -x)
  -x, --xall       Show all information for device 
  -q TYPE, --quietmode=TYPE    ATA Set smartctl quiet mode to one of: errorsonly, silent, noserial 
  -d TYPE, --device=TYPE       Specify device type to one of: ata, scsi, sat[,N][+TYPE], 
                                usbcypress[,X], usbjmicron[,x][,N], usbsunplus, marvell, areca,N, 
                                3ware,N,hpt,L/M/N, cciss,N, test
  -T TYPE, --tolerance=TYPE    ATA Tolerance: normal, conservative, permissive, verypermissive 
  -b TYPE, --badsum=TYPE       ATA Set action on bad checksum to one of: warn, exit, ignore 
  -r TYPE, --report=TYPE       Report transactions 
  -n MODE, --nocheck=MODE      ATA No check if: never, sleep, standby, idle 
  -s VALUE, --smart=VALUE       Enable/disable SMART on device (on/off) 
  -o VALUE, --offlineauto=VALUE ATA Enable/disable automatic offline testing on device (on/off) 
  -S VALUE, --saveauto=VALUE    ATA Enable/disable Attribute autosave on device (on/off) 
  -H, --health Show device SMART health status 
  -c, --capabilities          ATA Show device SMART capabilities 
  -A, --attributes                Show device SMART vendor-specific Attributes and values 
  -l TYPE, --log=TYPE Show device log. TYPE: error, selftest, selective, directory[,g|s],
                       background, sasphy[,reset], sataphy[,reset], scttemp[sts,hist],
                       gplog,N[,RANGE], smartlog,N[,RANGE], xerror[,N][,error], 
  -v N,OPTION , --vendorattribute=N,OPTION        ATA
        Set display OPTION for vendor Attribute N 
  -F TYPE, --firmwarebug=TYPE ATA Use firmware bug workaround: none, samsung [23], , swapid 
  -P TYPE, --presets=TYPE     ATA Drive-specific presets: use, ignore, show, showall 
  -B [+]FILE, --drivedb=[+]FILE         ATA Read and replace [add] drive database from FILE 
========= DEVICE SELF-TEST OPTIONS ===== -t TEST, --test=TEST
TEST: offline short long conveyance select,M-N pending,N afterselect,[on|off] scttempint,N[,p] 
  -C, --captive Do test in captive mode (along with -t) 
  -X, --abort Abort any non-captive test on device 
=========== SMARTCTL EXAMPLES ===== 
  smartctl -a disk0                        (displays all SMART information) [[ see -x ]]
  smartctl -t long /dev/disk0              (Executes extended disk self-test) 
  smartctl --smart=on --saveauto=on /dev/rdisk0 (Enables SMART on first disk) 
(display Self-Test & Attribute errors) 
  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/disk0 
 (You can use IOService: ...) 
  smartctl -a IOService:/MacRISC2PE/pci@f4000000/AppleMacRiscPCI/ata-6@D/AppleKauaiATA/ continuing…
(... Or IODeviceTree:)
smartctl -c IODeviceTree:/pci@f4000000/ata-6@D/@0:0
displays version, copyright, license, home page and SVN revision information for your copy of smartctl to STDOUT and then exits. include this when reporting bugs or problems.


display a large amount of SMART information for drive /dev/hda which is typically an ATA (IDE) or SATA disk in Linux.

smartctl -a /dev/hda or
smartctl -a /dev/sdb

Save extensive output to a file for comparison with a future run:
smartctl -x /dev/hda > smart-`date +%y%m%d%H%M`

Compare 2 eXtensive outputs and show only what has changed:

/usr/bin/diff  --side-by-side --width=$COLUMNS  --suppress-common-lines   \
smart-1007270951 smart-1007280951 \
|sed "s/0x/ /g;s/ - //g; s/000/ /g; s/Always//g; s/Old_age//g; /\*/d; "
sed gets rid of (IMHO) junk

For Miscrosoft WIndows:

"C:\programs\smartmontools\bin\smartctl" -a  /dev/sda >C:\logs\smartmon\%date:~12,2%%date:~4,2%%date:~7,2%.log

Enable SMART monitoring and data log collection on drive /dev/hdd .
smartctl -s on /dev/hdd

Enable SMART on drive /dev/hda, enable automatic offline testing every four hours, and enable autosaving of SMART Attributes. This is a good start-up line for system's init files. This command can be issued on a running system.
smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda

Begin an extended self-test of drive /dev/hdc. This command can be issued on a running system. The results can be seen in the self-test log visible with the --log=selftest option after it has completed.
smartctl -t long /dev/hdc

Enable SMART on the disk, and begin an immediate offline test of drive /dev/hda. You can issue this command on a running system. The results are only used to update the SMART Attributes, visible with the A option. If any device errors occur, they are logged to the SMART error log, which can be seen with the l error option.
smartctl -s on -t offline /dev/hda

Shows the vendor Attributes, when the disk stores its power-on time internally in minutes rather than hours.
smartctl -A -v 9,minutes /dev/hda

Produces output only if the device returns failing SMART status, or if some of the logged self-tests ended with errors.
smartctl -q errorsonly -H -l selftest /dev/hda

Examine all SMART data for device /dev/hda, but produce no displayed output. You must use the exit status (the $? shell variable) to learn if any Attributes are out of bound, if the SMART status is failing, if there are errors recorded in the self-test log, or if there are errors recorded in the disk error log.
smartctl -q silent -a /dev/hda

Examine all SMART data for the first ATA disk connected to a 3ware RAID controller card.
smartctl -a -d 3ware,0 /dev/sda

Examine all SMART data for the first ATA disk connected to a 3ware RAID 6000/7000/8000 controller card.
smartctl -a -d 3ware,0 /dev/twe0

Examine all SMART data for the first ATA disk connected to a 3ware RAID 9000 controller card.
smartctl -a -d 3ware,0 /dev/twa0

Start a short self-test on the fourth ATA disk connected to the 3ware RAID controller card which is the second SCSI device /dev/sdb.
smartctl -t short -d 3ware,3 /dev/sdb

Start a long self-test on the fourth SATA disk connected to an Areca RAID controller addressed by /dev/sg2.
smartctl -t long -d areca,4 /dev/sg2

Examine all SMART data for the (S)ATA disk directly connected to the third channel of the first HighPoint RocketRAID controller card.
smartctl -a -d hpt,1/3 /dev/sda (under Linux)
smartctl -a -d hpt,1/3 /dev/hptrr (under FreeBSD)

Start a short self-test on the (S)ATA disk connected to second pmport on the first channel of the first HighPoint RocketRAID controller card.
smartctl -t short -d hpt,1/1/2 /dev/sda (under Linux)
smartctl -t short -d hpt,1/1/2 /dev/hptrr (under FreeBSD)

Run a selective self-test on LBAs 10 to 100 and 30 to 300. After the these LBAs have been tested, read-scan the remainder of the disk. If the disk is power-cycled during the read-scan, resume the scan 45 minutes after power to the device is restored.
smartctl -t select,10-100 -t select,30-300 -t afterselect,on -t pending,45 /dev/hda

Examine all SMART data for the first SCSI disk connected to a cciss RAID controller card.
smartctl -a -d cciss,0 /dev/cciss/c0d0


The return values of smartctl are defined by a bitmap.
If all is well with the disk, the return value (exit status) of smartctl is 0 (all bits turned off).
If a problem occurs, or an error, potential error, or fault is detected, then a non-zero status is returned. In this case, the eight different bits in the return value have the following meanings for ATA disks; some of these values may also be returned for SCSI disks.
Bit 0:01 Command line did not parse.
Bit 1:02 Device open failed, or device did not return an IDENTIFY DEVICE structure.
Bit 2:04 Some SMART command to the disk failed, or there was a checksum error in a SMART data structure (see b ).
Bit 3:08 SMART status check returned "DISK FAILING".

Bit 4:10 prefail Attributes < threshold.
Bit 5:20 SMART status check returned "DISK OK" but we found that some (usage or prefail) Attributes have been <= threshold at some time in the past.
Bit 6:40 error log contains records of errors.
Bit 7:80 self-test log contains records of errors.

To test within the shell for whether or not the different bits are turned on or off,
use the following type of construction (this is bash syntax): smartstat=$(($? & 8)) This looks at only at bit 3 of the exit status $? (since 8=2^3).
The shell variable $smartstat will be nonzero if SMART status check returned "disk failing" and zero otherwise.


smartctl supports polling TapeAlert messages from SCSI tape drives and changers.
The TapeAlert log page flags are cleared for the initiator when the page is read. This means that each alert condition is reported only once by smartctl for each initiator for each activation of the condition.


Bruce Allen University of Wisconsin - Milwaukee Physics Department


Are listed here here


This code was derived from the smartsuite package, written by Michael Cornwell, and from the previous UCSC smartsuite package. It extends these to cover ATA-5 disks. This code was originally developed as a Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory (now part of the Storage Systems Research Center), Jack Baskin School of Engineering, University of California, Santa Cruz. .

See sourceForge SMARTMonTools for updates, further documentation, bug reports and patches:

See also:

smartd, badblocks(8), ide-smart(8).


"Monitoring Hard Disks with SMART", Bruce Allen, Linux Journal, January 2004, ps 74-77.

Details of SMART are in with Sections 4.8 and 6.54 of the first volume of the 'AT Attachment with Packet Interface-7' (ATA/ATAPI-7) specification.
This documents the SMART functionality which the smartmontools utilities provide access to. here to retrieve D1699r6a-ATA8-ACS.pdf.gz 1.8MB,
originally from: ttp:// no longer here. .
Revision 4b Earlier and later versions of this Specifiation are available from the T13 web site .

SMART was originally defined by the SFF-8035i revision 2 and the SFF-8055i revision 1.4 specifications, publications of the Small Form Factors (SFF) Committee. Links are References section of the smartmontools home page at

original SVN ID OF THIS PAGE: $Id: 2978 2009-10-30 23:20:39Z chrfranke $
This version significantly "tersified" and made true HTML by

The command set used by the device is often derived from the device path but may need help with -d Before issuing a command not implemented by the device, smartctl displays a warning(see -T, --tolerance ).

Device Type
Without -d smartctl determines the device type from the device name or from controller type info provided by the operating system.
/dev/sd[a-z],N where N specifies the disk number (3ware 'port') behind the controller providing the logical drive ('unit') specified by /dev/sd[a-z] or
/dev/tw_cli/cx/py for controller x, port y to run the 'tw_cli' tool and parse the output.
This provides limited monitoring (-i, -c, -A) if SMART support is missing in the driver.
/dev/tw_cli/stdin or /dev/tw_cli/clip to parse CLI or 3DM output from standard input or clipboard.
-d 3ware,N is optional.