smartctl - Control and Monitor Utility for SMART Disks

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

  1. examples
  2. ATA SCSI sets
  3. 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, …)
  4. Run-Time Behavior
  5. Enable/Disable features
  6. Run/Abort offline test and self-test options
You most likely came here because you are 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.

smartmontools-5.4 released 2010-12-09 From Source Forge SMARTMonTools download and updates.

smartctl command line utility displays SMART status and error logs, enabling, disabling and initiating self-tests.

Before issuing a command not implemented by the device, smartctl displays a warning(see -T, --tolerance ).

(see Reference )

The command set used by the device is often derived from the device path but may need help with -d (see ATA, SCSI command sets and SAT ).


Device paths:

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

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


smartctl displays most numerical values in decimal, hexadecimal values are displayed with a leading 0x, This man page follows the same convention.

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.
TapeAlert status is obtained by reading the TapeAlert log page.

Options

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

     all

read and display SMART data
--scan
--scan-open
Scans for devices and outputs each device name, device type and protocol ([ATA] or [SCSI]) info.
May be used in conjunction with '-d TYPE' to restrict the scan to a specific TYPE.
See also info about platform specific device scan and the DEVICESCAN directive at smartd.

--scan-open
Same as --scan, but also tries to open each device before printing device info. The device open may change the device type due to autodetection (see also '-d test').

-H
--health
Have the device to report its SMART health status or pending TapeAlert messages.
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.

-i
--info
Displays the device model number, serial number, firmware version, and ATA Standard version/revision information.
Reports if the device supports SMART, and whether SMART support is currently enabled or disabled.
If the device supports Logical Block Address mode (LBA mode) display current user drive capacity in bytes. (If drive is has a user protected area reserved, or is "clipped", this will be less than the maximum drive capacity.)
example

shows if the drive model is in the smartmontools database (see -v ).
If so, the drive model family may also be displayed.
If n is specified, the power mode of the drive is displayed. example

-c
--capabilities
[ATA only] displays only the generic SMART capabilities. These show what SMART features are implemented and how the device will respond to some of the different SMART commands. For example it shows if the device logs errors, if it supports offline surface scanning, and so on. If the device can carry out self-tests, this option also shows the estimated time required to run those tests.

the time required to run the Self-tests (listed in minutes) are fixed. However the time required to run the Immediate Offline Test (listed in seconds) is variable. This means that if you 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.
See references

-A
--attributes
all

SMART Attributes

Numbered from 1 to 253 each has specific names and ID numbers.
For example:
 ID# ATTRIBUTE_NAME          FLAG   VALUE WORST THRESH TYPE     UPDATED WHEN_FAILED RAW_VALUE
 12 Power_Cycle_Count       0x0032   100 100   000    Old_age   Always     -     1164

Each has "Normalized" (VALUE) and "Raw" (RAW_VALUE) values displayed in base-10. In the example the "Raw Value" for Attribute 12 would be the actual number of times that the disk has been power-cycled in this case 1,164.example 365 if the disk has been turned on once per day for a year.
This not specified by the SMART standard, each vendor uses their own algorithm to convert "Raw" value to a "Normalized" value in the range from 1 to 254. Smartctl reports the attributes as read from the device. The disk's firmware converts from "Raw" and "Normalized". In most cases, the values are sensible. For example the temperature Attribute generally has its raw value equal to the temperature in Celsius.

In some cases vendors use unusual conventions. For example the Hitachi disk on my laptop reports its power-on hours in minutes, not hours. Some IBM disks track three temperatures rather than one, in their raw values. And so on.

Each Attribute also has a Threshold value (whose range is 0 to 255) which is displayed under the heading "THRESH". If the Normalized value is less than or equal to the Threshold value, then the Attribute is said to have failed. If the Attribute is a pre-failure Attribute, then disk failure is imminent.

Each Attribute also has a "Worst" value shown under the heading "WORST". This is the smallest (closest to failure) value that the disk has recorded at any time during its lifetime when SMART was enabled. [some vendors firmware may actually increase the "Worst" value for some "rate-type" Attributes.]

Attribute Type

  1. Pre-failure attributes are ones which, if less than or equal to their threshold values, indicate pending disk failure, but does not mean that the disk is about to fail!
  2. Old age, or usage Attributes, are ones which indicate end-of-product life from old-age or normal aging and wearout, if the Attribute value is less than or equal to the threshold.

    If the Attribute's current Normalized value is less than or equal to the threshold value, then the "WHEN_FAILED" column will display "FAILING_NOW".
    If current is greater than threshold but the worst recorded value is less than or equal to the threshold value, then this column will display "In_the_past".
    If the "WHEN_FAILED" column has no entry (indicated by a dash: - then this Attribute is OK now (not failing) and has also never failed in the past.

    The "UPDATED" column shows if the Attribute values are updated during both normal operation and off-line testing("Always") , or only during offline testing("Offline").

    The Raw Attribute values are the ones that might have a real physical interpretation, such as "Temperature Celsius", "Hours", or "Start-Stop Cycles".
    Each manufacturer converts these, using their detailed knowledge of the disk's operations and failure modes, to Normalized Attribute values in the range 1-254.
    The current and worst (lowest measured) of these Normalized Attribute values are stored on the disk, along with a Threshold value that the manufacturer has determined will indicate that the disk is going to fail, or that it has exceeded its design age or aging limit.

    smartctl does not calculate any of the Attribute values, thresholds, or types, it merely reports them .

    With ATA/ATAPI-4, revision 4, the meaning of these Attribute fields has been made entirely vendor-specific. most ATA/ATAPI-5 disks seem to respect their meaning.

    [SCSI] obtained from the temperature and start-stop cycle counter log pages.
    Certain vendor specific attributes are listed if recognised in a relatively free format

-a
--all
Xall
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, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
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
=== START OF READ SMART DATA SECTION ===
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.  
or
                   (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
                    command.
                    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:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE     UPDATED WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   062    Pre-fail  Always     -     0
  2 Throughput_Performance  0x0005   100   100   040    Pre-fail  Offline    -     0
  3 Spin_Up_Time            0x0007   164   164   033    Pre-fail  Always     -     2
  4 Start_Stop_Count        0x0012   099   099   000    Old_age   Always     -     2156
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always     -     121
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always     -     0
  8 Seek_Time_Performance   0x0005   100   100   040    Pre-fail  Offline    -     0
  9 Power_On_Hours          0x0012   096   096   000    Old_age   Always     -     2100
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always     -     0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always     -     1164
160 Unknown_Attribute       0x0032   100   100   000    Old_age   Always     -     0
191 G-Sense_Error_Rate      0x000a   100   100   000    Old_age   Always     -     644245094400
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always     -     116044988434
193 Load_Cycle_Count        0x0012   091   091   000    Old_age   Always     -     97884
194 Temperature_Celsius     0x0002   161   161   000    Old_age   Always     -     34 (Lifetime Min/Max 13/41)
195 Hardware_ECC_Recovered  0x000a   100   100   000    Old_age   Always     -     0
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always     -     246
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always     -     2
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline    -     0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always     -     0
223 Load_Retry_Count        0x000a   100   100   000    Old_age   Always     -     0
254 Free_Fall_Sensor        0x0032   077   077   000    Old_age   Always     -     8589940590
continuing

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
-x
--xall
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

-l TYPE
--log=TYPE
displays logs

--log=error
 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
Times from the start of the power cycle, is displayed as Dd+HH:MM:SS.msec where D days, HH hours, MM minutes, SS seconds and msec milliseconds. .
Key registers are recorded in the log along with a description of the command from the Command Register (CR) and Feature Register (FR).

Included are UNC errors, IDNF errors, servo errors, write fault errors, etc. Errors attributed to faulty commands are not in the errlog./ with invalid parameters or invalid addresses."

  • UNC (UNCorrectable): data is uncorrectable i.e., the Error Checking and Correction (ECC) codes are inconsistent.
  • IDNF (ID Not Found): address could not be found.
    For READ LOG, IDNF can indicate a data log structure with incorrect checksum. For READ or WRITEs the Logical Block Address (LBA) is displayed in base 10 and base 16.
--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.
--log=xerror
[,NUM][,error]
Displays the Extended Comprehensive SMART error log (see --log=error) NUM of recent entries displayed. Default 8.

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 displays the SMART self-test log.
If the test did not complete the percentage remaining is shown. The time at which the test hours of disk lifetime.
--log=selftest 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).
--log=xselftest
[,NUM][,selftest]
[ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] displays the Extended SMART self-test log (General Purpose Log address 0x07). Unlike the SMART self-test log (see --log=selftest above), it 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).

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

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 65536-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


scttemp

[ATA only] displays the disk temperature information provided by the SMART Command Transport (SCT) commands.
'scttempsts' displays current temperature and temperature ranges returned by the SCT Status command,
'scttemphist' displays temperature limits and the temperature history table returned by the SCT Data Table command, and
'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]
[NEW EXPERIMENTAL SMARTCTL FEATURE]
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]
[NEW EXPERIMENTAL SMARTCTL FEATURE]
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.
--log=gplog,
ADDR[,First[-Last|+Size]]
[ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] 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.

--log=smartlog,
ADDR[,F[-L|+S]]
[ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] 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
-v ID,FORMAT[,NAME]

--vendorattribute=
   ID,FORMAT[,NAME]

[ATA only] Sets a vendor-specific raw value display FORMAT and optional NAME for Attribute ID.
May be used multiple times.

The Attribute ID range is 1 to 255.
If N is specified as ID, the settings for all Attributes are changed.
NAME is a string of letters, digits and underscore.

-v help - displays formatting specifications available then exits.

raw8 six 8-bit unsigned base-10 integers for decoding Raw value.
raw16 three 16-bit unsigned base‑10 integers for decoding Raw value.
raw48 48-bit unsigned base-10 integer default for most attributes.
hex4812 digit hexadecimal number for decoding the Raw value.
raw64 64-bit unsigned base-10 integer includes two bytes from the normalized and worst attribute value. new raw format is used by some recent SSD devices.
hex64 16 digit hexadecimal number includes two bytes from the normalized and worst attribute value

new raw format is used by some recent SSD devices.

min2hour Raw Attribute is power-on time in minutes Its raw value will be displayed in the form "Xh+Ym"
X is hours, and Y is minutes in the range 0-59 inclusive.
Y is always displayed with two digits, for example "06" or "31" or "00"
sec2hour Raw Attribute is power-on time in seconds Its raw value will be displayed in the form "Xh+Ym+Zs" X is hours, Y is minutes in the range 0-59 inclusive, and Z is seconds in the range 0-59 inclusive
Y and Z are always displayed with two digits, for example "06" or "31" or "00"
halfmin2hourRaw Attribute is power-on time, measured in units of 30 seconds format is used by some Samsung disks. Its raw value will be in the form "Xh+Ym". Here X is hours, and Y is minutes in the range 0-59 inclusive. Y is always two digits, for example "06" or "31" or "00". temperature is displayed if available
Default for Attributes 190 and 194.
temp10xRaw Attribute is ten times the disk temperature in Celsius.
raw16(raw16)raw attribute as a 16-bit value and two optional 16-bit values if these words are nonzero. Default for Attributes 5 and 196.
raw16(avg16)Raw attribute is spin-up time. as a 16-bit value and an optional "Average" 16-bit value if the word is nonzero. Default for Attribute 3.
raw24/raw24Raw Attribute contains two 24-bit values
load cycles / unload cycles.
The difference is the number of unexpected power offs (emergency unload)
As a rule of thumb, the mechanical stress created by one emergency unload is equivalent to that created by one hundred normal unloads.

The following old arguments to -v are also still valid:

9,minutes 9,min2hour,Power_On_Minutes.
9,seconds 9,sec2hour,Power_On_Seconds.
9,halfminutes 9,halfmin2hour,Power_On_Half_Minutes.
9,temp 9,tempminmax,Temperature_Celsius.
192,emergencyretractcyclect 192,raw48,Emerg_Retract_Cycle_Ct
193,loadunload 193,raw24/raw24.
194,10xCelsius 194,temp10x,Temperature_Celsius_x10.
194,unknown 194,raw48,Unknown_Attribute.
197,increasing 197,raw48,Total_Pending_Sectors. Also means that Attribute number
197 (Current Pending Sector Count) is not reset if uncorrectable sectors are reallocated (see smartd.conf(5) man page).
198,increasing 198,raw48,Total_Offl_Uncorrectabl. Also means that Attribute number
198 (Offline Uncorrectable Sector Count) is not reset if uncorrectable sectors are reallocated (see smartd.conf(5) man page).
198,offlinescanuncsectorct 198,raw48,Offline_Scan_UNC_SectCt.
200,writeerrorcount 200,raw48,Write_Error_Count.
201,detectedtacount 201,raw48,Detected_TA_Count.
220,temp 220,raw48,Temperature_Celsius.
A table of hard drive models, listing which Attribute corresponds to temperature, can be found at: www.guzu.net/linux/hddtemp.db

-F TYPE
--firmwarebug=TYPE
[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 reported 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
-n POWERMODE
--nocheck=POWERMODE
[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.

-q TYPE
--quietmode=TYPE
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
--device=dev
valid arguments: 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. This will use the ATACB proprietary scsi pass through command. There is no autodetection at the moment. The best way to know if your device support it, is to check your device usb id (most Cypress usb ata bridge got vid=0x04b4, pid=0x6830) or to try it (if the usb device doesn't support ATACB, smartmontools display an error). The default scsi operation code is 0x24, but although it can be overridden with -d usbcypress,0xn, where n is the scsi operation code, you're running the risk of damage to the device or filesystems on it.

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 bridges and are therefore disabled by default. These commands can be enabled by -d usbjmicron,x. CAUTION: Specifying ,x for a device which do not support it results in I/O errors and may disconnect the drive. The port can be 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. If two disks are connected, an error message is displayed if no PORT is specified.[NEW EXPERIMENTAL SMARTCTL FEATURE]

usbsunplus device type is for SATA disks that are behind a SunplusIT USB to SATA bridge.[NEW EXPERIMENTAL SMARTCTL FEATURE]

Under Linux, to look at SATA disks behind Marvell SATA controllers (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 (ftp://ftp.aslab.com/ is known to provide a patch with the driver).

Under Linux , to look at SCSI/SAS disks behind LSI MegaRAID controllers, 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:
/dev/megaraid_sas_ioctl_node

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

smartctl -a -d 3ware,2 /dev/sda
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 allowed values of N are from 0 to 127 inclusive. 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 /dev/sda-z form is deprecated starting with the Linux 2.6 kernel series and may not be supported by the Linux kernel in the near future. 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 1.02.00.037 or later of the 3w-xxxx driver, or by applying a patch to older versions. See http://smartmontools.source- forge.net/ 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
--tolerance=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:

  1. ATA IDENTIFY DEVICE,
  2. SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE,
  3. SMART ENABLE/DISABLE, and
  4. SMART RETURN STATUS.

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
--badsum=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.
exit

-r ctl
--report=ctlctl
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
--smart=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
--offlineauto=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
--saveauto=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
--presets=TYPE
[ATA only] Specifies whether smartctl should use any preset options that are available for this drive. By default, if the drive is recognized in the smartmontools database, then the presets are used.
smartctl automatically sets appropriate options for known drives. For example, the Maxtor 4D080H4 uses Attribute 9 to stores power-on time in minutes whereas most drives use that Attribute to store the power-on time in hours. The command-line option -v 9,minutes ensures that smartctl correctly interprets Attribute 9 in this case, but that option is preset for the Maxtor 4D080H4 and so need not be specified by the user on the smartctl command line.

The argument show will show any preset options for your drive and the argument showall will show all known drives in the smartmontools database, along with their preset options. If there are no presets for your drive and you think there should be (for example, a -v or -F option is needed to get smartctl to display correct values) then please contact the smartmontools developers so that this information can be added to the smartmontools database. Contact information is at the end of this man page.

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 list all recognized drives, and the presets that are set for them, then exit.

The -P showall' option takes up to two optional arguments to match a specific drive type and firmware version. The command:

smartctl -P showall
lists all entries, the command:
smartctl -P showall 'MODEL'
lists all entries matching MODEL, and the command:
smartctl -P showall 'MODEL' 'FIRMWARE'
lists all entries for this MODEL and a specific FIRMWARE version.

-B [+]FILE
--drivedb=[+]FILE
[ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] Read the drive database from FILE. The new database replaces the built in database by default. If '+' is specified, then the new entries prepend the built in entries.

If this option is not specified, optional entries are read from the file /usr/local/etc/smart_drivedb.h (Windows: ./smart_drivedb.conf).

The database files use the same C/C++ syntax that is used to initialize the built in database array. C/C++ style comments are allowed. Example:

                /* Full entry: */
                {
                  "Model family",    // Info about model family/series.
                  "MODEL1.*REGEX",   // Regular expression to match model of device.
                  "VERSION.*REGEX",  // Regular expression to match firmware version(s).
                  "Some warning",    // Warning message.
                  "-v 9,minutes"     // String of preset -v and -F options.
                },
                /* Minimal entry: */
                {
                  "",                // No model family/series info.
                  "MODEL2.*REGEX",   // Regular expression to match model of device.
                  "",                // All firmware versions.
                  "",                // No warning.
                  ""                 // No options preset.
                },
                /* ... */
Run/Abort offline test and self-test options:
-t test
--test=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 reported in the Self Test Error Log, displayed with --log=selftest . On some disks the progress of the self-test can be monitored by watching this log during the self-test; with other disks 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 65535 .
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
-C
--captive
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!

-X
--abort
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.

-h
--help
--usage
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, http://smartmontools.sourceforge.net

Usage: smartctl [options] device 
========== SHOW INFORMATION OPTIONS ===== 
  -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 
==========SMARTCTL RUN-TIME BEHAVIOR OPTIONS ===== 
  -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 
========= DEVICE FEATURE ENABLE/DISABLE COMMANDS =====
  -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) 
========= READ AND DISPLAY DATA OPTIONS ===== 
  -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], 
                       xselftest[,N][,selftest] 
  -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…
                      ATADeviceNub@0/IOATABlockStorageDriver/IOATABlockStorageDevice  
(... Or IODeviceTree:)
smartctl -c IODeviceTree:/pci@f4000000/ata-6@D/@0:0
-V
--version
--copyright
--license
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.

ATA, SCSI command sets and SAT

In the past there has been a clear distinction between storage devices that used the ATA and SCSI command sets. This distinction was often reflected in their device naming and hardware. Now various SCSI transports (e.g. SAS, FC and iSCSI) can interconnect to both SCSI disks (e.g. FC and SAS) and ATA disks (especially SATA). USB and IEEE 1394 storage devices use the SCSI command set externally but almost always contain ATA or SATA disks (or flash). The storage subsystems in some operating systems have started to remove the distinction between ATA and SCSI in their device naming policies.

99% of operations that an OS performs on a disk involve the SCSI INQUIRY, READ CAPACITY, READ and WRITE commands, or their ATA equivalents. Since the SCSI commands are slightly more general than their ATA equivalents, many OSes are generating SCSI commands (mainly READ and WRITE) and letting a lower level translate them to their ATA equivalents as the need arises. An important note here is that "lower level" may be in external equipment and hence outside the control of an OS.

SCSI to ATA Translation (SAT) is a standard (ANSI INCITS 431-2007) that specifies how this translation is done. For the other 1% of operations that an OS performs on a disk, SAT provides two options. First is an optional ATA PASS-THROUGH SCSI command (there are two variants). The second is a translation from the closest SCSI command. Most current interest is in the "pass-through" option.

The relevance to smartmontools is that its interactions with disks fall solidly into the "1%" category. So even if the OS can happily treat (and name) a disk as "SCSI", smartmontools needs to detect the native command set and act accordingly. As more storage manufacturers (including external SATA drives) comply with SAT, smartmontools is able to automatically distinguish the native command set of the device. In some cases the -d sat option is needed on the command line.

There are also virtual disks which typically have no useful information to convey to smartmontools, but could conceivably in the future. An example of a virtual disk is the OS's view of a RAID 1 box. There are most likely two SATA disks inside a RAID 1 box. Addressing those SATA disks from a distant OS is a challenge for smartmontools. Another approach is running a tool like smartmontools inside the RAID 1 box (e.g. a Network Attached Storage (NAS) box) and fetching the logs via a browser.)

Examples

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

Disable SMART monitoring and data log collection on drive /dev/hdd .
smartctl -s off /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 your system's init files. You can issue this command on a running system.
smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda

Begin an extended self-test of drive /dev/hdc. You can issue this command 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

RETURN VALUES:

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.

NOTES

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.

AUTHOR

Bruce Allen smartmontools-support@lists.sourceforge.net University of Wisconsin - Milwaukee Physics Department

CONTRIBUTORS

The following have made large contributions to smartmontools:
Casper Dik (Solaris SCSI interface)
Christian Franke (Windows interface, C++ redesign, USB support, ...)
Douglas Gilbert (SCSI subsystem)
Guido Guenther (Autoconf/Automake packaging)
Geoffrey Keating (Darwin ATA interface)
Eduard Martinescu (FreeBSD interface)
Frederic L. W. Meunier (Web site and Mailing list)
Gabriele Pohl (Web site and Wiki, conversion from CVS to SVN)
Keiji Sawada (Solaris ATA interface)
Manfred Schwarb (Drive database)
Sergey Svishchev (NetBSD interface)
David Snyder and Sergey Svishchev (OpenBSD interface)
Phil Williams (User interface and drive database)
Yuri Dario (OS/2, eComStation interface)
Shengfeng Zhou (Linux/FreeBSD HighPoint RocketRAID interface)
Many other individuals have made smaller contributions and corrections.

Credits

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. http://ssrc.soe.ucsc.edu/ .

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

See also:

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

Reference

"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: T13.org/Documents/UploadedDocuments/docs2008(BIG).

http://www.t13.org/docs2004/d1532v1r4b-ATA-ATAPI-7.pdf .
Revision 4b Earlier and later versions of this Specifiation are available from the T13 web site http://www.t13.org/ .

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 smartmontools.sourceforge.net

original SVN ID OF THIS PAGE: $Id: smartctl.8.in 2978 2009-10-30 23:20:39Z chrfranke $
This version significantly "tersified" and made true HTML by DGerman@Real-World-Systems.com.