]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - smartctl.8.in
import smartmontools 7.0
[mirror_smartmontools-debian.git] / smartctl.8.in
CommitLineData
832b75ed 1.ig
a86ec89e 2Copyright (C) 2002-10 Bruce Allen
ff28b140 3Copyright (C) 2004-18 Christian Franke
ee38a438 4
ff28b140 5SPDX-License-Identifier: GPL-2.0-or-later
ee38a438 6
ff28b140 7$Id: smartctl.8.in 4882 2018-12-29 21:26:45Z chrfranke $
832b75ed
GG
8
9..
f9e10201
JD
10.\" Macros borrowed from pages generated with Pod::Man
11.de Sp \" Vertical space (when we can't use .PP)
12.if t .sp 0.4v
13.if n .sp
14..
15.de Vb \" Begin verbatim text
16.ft CW
17.nf
18.ne \\$1
19..
20.de Ve \" End verbatim text
21.ft R
22.fi
23..
24.\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible
25.ie \n(.g .ds Aq \(aq
26.el .ds Aq '
a86ec89e 27.TH SMARTCTL 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
832b75ed
GG
28.SH NAME
29\fBsmartctl\fP \- Control and Monitor Utility for SMART Disks
f9e10201 30.Sp
832b75ed
GG
31.SH SYNOPSIS
32.B smartctl [options] device
f9e10201 33.Sp
832b75ed 34.SH DESCRIPTION
d008864d
GI
35.\" %IF NOT OS ALL
36.\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
37.\"! It does not contain info specific to other platforms.]
38.\"! .PP
39.\" %ENDIF NOT OS ALL
ee38a438
GI
40\fBsmartctl\fP controls the Self-Monitoring, Analysis and
41Reporting Technology (SMART) system built into most ATA/SATA and SCSI/SAS
42hard drives and solid-state drives.
43The purpose of SMART is to monitor the reliability of the hard drive
44and predict drive failures, and to carry out different types of drive
45self-tests.
46\fBsmartctl\fP also supports some features not related to SMART.
47This version of \fBsmartctl\fP is compatible with
d2e702cf 48ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards
ee38a438 49(see \fBREFERENCES\fP below).
f9e10201 50.PP
832b75ed
GG
51\fBsmartctl\fP also provides support for polling TapeAlert messages
52from SCSI tape drives and changers.
f9e10201 53.PP
832b75ed 54The user must specify the device to be controlled or interrogated as
f9e10201
JD
55the final argument to \fBsmartctl\fP. The command set used by the device
56is often derived from the device path but may need help with the \*(Aq\-d\*(Aq
2127e193 57option (for more information see the section on "ATA, SCSI command sets
f9e10201
JD
58and SAT" below).
59Device paths are as follows:
d008864d 60.\" %IF OS Linux
832b75ed 61.IP \fBLINUX\fP: 9
a86ec89e
GI
62Use the forms \fB"/dev/sd[a\-z]"\fP for ATA/SATA and SCSI/SAS devices.
63For SCSI Tape Drives and Changers with TapeAlert support use the
64devices \fB"/dev/nst*"\fP and \fB"/dev/sg*"\fP. For disks behind
2127e193 653ware controllers you may need \fB"/dev/sd[a\-z]"\fP or
f9e10201
JD
66\fB"/dev/twe[0\-9]"\fP, \fB"/dev/twa[0\-9]"\fP or \fB"/dev/twl[0\-9]"\fP:
67see details below.
68For disks behind HighPoint RocketRAID controllers you may need
2127e193
GI
69\fB"/dev/sd[a\-z]"\fP. For disks behind Areca SATA RAID controllers,
70you need \fB"/dev/sg[2\-9]"\fP (note that smartmontools interacts with
71the Areca controllers via a SCSI generic device which is different
ee38a438
GI
72than the SCSI device used for reading and writing data)! For HP Smart
73Array RAID controllers, there are three currently supported drivers: cciss,
74hpsa, and hpahcisr. For disks accessed via the cciss driver the device nodes
75are of the form \fB"/dev/cciss/c[0\-9]d0"\fP. For disks accessed via
f9e10201
JD
76the hpahcisr and hpsa drivers, the device nodes you need are
77\fB"/dev/sg[0\-9]*"\fP.
78("lsscsi \-g" is helpful in determining which scsi generic device node
79corresponds to which device.)
80Use the nodes corresponding to the RAID controllers, not the nodes
81corresponding to logical drives.
82See the \fB\-d\fP option below, as well.
a86ec89e
GI
83Use the forms \fB"/dev/nvme[0\-9]"\fP (broadcast namespace) or
84\fB"/dev/nvme[0\-9]n[1\-9]"\fP (specific namespace 1\-9) for NVMe devices.
d008864d
GI
85.\" %ENDIF OS Linux
86.\" %IF OS Darwin
832b75ed 87.IP \fBDARWIN\fP: 9
f9e10201
JD
88Use the forms \fB/dev/disk[0\-9]\fP or equivalently \fBdisk[0\-9]\fP or
89equivalently \fB/dev/rdisk[0\-9]\fP.
90Long forms are also available: please use \*(Aq\-h\*(Aq to see some examples.
91.Sp
92[NEW EXPERIMENTAL SMARTCTL FEATURE]
93There is NVMe support based on the undocumented SMART API in OSX. Currently only
94SMART and Controller information pages are supported.
95.Sp
96Note that Darwin SCSI support is not yet implemented.
97.Sp
f4e463df
GI
98Use the OS X SAT SMART Driver to access SMART data on SAT capable USB and
99Firewire devices (see INSTALL file).
d008864d
GI
100.\" %ENDIF OS Darwin
101.\" %IF OS FreeBSD
832b75ed
GG
102.IP \fBFREEBSD\fP: 9
103Use the forms \fB"/dev/ad[0\-9]+"\fP for IDE/ATA
cfbba5b9 104devices and \fB"/dev/da[0\-9]+"\fP or \fB"/dev/pass[0\-9]+"\fP for SCSI devices.
ee38a438 105For SATA devices on AHCI bus use \fB"/dev/ada[0\-9]+"\fP format. For HP Smart
f9e10201
JD
106Array RAID controllers, use \fB"/dev/ciss[0\-9]"\fP (and see the \fB\-d\fP
107option, below).
d008864d
GI
108.\" %ENDIF OS FreeBSD
109.\" %IF OS NetBSD OpenBSD
832b75ed
GG
110.IP \fBNETBSD/OPENBSD\fP: 9
111Use the form \fB"/dev/wd[0\-9]+c"\fP for IDE/ATA
112devices. For SCSI disk and tape devices, use the device names
f9e10201
JD
113\fB"/dev/sd[0\-9]+c"\fP and \fB"/dev/st[0\-9]+c"\fP respectively.
114Be sure to specify the correct "whole disk" partition letter for
832b75ed 115your architecture.
d008864d
GI
116.\" %ENDIF OS NetBSD OpenBSD
117.\" %IF OS Solaris
832b75ed
GG
118.IP \fBSOLARIS\fP: 9
119Use the forms \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
120devices, and \fB"/dev/rmt/*"\fP for SCSI tape devices.
d008864d 121.\" %ENDIF OS Solaris
d008864d 122.\" %IF OS Windows Cygwin
ee38a438 123.IP \fBWINDOWS\fP: 9
a37e7145
GG
124Use the forms \fB"/dev/sd[a\-z]"\fP for IDE/(S)ATA and SCSI disks
125"\\\\.\\PhysicalDrive[0\-25]" (where "a" maps to "0").
ee38a438 126Use \fB"/dev/sd[a\-z][a\-z]"\fP for "\\\\.\\PhysicalDrive[26\-...]".
a37e7145
GG
127These disks can also be referred to as \fB"/dev/pd[0\-255]"\fP for
128"\\\\.\\PhysicalDrive[0\-255]".
129ATA disks can also be referred to as \fB"/dev/hd[a\-z]"\fP for
f9e10201 130"\\\\.\\PhysicalDrive[0\-25]".
a37e7145
GG
131Use one the forms \fB"/dev/tape[0\-255]"\fP, \fB"/dev/st[0\-255]"\fP,
132or \fB"/dev/nst[0\-255]"\fP for SCSI tape drives "\\\\.\\Tape[0\-255]".
f9e10201 133.Sp
a37e7145 134Alternatively, drive letters \fB"X:"\fP or \fB"X:\\"\fP may be used to
f9e10201
JD
135specify the (\*(Aqbasic\*(Aq) disk behind a mounted partition. This does
136not work with \*(Aqdynamic\*(Aq disks.
137.Sp
a37e7145 138For disks behind 3ware 9000 controllers use \fB"/dev/sd[a\-z],N"\fP where
f9e10201
JD
139N specifies the disk number (3ware \*(Aqport\*(Aq) behind the controller
140providing the logical drive (\*(Aqunit\*(Aq) specified by
141\fB"/dev/sd[a\-z]"\fP.
9ebc753d 142Alternatively, use \fB"/dev/tw_cli/cx/py"\fP for controller x, port y
f9e10201
JD
143to run the \*(Aqtw_cli\*(Aq tool and parse the output. This provides limited
144monitoring (\*(Aq\-i\*(Aq, \*(Aq\-c\*(Aq, \*(Aq\-A\*(Aq below) if SMART
145support is missing in the driver.
146Use \fB"/dev/tw_cli/stdin"\fP or \fB"/dev/tw_cli/clip"\fP
9ebc753d 147to parse CLI or 3DM output from standard input or clipboard.
f9e10201
JD
148The option \*(Aq\-d 3ware,N\*(Aq is not necessary on Windows.
149.Sp
f4e463df
GI
150For disks behind an Intel ICHxR controller with RST driver use
151\fB"/dev/csmi[0\-9],N"\fP where N specifies the port behind the logical
152scsi controller "\\\\.\\Scsi[0\-9]:".
f9e10201 153.Sp
a86ec89e 154For SATA or SAS disks behind an Areca controller use
f9e10201
JD
155\fB"/dev/arcmsr[0\-9]"\fP, see \*(Aq\-d areca,N[/E]\*(Aq below.
156.Sp
a86ec89e
GI
157Use the forms \fB"/dev/nvme[0\-9]"\fP (broadcast namespace) or
158\fB"/dev/nvme[0\-9]n[1\-9]"\fP (specific namespace 1\-9) for first,
159second, ..., NVMe device.
160Alternatively use the forms \fB"/dev/nvmes[0\-9][n[1\-9]]"\fP for NVMe devices
161behind the logical scsi controller "\\\\.\\Scsi[0\-9]:".
f9e10201
JD
162Both forms require a NVMe driver which supports NVME_PASS_THROUGH_IOCTL.
163.Sp
164[NEW EXPERIMENTAL SMARTCTL FEATURE]
165Use the forms \fB"/dev/sd[...]"\fP or \fB"/dev/pd[...]"\fP (see above)
166for NVMe devices behind Windows 10 NVMe driver (stornvme.sys).
167.Sp
832b75ed 168The prefix \fB"/dev/"\fP is optional.
d008864d 169.\" %ENDIF OS Windows Cygwin
d008864d 170.\" %IF OS OS2
832b75ed 171.IP \fBOS/2,eComStation\fP: 9
f9e10201
JD
172Use the form \fB"/dev/hd[a\-z]"\fP for ATA/SATA devices using DANIS506 driver.
173.Sp
174Use the form \fB"/dev/ahci[a\-z]"\fP for ATA/SATA devices using OS2AHCI driver.
d008864d 175.\" %ENDIF OS OS2
832b75ed 176.PP
f9e10201 177if \*(Aq\-\*(Aq is specified as the device path, \fBsmartctl\fP reads and
a37e7145 178interprets it's own debug output from standard input.
f9e10201
JD
179See \*(Aq\-r ataioctl\*(Aq below for details.
180.PP
181\fBsmartctl\fP guesses the device type if possible.
182If necessary, the \*(Aq\-d\*(Aq option can be used to override this guess.
a37e7145 183.PP
832b75ed
GG
184Note that the printed output of \fBsmartctl\fP displays most numerical
185values in base 10 (decimal), but some values are displayed in base 16
4d59bff9 186(hexadecimal). To distinguish them, the base 16 values are always
f9e10201
JD
187displayed with a leading \fB"0x"\fP, for example: "0xff".
188This man page follows the same convention.
189.Sp
832b75ed 190.SH OPTIONS
832b75ed
GG
191The options are grouped below into several categories. \fBsmartctl\fP
192will execute the corresponding commands in the order: INFORMATION,
193ENABLE/DISABLE, DISPLAY DATA, RUN/ABORT TESTS.
f9e10201 194.Sp
832b75ed
GG
195.TP
196.B SHOW INFORMATION OPTIONS:
197.TP
198.B \-h, \-\-help, \-\-usage
199Prints a usage message to STDOUT and exits.
200.TP
201.B \-V, \-\-version, \-\-copyright, \-\-license
2127e193
GI
202Prints version, copyright, license, home page and SVN revision
203information for your copy of \fBsmartctl\fP to STDOUT and then exits.
832b75ed
GG
204.TP
205.B \-i, \-\-info
206Prints the device model number, serial number, firmware version, and
207ATA Standard version/revision information. Says if the device
208supports SMART, and if so, whether SMART support is currently enabled
209or disabled. If the device supports Logical Block Address mode (LBA
f9e10201 210mode) print current user drive capacity in bytes. (If drive is has a
832b75ed
GG
211user protected area reserved, or is "clipped", this may be smaller
212than the potential maximum drive capacity.) Indicates if the drive is
f9e10201
JD
213in the smartmontools database (see \*(Aq\-v\*(Aq options below). If so, the
214drive model family may also be printed.
215If \*(Aq\-n\*(Aq (see below) is specified, the power mode of the drive is
216printed.
217.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
218.Sp
ff28b140
TL
219[NVMe] For NVMe devices the information is obtained from the Identify
220Controller and the Identify Namespace data structure.
f9e10201 221.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed 222.TP
ee38a438 223.B \-\-identify[=[w][nvb]]
d2e702cf 224[ATA only] Prints an annotated table of the IDENTIFY DEVICE data.
ee38a438
GI
225By default, only valid words (words not equal to 0x0000 or 0xffff)
226and nonzero bits and bit fields are printed.
227This can be changed by the optional argument which consists of one or
f9e10201
JD
228two characters from the set \*(Aqwnvb\*(Aq.
229The character \*(Aqw\*(Aq enables printing of all 256 words. The character
230\*(Aqn\*(Aq suppresses printing of bits, \*(Aqv\*(Aq enables printing of all
231bits from valid words, \*(Aqb\*(Aq enables printing of all bits.
232For example \*(Aq\-\-identify=n\*(Aq (valid words, no bits) produces the
233shortest output and \*(Aq\-\-identify=wb\*(Aq (all words, all bits) produces
ee38a438
GI
234the longest output.
235.TP
832b75ed
GG
236.B \-a, \-\-all
237Prints all SMART information about the disk, or TapeAlert information
238about the tape drive or changer. For ATA devices this is equivalent
239to
f9e10201
JD
240.br
241\*(Aq\-H \-i \-c \-A \-l error \-l selftest \-l selective\*(Aq
242.br
832b75ed 243and for SCSI, this is equivalent to
f9e10201
JD
244.br
245\*(Aq\-H \-i \-A \-l error \-l selftest\*(Aq.
246.br
247.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 248For NVMe, this is equivalent to
f9e10201
JD
249.br
250\*(Aq\-H \-i \-c \-A \-l error\*(Aq.
251.br
252.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
2127e193
GI
253Note that for ATA disks this does \fBnot\fP enable the non-SMART options
254and the SMART options which require support for 48-bit ATA commands.
255.TP
256.B \-x, \-\-xall
f9e10201
JD
257Prints all SMART and non-SMART information about the device.
258For ATA devices this is equivalent to
259.br
260\*(Aq\-H \-i \-g all \-g wcreorder \-c \-A \-f brief \-l xerror,error
261\-l xselftest,selftest \-l selective \-l directory \-l scttemp \-l scterc
ff28b140 262\-l devstat \-l defects \-l sataphy\*(Aq.
f9e10201 263.br
2127e193 264and for SCSI, this is equivalent to
f9e10201
JD
265.br
266\*(Aq\-H \-i \-g all \-A \-l error \-l selftest \-l background \-l sasphy\*(Aq.
267.br
268.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 269For NVMe, this is equivalent to
f9e10201
JD
270.br
271\*(Aq\-H \-i \-c \-A \-l error\*(Aq.
272.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
e9583e0c
GI
273.TP
274.B \-\-scan
275Scans for devices and prints each device name, device type and protocol
f9e10201 276([ATA] or [SCSI]) info. May be used in conjunction with \*(Aq\-d TYPE\*(Aq
e9583e0c
GI
277to restrict the scan to a specific TYPE. See also info about platform
278specific device scan and the \fBDEVICESCAN\fP directive on
279\fBsmartd\fP(8) man page.
280.TP
281.B \-\-scan\-open
282Same as \-\-scan, but also tries to open each device before printing
283device info. The device open may change the device type due
f9e10201
JD
284to autodetection (see also \*(Aq\-d test\*(Aq).
285.Sp
cfbba5b9 286This option can be used to create a draft \fBsmartd.conf\fP file.
f9e10201 287All options after \*(Aq\-\-\*(Aq are appended to each output line.
cfbba5b9 288For example:
f9e10201 289.Vb 1
ee38a438 290smartctl \-\-scan\-open \-\- \-a \-W 4,45,50 \-m admin@work > smartd.conf
f9e10201
JD
291.Ve
292.Sp
f9e10201
JD
293Multiple \*(Aq\-d TYPE\*(Aq options may be specified with
294\*(Aq\-\-scan[\-open]\*(Aq to combine the scan results of more than one TYPE.
d008864d
GI
295.TP
296.B \-g NAME, \-\-get=NAME
f9e10201
JD
297Get non-SMART device settings. See \*(Aq\-s, \-\-set\*(Aq below for further
298info.
299.Sp
832b75ed 300.TP
ee38a438 301.B RUN-TIME BEHAVIOR OPTIONS:
832b75ed 302.TP
ff28b140
TL
303.B \-j, \-\-json[=cgiosuv]
304[NEW EXPERIMENTAL SMARTCTL FEATURE]
305Enables JSON output mode.
306.Sp
307The output could be modified or enhanced by the optional argument which
308consists of one or more characters from the set \*(Aqcgiosuv\*(Aq:
309.br
310\*(Aqc\*(Aq: Outputs \fBc\fRompact format without extra spaces and newlines.
311By default, output is pretty-printed.
312.br
313\*(Aqg\*(Aq: Outputs JSON structure as single assignments to allow the usage
314of \fBg\fRrep.
315Each assignment reflects the absolute path of a value.
316The syntax is compatible with \fBgron\fR:
317.br
318\*(Aqjson.KEY1[INDEX2].KEY3 = VALUE;\*(Aq.
319.br
320\*(Aqo\*(Aq: Includes the full \fBo\fRriginal plaintext \fBo\fRutput of
321\fBsmartctl\fR as a JSON array \*(Aqsmartctl.output[]\*(Aq.
322.br
323\*(Aqs\*(Aq: Outputs JSON object elements \fBs\fRorted by key.
324By default, object elements are ordered as generated internally.
325.br
326\*(Aqv\*(Aq: Enables \fBv\fRerbose output of possible unsafe integers.
327If specified, values which may exceed JSON safe integer (53-bit) range are
328always output as a number (with some \*(AqKEY\*(Aq) and a string
329(\*(AqKEY_s\*(Aq), regardless of the actual value.
330Values which may exceed 64-bit range are also output as a little endian
331byte array (\*(AqKEY_le\*(Aq).
332By default, the additional elements are only output if the value actually
333exceeds the range.
334.Sp
335The following two arguments are primarily indented for development:
336.br
337\*(Aqi\*(Aq: Includes lines from the plaintext output which print info already
338\fBi\fRmplemented for JSON output.
339The lines appear as objects with key \*(Aqsmartctl_NNNN_i\*(Aq.
340.br
341\*(Aqu\*(Aq: Includes lines from the plaintext output which print info still
342\fBu\fRnimplemented for JSON output.
343The lines appear as objects with key \*(Aqsmartctl_NNNN_u\*(Aq.
344.TP
832b75ed 345.B \-q TYPE, \-\-quietmode=TYPE
f9e10201 346Specifies that \fBsmartctl\fP should run in one of the quiet modes
832b75ed 347described here. The valid arguments to this option are:
f9e10201 348.Sp
832b75ed 349.I errorsonly
f9e10201 350\- only print: For the \*(Aq\-l error\*(Aq option, if nonzero, the number
ee38a438 351of errors recorded in the SMART error log and the power-on time when
f9e10201
JD
352they occurred; For the \*(Aq\-l selftest\*(Aq option, errors recorded in
353the device self-test log; For the \*(Aq\-H\*(Aq option, SMART "disk failing"
354status or device Attributes (pre-failure or usage) which failed either now
355or in the past; For the \*(Aq\-A\*(Aq option, device Attributes (pre-failure
356or usage) which failed either now or in the past.
357.Sp
832b75ed
GG
358.I silent
359\- print no output. The only way to learn about what was found is to
a86ec89e 360use the exit status of \fBsmartctl\fP (see EXIT STATUS below).
f9e10201 361.Sp
a37e7145
GG
362.I noserial
363\- Do not print the serial number of the device.
832b75ed
GG
364.TP
365.B \-d TYPE, \-\-device=TYPE
cfbba5b9
GI
366Specifies the type of the device.
367The valid arguments to this option are:
f9e10201 368.Sp
cfbba5b9 369.I auto
ee38a438 370\- attempt to guess the device type from the device name or from
cfbba5b9
GI
371controller type info provided by the operating system or from
372a matching USB ID entry in the drive database.
373This is the default.
f9e10201 374.Sp
cfbba5b9 375.I test
f9e10201 376\- prints the guessed TYPE, then opens the device and prints the
ff28b140 377(possibly changed) TYPE name and then exits without performing
cfbba5b9 378any further commands.
f9e10201 379.Sp
cfbba5b9
GI
380.I ata
381\- the device type is ATA. This prevents
382\fBsmartctl\fP
383from issuing SCSI commands to an ATA device.
f9e10201 384.Sp
d008864d 385.\" %IF NOT OS Darwin
cfbba5b9
GI
386.I scsi
387\- the device type is SCSI. This prevents
388\fBsmartctl\fP
389from issuing ATA commands to a SCSI device.
f9e10201 390.Sp
a86ec89e 391.\" %ENDIF NOT OS Darwin
f9e10201 392.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 393.I nvme[,NSID]
ff28b140 394\- the device type is NVM Express (NVMe).
a86ec89e
GI
395The optional parameter NSID specifies the namespace id (in hex) passed
396to the driver.
397Use 0xffffffff for the broadcast namespace id.
398The default for NSID is the namespace id addressed by the device name.
f9e10201
JD
399.Sp
400.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 401.\" %IF NOT OS Darwin
d008864d 402.I sat[,auto][,N]
cfbba5b9 403\- the device type is SCSI to ATA Translation (SAT).
f9e10201
JD
404This is for ATA disks that have a SCSI to ATA Translation Layer (SATL)
405between the disk and the operating system.
4d59bff9 406SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and
cfbba5b9 407the other 16 bytes long. The default is the 16 byte variant which can be
f9e10201
JD
408overridden with either \*(Aq\-d sat,12\*(Aq or \*(Aq\-d sat,16\*(Aq.
409.Sp
410If \*(Aq\-d sat,auto\*(Aq is specified, device type SAT (for ATA/SATA disks)
411is only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA ").
d008864d 412Otherwise device type SCSI (for SCSI/SAS disks) is used.
f9e10201 413.Sp
cfbba5b9
GI
414.I usbcypress
415\- this device type is for ATA disks that are behind a Cypress USB to PATA
416bridge. This will use the ATACB proprietary scsi pass through command.
417The default SCSI operation code is 0x24, but although it can be overridden
f9e10201 418with \*(Aq\-d usbcypress,0xN\*(Aq, where N is the scsi operation code,
2127e193 419you're running the risk of damage to the device or filesystems on it.
f9e10201 420.Sp
ee38a438
GI
421.I usbjmicron[,p][,x][,PORT]
422\- this device type is for SATA disks that are behind a JMicron USB to
f9e10201
JD
423PATA/SATA bridge.
424The 48-bit ATA commands (required e.g.\& for \*(Aq\-l xerror\*(Aq, see below)
425do not work with all of these bridges and are therefore disabled by default.
426These commands can be enabled by \*(Aq\-d usbjmicron,x\*(Aq.
427If two disks are connected to a bridge with two ports, an error message is
428printed if no PORT is specified.
429The port can be specified by \*(Aq\-d usbjmicron[,x],PORT\*(Aq where PORT is 0
cfbba5b9
GI
430(master) or 1 (slave). This is not necessary if the device uses a port
431multiplier to connect multiple disks to one port. The disks appear under
432separate /dev/ice names then.
f9e10201 433CAUTION: Specifying \*(Aq,x\*(Aq for a device which does not support it results
cfbba5b9
GI
434in I/O errors and may disconnect the drive. The same applies if the specified
435PORT does not exist or is not connected to a disk.
f9e10201 436.Sp
ee38a438 437The Prolific PL2507/3507 USB bridges with older firmware support a pass-through
f9e10201 438command similar to JMicron and work with \*(Aq\-d usbjmicron,0\*(Aq.
ee38a438 439Newer Prolific firmware requires a modified command which can be selected by
f9e10201 440\*(Aq\-d usbjmicron,p\*(Aq.
ee38a438 441Note that this does not yet support the SMART status command.
f9e10201 442.Sp
a86ec89e 443.I usbprolific
f9e10201
JD
444\- this device type is for SATA disks that are behind a Prolific
445PL2571/2771/2773/2775 USB to SATA bridge.
446.Sp
cfbba5b9
GI
447.I usbsunplus
448\- this device type is for SATA disks that are behind a SunplusIT USB to SATA
449bridge.
f9e10201 450.Sp
ff28b140
TL
451.I sntjmicron[,NSID]
452\- [NEW EXPERIMENTAL SMARTCTL FEATURE]
453this device type is for NVMe disks that are behind a JMicron USB to NVMe
454bridge.
455The optional parameter NSID specifies the namespace id (in hex) passed
456to the driver.
457The default namespace id is the broadcast namespace id (0xffffffff).
458.Sp
d008864d
GI
459.\" %ENDIF NOT OS Darwin
460.\" %IF OS Linux
cfbba5b9
GI
461.I marvell
462\- [Linux only] interact with SATA disks behind Marvell chip-set
463controllers (using the Marvell rather than libata driver).
f9e10201 464.Sp
cfbba5b9
GI
465.I megaraid,N
466\- [Linux only] the device consists of one or more SCSI/SAS disks connected
467to a MegaRAID controller. The non-negative integer N (in the range of 0 to
468127 inclusive) denotes which disk on the controller is monitored.
469Use syntax such as:
f9e10201 470.br
2127e193 471\fBsmartctl \-a \-d megaraid,2 /dev/sda\fP
f9e10201 472.br
2127e193 473\fBsmartctl \-a \-d megaraid,0 /dev/sdb\fP
f9e10201 474.br
ee38a438 475\fBsmartctl \-a \-d megaraid,0 /dev/bus/0\fP
f9e10201 476.br
cfbba5b9 477This interface will also work for Dell PERC controllers.
ee38a438
GI
478It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus
479number.
f9e10201 480.Sp
ee38a438 481The following entry in /proc/devices must exist:
d2e702cf 482.br
ee38a438 483For PERC2/3/4 controllers: \fBmegadevN\fP
d2e702cf 484.br
ee38a438 485For PERC5/6 controllers: \fBmegaraid_sas_ioctlN\fP
f9e10201 486.Sp
a86ec89e
GI
487.\" %ENDIF OS Linux
488.\" %IF OS Linux Windows Cygwin
d2e702cf 489.I aacraid,H,L,ID
f9e10201 490\- [Linux, Windows and Cygwin only] the device consists of one or more
ff28b140 491SCSI/SAS or SATA disks connected to an AacRaid controller.
d2e702cf
GI
492The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk
493on the controller is monitored.
494Use syntax such as:
f9e10201 495.br
a86ec89e 496\fBsmartctl \-a \-d aacraid,0,0,2 /dev/sda\fP
f9e10201 497.br
a86ec89e 498\fBsmartctl \-a \-d aacraid,1,0,4 /dev/sdb\fP
f9e10201 499.Sp
ff28b140
TL
500Option \*(Aq\-d sat,auto+...\*(Aq is implicitly enabled to detect SATA disks.
501Use \*(Aq\-d scsi+aacraid,H,L,ID\*(Aq to disable it.
502.Sp
a86ec89e
GI
503.\" %ENDIF OS Linux Windows Cygwin
504.\" %IF OS Linux
505On Linux, the following entry in /proc/devices must exist: \fBaac\fP.
d2e702cf 506Character device nodes /dev/aacH (H=Host number) are created if required.
f9e10201 507.Sp
d008864d 508.\" %ENDIF OS Linux
a86ec89e 509.\" %IF OS Windows Cygwin
f9e10201
JD
510On Windows, the device name parameter /dev/sdX is ignored if
511\*(Aq\-d aacraid\*(Aq is specified.
512.Sp
a86ec89e 513.\" %ENDIF OS Windows Cygwin
d008864d 514.\" %IF OS FreeBSD Linux
cfbba5b9
GI
515.I 3ware,N
516\- [FreeBSD and Linux only] the device consists of one or more ATA disks
517connected to a 3ware RAID controller. The non-negative integer N
518(in the range from 0 to 127 inclusive) denotes which disk on the controller
519is monitored.
520Use syntax such as:
f9e10201 521.br
ee38a438 522\fBsmartctl \-a \-d 3ware,2 /dev/sda\fP [Linux only]
f9e10201 523.br
832b75ed 524\fBsmartctl \-a \-d 3ware,0 /dev/twe0\fP
f9e10201 525.br
832b75ed 526\fBsmartctl \-a \-d 3ware,1 /dev/twa0\fP
f9e10201 527.br
ee38a438 528\fBsmartctl \-a \-d 3ware,1 /dev/twl0\fP [Linux only]
f9e10201 529.br
ee38a438 530\fBsmartctl \-a \-d 3ware,1 /dev/tws0\fP [FreeBSD only]
f9e10201
JD
531.br
532The first two forms, which refer to devices /dev/sda\-z (deprecated)
533and /dev/twe0\-15, may be used with 3ware series 6000, 7000, and 8000
534series controllers that use the 3x-xxxx driver.
535The devices /dev/twa0\-15, must be used with 3ware 9000 series controllers,
536which use the 3w\-9xxx driver.
537The devices /dev/twl0\-15 [Linux] or /dev/tws0\-15 [FreeBSD] must be used
538with the 3ware/LSI 9750 series controllers which use the 3w-sas driver.
539.Sp
ee38a438 540Note that if the special character device nodes /dev/tw[ls]?, /dev/twa?
cfbba5b9 541and /dev/twe? do not exist, or exist with the incorrect major or minor
f9e10201
JD
542numbers, smartctl will recreate them on the fly.
543.Sp
d008864d 544.\" %ENDIF OS FreeBSD Linux
f4e463df 545.\" %IF OS FreeBSD Linux Windows Cygwin
cfbba5b9 546.I areca,N
f9e10201
JD
547\- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or
548more SATA disks connected to an Areca SATA RAID controller.
549The positive integer N (in the range from 1 to 24 inclusive) denotes which
550disk on the controller is monitored.
f4e463df 551.\" %ENDIF OS FreeBSD Linux Windows Cygwin
d008864d
GI
552.\" %IF OS Linux
553On Linux use syntax such as:
f9e10201 554.br
2127e193 555\fBsmartctl \-a \-d areca,2 /dev/sg2\fP
f9e10201 556.br
2127e193 557\fBsmartctl \-a \-d areca,3 /dev/sg3\fP
f9e10201 558.br
d008864d
GI
559.\" %ENDIF OS Linux
560.\" %IF OS FreeBSD
561On FreeBSD use syntax such as:
f9e10201 562.br
d008864d 563\fBsmartctl \-a \-d areca,2 /dev/arcmsr1\fP
f9e10201 564.br
d008864d 565\fBsmartctl \-a \-d areca,3 /dev/arcmsr2\fP
f9e10201 566.br
d008864d 567.\" %ENDIF OS FreeBSD
f4e463df 568.\" %IF OS Windows Cygwin
a86ec89e 569On Windows and Cygwin use syntax such as:
f9e10201 570.br
f4e463df 571\fBsmartctl \-a \-d areca,2 /dev/arcmsr0\fP
f9e10201 572.br
f4e463df 573\fBsmartctl \-a \-d areca,3 /dev/arcmsr1\fP
f9e10201 574.br
f4e463df
GI
575.\" %ENDIF OS Windows Cygwin
576.\" %IF OS FreeBSD Linux Windows Cygwin
f9e10201
JD
577The first line above addresses the second disk on the first Areca RAID
578controller.
cfbba5b9 579The second line addresses the third disk on the second Areca RAID
f9e10201 580controller.
f4e463df 581.\" %ENDIF OS FreeBSD Linux Windows Cygwin
d008864d 582.\" %IF OS Linux
f4e463df 583To help identify the correct device on Linux, use the command:
f9e10201 584.br
2127e193 585\fBcat /proc/scsi/sg/device_hdr /proc/scsi/sg/devices\fP
f9e10201 586.br
2127e193 587to show the SCSI generic devices (one per line, starting with
cfbba5b9 588/dev/sg0). The correct SCSI generic devices to address for
2127e193
GI
589smartmontools are the ones with the type field equal to 3. If the
590incorrect device is addressed, please read the warning/error messages
591carefully. They should provide hints about what devices to use.
d008864d 592.\" %ENDIF OS Linux
f4e463df 593.\" %IF OS FreeBSD Linux Windows Cygwin
f9e10201 594.Sp
2127e193 595Important: the Areca controller must have firmware version 1.46 or
cfbba5b9 596later. Lower-numbered firmware versions will give (harmless) SCSI
2127e193 597error messages and no SMART information.
f9e10201 598.Sp
f4e463df 599.I areca,N/E
a86ec89e
GI
600\- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one
601or more SATA or SAS disks connected to an Areca SAS RAID controller.
f4e463df
GI
602The integer N (range 1 to 128) denotes the channel (slot) and E (range
6031 to 8) denotes the enclosure.
ee38a438 604Important: This requires Areca SAS controller firmware version 1.51 or later.
f9e10201 605.Sp
f4e463df 606.\" %ENDIF OS FreeBSD Linux Windows Cygwin
d008864d 607.\" %IF OS FreeBSD Linux
cfbba5b9 608.I cciss,N
f9e10201
JD
609\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or
610SATA disks connected to a cciss RAID controller.
611The non-negative integer N (in the range from 0 to 15 inclusive) denotes
612which disk on the controller is monitored.
613.Sp
ff28b140
TL
614Option \*(Aq\-d sat,auto+...\*(Aq is implicitly enabled to detect SATA disks.
615Use \*(Aq\-d scsi+cciss,N\*(Aq to disable it.
616.Sp
ee38a438
GI
617To look at disks behind HP Smart Array controllers, use syntax
618such as:
619.\" %ENDIF OS FreeBSD Linux
620.\" %IF OS Linux
f9e10201 621.br
ee38a438 622\fBsmartctl \-a \-d cciss,0 /dev/cciss/c0d0\fP (cciss driver under Linux)
f9e10201 623.br
ee38a438 624\fBsmartctl \-a \-d cciss,0 /dev/sg2\fP (hpsa or hpahcisr drivers under Linux)
ee38a438
GI
625.\" %ENDIF OS Linux
626.\" %IF OS FreeBSD
f9e10201 627.br
ee38a438 628\fBsmartctl \-a \-d cciss,0 /dev/ciss0\fP (under FreeBSD)
ee38a438
GI
629.\" %ENDIF OS FreeBSD
630.\" %IF OS FreeBSD Linux
f9e10201 631.Sp
cfbba5b9
GI
632.I hpt,L/M/N
633\- [FreeBSD and Linux only] the device consists of one or more ATA disks
634connected to a HighPoint RocketRAID controller. The integer L is the
635controller id, the integer M is the channel number, and the integer N
636is the PMPort number if it is available. The allowed values of L are
3d17a85c 637from 1 to 4 inclusive, M are from 1 to 128 inclusive and N from 1 to 4
cfbba5b9
GI
638if PMPort available. And also these values are limited by the model
639of the HighPoint RocketRAID controller.
640Use syntax such as:
d008864d
GI
641.\" %ENDIF OS FreeBSD Linux
642.\" %IF OS Linux
f9e10201 643.br
2127e193 644\fBsmartctl \-a \-d hpt,1/3 /dev/sda\fP (under Linux)
f9e10201 645.br
2127e193 646\fBsmartctl \-a \-d hpt,1/2/3 /dev/sda\fP (under Linux)
d008864d
GI
647.\" %ENDIF OS Linux
648.\" %IF OS FreeBSD
f9e10201 649.br
2127e193 650\fBsmartctl \-a \-d hpt,1/3 /dev/hptrr\fP (under FreeBSD)
f9e10201 651.br
2127e193 652\fBsmartctl \-a \-d hpt,1/2/3 /dev/hptrr\fP (under FreeBSD)
d008864d
GI
653.\" %ENDIF OS FreeBSD
654.\" %IF OS FreeBSD Linux
f9e10201 655.br
a37e7145 656Note that the /dev/sda\-z form should be the device node which stands for
2127e193
GI
657the disks derived from the HighPoint RocketRAID controllers under Linux and
658under FreeBSD, it is the character device which the driver registered (eg,
cfbba5b9 659/dev/hptrr, /dev/hptmv6).
d008864d 660.\" %ENDIF OS FreeBSD Linux
f9e10201
JD
661.Sp
662.I intelliprop,N[+TYPE]
663\- [NEW EXPERIMENTAL SMARTCTL FEATURE] the device consists of multiple ATA
664disks connected to an Intelliprop controller.
665The integer N is the port number from 0 to 3 of the ATA drive to be targeted.
666The TYPE can be ata(default), sat, or a USB controller listed above.
667Note: if a type of ATA does not work, try a type of sat.
668Use syntax such as:
669.br
670\fBsmartctl \-a \-d intelliprop,1 /dev/sda\fP (under Linux)
671.br
672\fBsmartctl \-a \-d intelliprop,1+sat /dev/sda\fP (under Linux)
673.br
674\fBWARNING: The disks are selected by write commands to the ATA Device
675Vendor Specific Log at address 0xc0.
676Using this option with other devices may have undesirable side effects.\fP
832b75ed
GG
677.TP
678.B \-T TYPE, \-\-tolerance=TYPE
2127e193 679[ATA only] Specifies how tolerant \fBsmartctl\fP should be of ATA and SMART
f9e10201
JD
680command failures.
681.Sp
832b75ed 682The behavior of \fBsmartctl\fP depends upon whether the command is
f9e10201 683"\fBoptional\fP" or "\fBmandatory\fP". Here "\fBmandatory\fP" means
ee38a438 684"required by the ATA Specification if the device implements
832b75ed 685the SMART command set" and "\fBoptional\fP" means "not required by the
ee38a438 686ATA Specification even if the device implements the SMART
832b75ed
GG
687command set." The "\fBmandatory\fP" ATA and SMART commands are: (1)
688ATA IDENTIFY DEVICE, (2) SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE, (3)
689SMART ENABLE/DISABLE, and (4) SMART RETURN STATUS.
f9e10201 690.Sp
832b75ed 691The valid arguments to this option are:
f9e10201 692.Sp
832b75ed
GG
693.I normal
694\- exit on failure of any \fBmandatory\fP SMART command, and ignore
695all failures of \fBoptional\fP SMART commands. This is the default.
696Note that on some devices, issuing unimplemented optional SMART
f9e10201 697commands doesn't cause an error. This can result in misleading
832b75ed
GG
698\fBsmartctl\fP messages such as "Feature X not implemented", followed
699shortly by "Feature X: enabled". In most such cases, contrary to the
700final message, Feature X is \fBnot\fP enabled.
f9e10201 701.Sp
832b75ed
GG
702.I conservative
703\- exit on failure of any \fBoptional\fP SMART command.
f9e10201 704.Sp
832b75ed
GG
705.I permissive
706\- ignore failure(s) of \fBmandatory\fP SMART commands. This option
707may be given more than once. Each additional use of this option will
708cause one more additional failure to be ignored. Note that the use of
ee38a438
GI
709this option can lead to messages like "Feature X not supported",
710followed shortly by "Feature X enable failed". In a few
832b75ed 711such cases, contrary to the final message, Feature X \fBis\fP enabled.
f9e10201 712.Sp
832b75ed 713.I verypermissive
f9e10201 714\- equivalent to giving a large number of \*(Aq\-T permissive\*(Aq options:
832b75ed
GG
715ignore failures of \fBany number\fP of \fBmandatory\fP SMART commands.
716Please see the note above.
832b75ed
GG
717.TP
718.B \-b TYPE, \-\-badsum=TYPE
2127e193
GI
719[ATA only] Specifies the action \fBsmartctl\fP should take if a checksum
720error is detected in the: (1) Device Identity Structure, (2) SMART
ee38a438 721Self-Test Log Structure, (3) SMART Attribute Value Structure, (4) SMART
832b75ed 722Attribute Threshold Structure, or (5) ATA Error Log Structure.
f9e10201 723.Sp
832b75ed 724The valid arguments to this option are:
f9e10201 725.Sp
832b75ed
GG
726.I warn
727\- report the incorrect checksum but carry on in spite of it. This is the
728default.
f9e10201 729.Sp
832b75ed
GG
730.I exit
731\- exit \fBsmartctl\fP.
f9e10201 732.Sp
832b75ed
GG
733.I ignore
734\- continue silently without issuing a warning.
832b75ed
GG
735.TP
736.B \-r TYPE, \-\-report=TYPE
737Intended primarily to help \fBsmartmontools\fP developers understand
ee38a438 738the behavior of \fBsmartmontools\fP on non-conforming or poorly
832b75ed
GG
739conforming hardware. This option reports details of \fBsmartctl\fP
740transactions with the device. The option can be used multiple times.
741When used just once, it shows a record of the ioctl() transactions
742with the device. When used more than once, the detail of these
743ioctl() transactions are reported in greater detail. The valid
744arguments to this option are:
f9e10201 745.Sp
832b75ed
GG
746.I ioctl
747\- report all ioctl() transactions.
f9e10201 748.Sp
832b75ed
GG
749.I ataioctl
750\- report only ioctl() transactions with ATA devices.
f9e10201 751.Sp
832b75ed 752.I scsiioctl
f9e10201
JD
753\- report only ioctl() transactions with SCSI devices.
754Invoking this once shows the SCSI commands in hex and the corresponding status.
755Invoking it a second time adds a hex listing of the first 64 bytes of data
756send to, or received from the device.
757.Sp
758.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 759.I nvmeioctl
ff28b140 760\- report only ioctl() transactions with NVMe devices.
f9e10201
JD
761.Sp
762.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed
GG
763Any argument may include a positive integer to specify the level of detail
764that should be reported. The argument should be followed by a comma then
f9e10201 765the integer with no spaces. For example,
832b75ed 766.I ataioctl,2
f9e10201
JD
767The default level is 1, so \*(Aq\-r ataioctl,1\*(Aq and \*(Aq\-r ataioctl\*(Aq
768are equivalent.
769.Sp
770For testing purposes, the output of \*(Aq\-r ataioctl,2\*(Aq can later be parsed
771by \fBsmartctl\fP itself if \*(Aq\-\*(Aq is used as device path argument.
a37e7145
GG
772The ATA command input parameters, sector data and return values are
773reconstructed from the debug report read from stdin.
774Then \fBsmartctl\fP internally simulates an ATA device with the same
f9e10201
JD
775behaviour.
776This is does not work for SCSI devices yet.
4d59bff9 777.TP
f9e10201 778.B \-n POWERMODE[,STATUS], \-\-nocheck=POWERMODE[,STATUS]
2127e193 779[ATA only] Specifies if \fBsmartctl\fP should exit before performing any
f9e10201
JD
780checks when the device is in a low-power mode.
781It may be used to prevent a disk from being spun-up by \fBsmartctl\fP.
782The power mode is ignored by default.
783.Sp
cfbba5b9 784Note: If this option is used it may also be necessary to specify the device
f9e10201 785type with the \*(Aq\-d\*(Aq option. Otherwise the device may spin up due to
cfbba5b9 786commands issued during device type autodetection.
f9e10201
JD
787.Sp
788By default, exit status 2 is returned if the device is in one of the
789specified low-power modes.
790This status is also returned if the device open or identification failed
791(see EXIT STATUS below).
792.Sp
793[NEW EXPERIMENTAL SMARTCTL FEATURE]
794The optional STATUS parameter allows to override this default.
795STATUS is an integer in the range from 0 to 255 inclusive.
796For example use \*(Aq\-n standby,0\*(Aq to return success if a device is in
797SLEEP or STANDBY mode.
798Use \*(Aq\-n standby,3\*(Aq to return a unique exit status in this case.
799.Sp
cfbba5b9 800The valid arguments to this option are:
f9e10201 801.Sp
4d59bff9 802.I never
f9e10201 803\- check the device always, but print the power mode if \*(Aq\-i\*(Aq is
4d59bff9 804specified.
f9e10201
JD
805.Sp
806.I sleep[,STATUS]
4d59bff9 807\- check the device unless it is in SLEEP mode.
f9e10201
JD
808.Sp
809.I standby[,STATUS]
4d59bff9
GG
810\- check the device unless it is in SLEEP or STANDBY mode. In
811these modes most disks are not spinning, so if you want to prevent
812a disk from spinning up, this is probably what you want.
f9e10201
JD
813.Sp
814.I idle[,STATUS]
4d59bff9
GG
815\- check the device unless it is in SLEEP, STANDBY or IDLE mode.
816In the IDLE state, most disks are still spinning, so this is probably
817not what you want.
f9e10201 818.Sp
832b75ed
GG
819.TP
820.B SMART FEATURE ENABLE/DISABLE COMMANDS:
821.IP
f9e10201 822.B Note:
832b75ed 823if multiple options are used to both enable and disable a
f9e10201 824feature, then
832b75ed
GG
825.B both
826the enable and disable commands will be issued. The enable command
827will always be issued
828.B before
829the corresponding disable command.
830.TP
f9e10201 831.B \-s VALUE, \-\-smart=VALUE
832b75ed 832Enables or disables SMART on device. The valid arguments to
f9e10201
JD
833this option are \fIon\fP and \fIoff\fP.
834.Sp
835[ATA]
836Note that the ATA commands SMART ENABLE/DISABLE OPERATIONS were declared obsolete
837in ATA ACS-4 Revision 10 (Nov 2015).
838.Sp
839[SCSI tape drive or changer]
840It is not necessary (or useful) to enable SMART to see the TapeAlert messages.
832b75ed
GG
841.TP
842.B \-o VALUE, \-\-offlineauto=VALUE
2127e193 843[ATA only] Enables or disables SMART automatic offline test, which scans the
f9e10201
JD
844drive every four hours for disk defects.
845This command can be given during normal system operation.
846The valid arguments to this option are \fIon\fP and \fIoff\fP.
847.Sp
832b75ed
GG
848Note that the SMART automatic offline test command is listed as
849"Obsolete" in every version of the ATA and ATA/ATAPI Specifications.
ee38a438 850It was originally part of the SFF-8035i Revision 2.0 specification,
832b75ed 851but was never part of any ATA specification. However it is
d2e702cf 852implemented and used by many vendors.
832b75ed 853You can tell if automatic offline testing is supported by seeing if
f9e10201
JD
854this command enables and disables it, as indicated by the \*(AqAuto
855Offline Data Collection\*(Aq part of the SMART capabilities report
856(displayed with \*(Aq\-c\*(Aq).
857.Sp
832b75ed
GG
858SMART provides \fBthree\fP basic categories of testing. The
859\fBfirst\fP category, called "online" testing, has no effect on the
f9e10201
JD
860performance of the device. It is turned on by the \*(Aq\-s on\*(Aq option.
861.Sp
862The \fBsecond\fP category of testing is called "offline" testing.
863This type of test can, in principle, degrade the device performance.
864The \*(Aq\-o on\*(Aq option causes this offline testing to be carried out,
832b75ed
GG
865automatically, on a regular scheduled basis. Normally, the disk will
866suspend offline testing while disk accesses are taking place, and then
867automatically resume it when the disk would otherwise be idle, so in
ee38a438 868practice it has little effect. Note that a one-time offline test can
832b75ed 869also be carried out immediately upon receipt of a user command. See
f9e10201 870the \*(Aq\-t offline\*(Aq option below, which causes a one-time offline test
832b75ed 871to be carried out immediately.
f9e10201 872.Sp
ee38a438 873The choice (made by the SFF-8035i and ATA specification authors) of
832b75ed
GG
874the word \fItesting\fP for these first two categories is unfortunate,
875and often leads to confusion. In fact these first two categories of
876online and offline testing could have been more accurately described
877as online and offline \fBdata collection\fP.
f9e10201 878.Sp
832b75ed
GG
879The results of this automatic or immediate offline testing (data
880collection) are reflected in the values of the SMART Attributes.
881Thus, if problems or errors are detected, the values of these
882Attributes will go below their failure thresholds; some types of
f9e10201
JD
883errors may also appear in the SMART error log.
884These are visible with the \*(Aq\-A\*(Aq and \*(Aq\-l error\*(Aq options
885respectively.
886.Sp
ee38a438 887Some SMART attribute values are updated only during off-line data
832b75ed 888collection activities; the rest are updated during normal operation of
ee38a438 889the device or during both normal operation and off-line testing. The
f9e10201 890Attribute value table produced by the \*(Aq\-A\*(Aq option indicates this in
832b75ed
GG
891the UPDATED column. Attributes of the first type are labeled
892"Offline" and Attributes of the second type are labeled "Always".
f9e10201 893.Sp
832b75ed 894The \fBthird\fP category of testing (and the \fIonly\fP category for
f9e10201 895which the word \*(Aqtesting\*(Aq is really an appropriate choice) is "self"
832b75ed 896testing. This third type of test is only performed (immediately) when
f9e10201
JD
897a command to run it is issued.
898The \*(Aq\-t\*(Aq and \*(Aq\-X\*(Aq options can be used to carry out and
899abort such self-tests; please see below for further details.
900.Sp
832b75ed 901Any errors detected in the self testing will be shown in the
f9e10201 902SMART self-test log, which can be examined using the \*(Aq\-l selftest\*(Aq
832b75ed 903option.
f9e10201 904.Sp
832b75ed 905\fBNote:\fP in this manual page, the word \fB"Test"\fP is used in
f9e10201 906connection with the second category just described, e.g.\& for the
ee38a438 907"offline" testing. The words \fB"Self-test"\fP are used in
832b75ed
GG
908connection with the third category.
909.TP
910.B \-S VALUE, \-\-saveauto=VALUE
ee38a438 911[ATA] Enables or disables SMART autosave of device vendor-specific
f9e10201 912Attributes. The valid arguments to this option are \fIon\fP
832b75ed
GG
913and \fIoff\fP. Note that this feature is preserved across disk power
914cycles, so you should only need to issue it once.
f9e10201 915.Sp
e9583e0c 916The ATA standard does not specify a method to check whether SMART
f9e10201
JD
917autosave is enabled.
918Unlike SCSI (below), smartctl is unable to print a warning if autosave is
919disabled.
920.Sp
921Note that the ATA commands SMART ENABLE/DISABLE AUTOSAVE were declared
922obsolete in ATA ACS-4 Revision 10 (Nov 2015).
923.Sp
e9583e0c 924[SCSI] For SCSI devices this toggles the value of the Global Logging
f9e10201
JD
925Target Save Disabled (GLTSD) bit in the Control Mode Page. Some disk
926manufacturers set this bit by default. This prevents error counters,
ee38a438 927power-up hours and other useful data from being placed in non-volatile
832b75ed 928storage, so these values may be reset to zero the next time the device
f9e10201
JD
929is power-cycled. If the GLTSD bit is set then \*(Aqsmartctl \-a\*(Aq will
930issue a warning. Use \fIon\fP to clear the GLTSD bit and thus enable
931saving counters to non-volatile storage. For extreme streaming-video
832b75ed
GG
932type applications you might consider using \fIoff\fP to set the GLTSD
933bit.
d008864d
GI
934.TP
935.B \-g NAME, \-\-get=NAME, \-s NAME[,VALUE], \-\-set=NAME[,VALUE]
ee38a438 936Gets/sets non-SMART device settings.
f9e10201
JD
937Note that the \*(Aq\-\-set\*(Aq option shares its short option \*(Aq\-s\*(Aq
938with \*(Aq\-\-smart\*(Aq.
939Valid arguments are:
940.Sp
d008864d 941.I all
f9e10201
JD
942\- Gets all values.
943This is equivalent to
944.br
945\*(Aq\-g aam \-g apm \-g lookahead \-g security \-g wcache \-g rcache \-g dsn\*(Aq
946.Sp
d008864d
GI
947.I aam[,N|off]
948\- [ATA only] Gets/sets the Automatic Acoustic Management (AAM) feature
949(if supported). A value of 128 sets the most quiet (slowest) mode and 254
f9e10201 950the fastest (loudest) mode, \*(Aqoff\*(Aq disables AAM. Devices may support
d008864d 951intermediate levels. Values below 128 are defined as vendor specific (0)
ee38a438 952or retired (1 to 127). Note that the AAM feature was declared obsolete in
d008864d 953ATA ACS-2 Revision 4a (Dec 2010).
f9e10201 954.Sp
d008864d
GI
955.I apm[,N|off]
956\- [ATA only] Gets/sets the Advanced Power Management (APM) feature on
957device (if supported). If a value between 1 and 254 is provided, it will
f9e10201 958attempt to enable APM and set the specified value, \*(Aqoff\*(Aq disables APM.
d008864d
GI
959Note the actual behavior depends on the drive, for example some drives disable
960APM if their value is set above 128. Values below 128 are supposed to allow
961drive spindown, values 128 and above adjust only head-parking frequency,
962although the actual behavior defined is also vendor-specific.
f9e10201 963.Sp
d008864d
GI
964.I lookahead[,on|off]
965\- [ATA only] Gets/sets the read look-ahead feature (if supported).
966Read look-ahead is usually enabled by default.
f9e10201 967.Sp
d008864d
GI
968.I security
969\- [ATA only] Gets the status of ATA Security feature (if supported).
970If ATA Security is enabled an ATA user password is set. The drive will be
971locked on next reset then.
f9e10201 972.Sp
d008864d
GI
973.I security-freeze
974\- [ATA only] Sets ATA Security feature to frozen mode. This prevents that
975the drive accepts any security commands until next reset. Note that the
976frozen mode may already be set by BIOS or OS.
f9e10201 977.Sp
d008864d
GI
978.I standby,[N|off]
979\- [ATA only] Sets the standby (spindown) timer and places the drive in the
f9e10201 980IDLE mode. A value of 0 or \*(Aqoff\*(Aq disables the standby timer.
d008864d
GI
981Values from 1 to 240 specify timeouts from 5 seconds to 20 minutes in 5
982second increments. Values from 241 to 251 specify timeouts from 30 minutes
983to 330 minutes in 30 minute increments. Value 252 specifies 21 minutes.
984Value 253 specifies a vendor specific time between 8 and 12 hours. Value
985255 specifies 21 minutes and 15 seconds. Some drives may use a vendor
986specific interpretation for the values. Note that there is no get option
987because ATA standards do not specify a method to read the standby timer.
f9e10201
JD
988.br
989[NEW EXPERIMENTAL SMARTCTL FEATURE]
990If \*(Aq\-s standby,now\*(Aq is also specified, the drive is immediately placed
991in the STANDBY mode without temporarily placing it in the IDLE mode.
992Note that ATA standards do not specify a command to set the standby timer
993without affecting the power mode.
994.Sp
d008864d 995.I standby,now
f9e10201
JD
996\- [ATA only] Places the drive in the STANDBY mode.
997This usually spins down the drive.
998The setting of the standby timer is not affected unless
999\*(Aq\-s standby,[N|off]\*(Aq is also specified.
1000.Sp
d008864d 1001.I wcache[,on|off]
ee38a438 1002\- [ATA] Gets/sets the volatile write cache feature (if supported).
d008864d 1003The write cache is usually enabled by default.
f9e10201 1004.Sp
ee38a438 1005.I wcache[,on|off]
f9e10201 1006\- [SCSI] Gets/sets the \*(AqWrite Cache Enable\*(Aq (WCE) bit (if supported).
ee38a438 1007The write cache is usually enabled by default.
f9e10201
JD
1008.Sp
1009.I wcache-sct[,ata|on|off[,p]]
1010\- [ATA only]
1011[NEW EXPERIMENTAL SMARTCTL FEATURE]
1012Gets/sets the write cache feature through SCT Feature Control (if supported).
1013The state of write cache in SCT Feature Control could be "Controlled by ATA",
1014"Force Enabled", or "Force Disabled".
1015SCT Feature control overwrites the setting by ATA Set Features command
1016(wcache[,on|off] option).
1017If SCT Feature Control sets write cache as "Force Enabled" or "Force Disabled",
1018the setting of wcache[,on|off] is ignored by the drive.
1019SCT Feature Control usually sets write cache as "Controlled by ATA" by default.
1020If \*(Aq,p\*(Aq is specified, the setting is preserved across power cycles.
1021.Sp
1022.I wcreorder[,on|off[,p]]
a86ec89e 1023\- [ATA only] Gets/sets Write Cache Reordering.
f9e10201
JD
1024If it is disabled (off), disk write scheduling is executed on a
1025first-in-first-out (FIFO) basis. If Write Cache Reordering is enabled (on),
1026then disk write scheduling may be reordered by the drive. If write cache is
3d17a85c
GI
1027disabled, the current Write Cache Reordering state is remembered but has
1028no effect on non-cached writes, which are always written in the order received.
1029The state of Write Cache Reordering has no effect on either NCQ or LCQ queued
1030commands.
f9e10201
JD
1031[NEW EXPERIMENTAL SMARTCTL FEATURE]
1032If \*(Aq,p\*(Aq is specified, the setting is preserved across power cycles.
1033.Sp
ee38a438 1034.I rcache[,on|off]
f9e10201
JD
1035\- [SCSI only] Gets/sets the \*(AqRead Cache Disable\*(Aq (RCE) bit.
1036\*(AqOff\*(Aq value disables read cache (if supported).
ee38a438 1037The read cache is usually enabled by default.
f9e10201
JD
1038.Sp
1039.I dsn[,on|off]
1040\- [ATA only]
1041[NEW EXPERIMENTAL SMARTCTL FEATURE]
1042Gets/sets the DSN feature (if supported).
1043The dsn is usually disabled by default.
1044.Sp
832b75ed
GG
1045.TP
1046.B SMART READ AND DISPLAY DATA OPTIONS:
1047.TP
1048.B \-H, \-\-health
a86ec89e 1049Prints the health status of the device or pending TapeAlert messages.
f9e10201 1050.Sp
832b75ed
GG
1051If the device reports failing health status, this means
1052.B either
f9e10201
JD
1053that the device has already failed,
1054.B or
832b75ed 1055that it is predicting its own failure within the next 24 hours. If
f9e10201 1056this happens, use the \*(Aq\-a\*(Aq option to get more information, and
1953ff6d 1057.B get your data off the disk and to someplace safe as soon as you can.
f9e10201 1058.Sp
a86ec89e
GI
1059[ATA] Health status is obtained by checking the (boolean) result returned
1060by the SMART RETURN STATUS command.
1061The return value of this ATA command may be unknown due to limitations or
f9e10201 1062bugs in some layer (e.g.\& RAID controller or USB bridge firmware) between
a86ec89e
GI
1063disk and operating system.
1064In this case, \fBsmartctl\fP prints a warning and checks whether any
1065Prefailure SMART Attribute value is less than or equal to its threshold
f9e10201
JD
1066(see \*(Aq\-A\*(Aq below).
1067.Sp
a86ec89e
GI
1068[SCSI] Health status is obtained by checking the Additional Sense Code
1069(ASC) and Additional Sense Code Qualifier (ASCQ) from Informal Exceptions
1070(IE) log page (if supported) and/or from SCSI sense data.
f9e10201 1071.Sp
a86ec89e
GI
1072[SCSI tape drive or changer] TapeAlert status is obtained by reading the
1073TapeAlert log page.
1074Please note that the TapeAlert log page flags are cleared for the initiator
1075when the page is read.
1076This means that each alert condition is reported only once by \fBsmartctl\fP
1077for each initiator for each activation of the condition.
f9e10201
JD
1078.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
1079.Sp
ff28b140 1080[NVMe] NVMe status is obtained by reading the "Critical Warning" byte from
a86ec89e 1081the SMART/Health Information log.
f9e10201 1082.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed
GG
1083.TP
1084.B \-c, \-\-capabilities
a86ec89e 1085[ATA] Prints only the generic SMART capabilities. These
2127e193 1086show what SMART features are implemented and how the device will
832b75ed
GG
1087respond to some of the different SMART commands. For example it
1088shows if the device logs errors, if it supports offline surface
ee38a438 1089scanning, and so on. If the device can carry out self-tests, this
832b75ed 1090option also shows the estimated time required to run those tests.
f9e10201
JD
1091.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
1092.Sp
ff28b140
TL
1093[NVMe] Prints various NVMe device capabilities obtained from the Identify
1094Controller and the Identify Namespace data structure.
f9e10201 1095.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed
GG
1096.TP
1097.B \-A, \-\-attributes
2127e193 1098[ATA] Prints only the vendor specific SMART Attributes. The Attributes
f9e10201
JD
1099are numbered from 1 to 253 and have specific names and ID numbers.
1100For example Attribute 12 is "power cycle count": how many times has the
832b75ed 1101disk been powered up.
f9e10201 1102.Sp
832b75ed
GG
1103Each Attribute has a "Raw" value, printed under the heading
1104"RAW_VALUE", and a "Normalized" value printed under the heading
ee38a438 1105"VALUE". [Note: \fBsmartctl\fP prints these values in base-10.] In
832b75ed 1106the example just given, the "Raw Value" for Attribute 12 would be the
ee38a438 1107actual number of times that the disk has been power-cycled, for
832b75ed
GG
1108example 365 if the disk has been turned on once per day for exactly
1109one year. Each vendor uses their own algorithm to convert this "Raw"
1110value to a "Normalized" value in the range from 1 to 254. Please keep
1111in mind that \fBsmartctl\fP only reports the different Attribute
1112types, values, and thresholds as read from the device. It does
1113\fBnot\fP carry out the conversion between "Raw" and "Normalized"
f9e10201
JD
1114values: this is done by the disk's firmware.
1115.Sp
832b75ed 1116The conversion from Raw value to a quantity with physical units is
f9e10201 1117not specified by the SMART standard. In most cases, the values printed
832b75ed
GG
1118by \fBsmartctl\fP are sensible. For example the temperature Attribute
1119generally has its raw value equal to the temperature in Celsius.
1120However in some cases vendors use unusual conventions. For example
ee38a438 1121the Hitachi disk on my laptop reports its power-on hours in minutes,
f9e10201 1122not hours. Some IBM disks track three temperatures rather than one, in
832b75ed 1123their raw values. And so on.
f9e10201 1124.Sp
832b75ed
GG
1125Each Attribute also has a Threshold value (whose range is 0 to 255)
1126which is printed under the heading "THRESH". If the Normalized value
1127is \fBless than or equal to\fP the Threshold value, then the Attribute
ee38a438 1128is said to have failed. If the Attribute is a pre-failure Attribute,
832b75ed 1129then disk failure is imminent.
f9e10201 1130.Sp
832b75ed
GG
1131Each Attribute also has a "Worst" value shown under the heading
1132"WORST". This is the smallest (closest to failure) value that the
1133disk has recorded at any time during its lifetime when SMART was
1134enabled. [Note however that some vendors firmware may actually
ee38a438 1135\fBincrease\fP the "Worst" value for some "rate-type" Attributes.]
f9e10201 1136.Sp
832b75ed 1137The Attribute table printed out by \fBsmartctl\fP also shows the
f9e10201 1138"TYPE" of the Attribute. Attributes are one of two possible types:
ee38a438 1139Pre-failure or Old age. Pre-failure Attributes are ones which, if
832b75ed
GG
1140less than or equal to their threshold values, indicate pending disk
1141failure. Old age, or usage Attributes, are ones which indicate
ee38a438 1142end-of-product life from old-age or normal aging and wearout, if
832b75ed 1143the Attribute value is less than or equal to the threshold. \fBPlease
ee38a438 1144note\fP: the fact that an Attribute is of type 'Pre-fail' does
832b75ed 1145\fBnot\fP mean that your disk is about to fail! It only has this
f9e10201 1146meaning if the Attribute's current Normalized value is less than or
832b75ed 1147equal to the threshold value.
f9e10201
JD
1148.Sp
1149If the Attribute's current Normalized value is less than or equal to
832b75ed 1150the threshold value, then the "WHEN_FAILED" column will display
f9e10201 1151"FAILING_NOW". If not, but the worst recorded value is less than or
832b75ed
GG
1152equal to the threshold value, then this column will display
1153"In_the_past". If the "WHEN_FAILED" column has no entry (indicated by
f9e10201 1154a dash: \*(Aq\-\*(Aq) then this Attribute is OK now (not failing) and has
832b75ed 1155also never failed in the past.
f9e10201 1156.Sp
832b75ed 1157The table column labeled "UPDATED" shows if the SMART Attribute values
ee38a438 1158are updated during both normal operation and off-line testing, or
832b75ed
GG
1159only during offline testing. The former are labeled "Always" and the
1160latter are labeled "Offline".
f9e10201 1161.Sp
832b75ed
GG
1162So to summarize: the Raw Attribute values are the ones that might have
1163a real physical interpretation, such as "Temperature Celsius",
ee38a438 1164"Hours", or "Start-Stop Cycles". Each manufacturer converts these,
f9e10201
JD
1165using their detailed knowledge of the disk's operations and failure
1166modes, to Normalized Attribute values in the range 1\(en254. The
832b75ed
GG
1167current and worst (lowest measured) of these Normalized Attribute
1168values are stored on the disk, along with a Threshold value that the
1169manufacturer has determined will indicate that the disk is going to
1170fail, or that it has exceeded its design age or aging limit.
1171\fBsmartctl\fP does \fBnot\fP calculate any of the Attribute values,
1172thresholds, or types, it merely reports them from the SMART data on
1173the device.
f9e10201 1174.Sp
ee38a438
GI
1175Note that starting with ATA/ATAPI-4, revision 4, the meaning of these
1176Attribute fields has been made entirely vendor-specific. However most
1177newer ATA/SATA disks seem to respect their meaning, so we have retained
832b75ed 1178the option of printing the Attribute values.
f9e10201 1179.Sp
ee38a438
GI
1180Solid-state drives use different meanings for some of the attributes.
1181In this case the attribute name printed by smartctl is incorrect unless
1182the drive is already in the smartmontools drive database.
f9e10201
JD
1183.Sp
1184Note that the ATA command SMART READ DATA was declared obsolete in
1185ATA ACS-4 Revision 10 (Nov 2015).
1186.Sp
2127e193 1187[SCSI] For SCSI devices the "attributes" are obtained from the temperature
f9e10201
JD
1188and start-stop cycle counter log pages.
1189Certain vendor specific attributes are listed if recognised.
1190The attributes are output in a relatively free format (compared with ATA
1191disk attributes).
1192.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
1193.Sp
ff28b140 1194[NVMe] For NVMe devices the attributes are obtained from the SMART/Health
a86ec89e 1195Information log.
f9e10201 1196.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed 1197.TP
a7e8ffec 1198.B \-f FORMAT, \-\-format=FORMAT
e165493d 1199[ATA only] Selects the output format of the attributes:
f9e10201 1200.Sp
a7e8ffec 1201.I old
f9e10201
JD
1202\- Old smartctl format.
1203This is the default unless the \*(Aq\-x\*(Aq option is specified.
1204.Sp
a7e8ffec 1205.I brief
ff28b140 1206\- New format which fits into 80 columns (except in some rare cases).
a7e8ffec 1207This format also decodes four additional attribute flags.
ff28b140 1208This is the default if the \*(Aq\-x\*(Aq option is specified.
f9e10201 1209.Sp
e165493d
GI
1210.I hex,id
1211\- Print all attribute IDs as hexadecimal numbers.
f9e10201 1212.Sp
e165493d
GI
1213.I hex,val
1214\- Print all normalized values as hexadecimal numbers.
f9e10201 1215.Sp
e165493d 1216.I hex
f9e10201 1217\- Same as \*(Aq\-f hex,id \-f hex,val\*(Aq.
a7e8ffec 1218.TP
832b75ed 1219.B \-l TYPE, \-\-log=TYPE
f9e10201 1220Prints various device logs.
832b75ed 1221The valid arguments to this option are:
f9e10201 1222.Sp
832b75ed 1223.I error
2127e193 1224\- [ATA] prints the Summary SMART error log. SMART disks maintain a log
f9e10201 1225of the most recent five non-trivial errors. For each of these errors, the
ee38a438 1226disk power-on lifetime at which the error occurred is recorded, as is
832b75ed
GG
1227the device status (idle, standby, etc) at the time of the error. For
1228some common types of errors, the Error Register (ER) and Status
f9e10201
JD
1229Register (SR) values are decoded and printed as text.
1230The meanings of these are:
1231.Vb 5
832b75ed
GG
1232 \fBABRT\fP: Command \fBAB\fPo\fBRT\fPed
1233 \fBAMNF\fP: \fBA\fPddress \fBM\fPark \fBN\fPot \fBF\fPound
1234 \fBCCTO\fP: \fBC\fPommand \fBC\fPompletion \fBT\fPimed \fBO\fPut
1235 \fBEOM\fP: \fBE\fPnd \fBO\fPf \fBM\fPedia
1236 \fBICRC\fP: \fBI\fPnterface \fBC\fPyclic \fBR\fPedundancy \fBC\fPode (CRC) error
1237 \fBIDNF\fP: \fBID\fPentity \fBN\fPot \fBF\fPound
ee38a438 1238 \fBILI\fP: (packet command-set specific)
832b75ed
GG
1239 \fBMC\fP: \fBM\fPedia \fBC\fPhanged
1240 \fBMCR\fP: \fBM\fPedia \fBC\fPhange \fBR\fPequest
1241 \fBNM\fP: \fBN\fPo \fBM\fPedia
1242 \fBobs\fP: \fBobs\fPolete
1243 \fBTK0NF\fP: \fBT\fPrac\fBK 0 N\fPot \fBF\fPound
1244 \fBUNC\fP: \fBUNC\fPorrectable Error in Data
1245 \fBWP\fP: Media is \fBW\fPrite \fBP\fProtected
f9e10201 1246.Ve
832b75ed
GG
1247In addition, up to the last five commands that preceded the error are
1248listed, along with a timestamp measured from the start of the
f9e10201 1249corresponding power cycle. This is displayed in the form
832b75ed
GG
1250Dd+HH:MM:SS.msec where D is the number of days, HH is hours, MM is
1251minutes, SS is seconds and msec is milliseconds. [Note: this time
1252stamp wraps after 2^32 milliseconds, or 49 days 17 hours 2 minutes and
125347.296 seconds.] The key ATA disk registers are also recorded in the
ee38a438 1254log. The final column of the error log is a text-string description
832b75ed
GG
1255of the ATA command defined by the Command Register (CR) and Feature
1256Register (FR) values. Commands that are obsolete in the most current
ee38a438
GI
1257spec are listed like this: \fBREAD LONG (w/ retry) [OBS-4]\fP,
1258indicating that the command became obsolete with or in the ATA-4
832b75ed 1259specification. Similarly, the notation \fB[RET\-\fP\fIN\fP\fB]\fP is
ee38a438 1260used to indicate that a command was retired in the ATA-\fIN\fP
832b75ed
GG
1261specification. Some commands are not defined in any version of the
1262ATA specification but are in common use nonetheless; these are marked
ee38a438 1263\fB[NS]\fP, meaning non-standard.
f9e10201 1264.Sp
d2e702cf
GI
1265The ATA Specification (ATA ACS-2 Revision 7, Section A.7.1) says:
1266\fB"Error log data structures shall include, but are not limited to,
1267Uncorrectable errors, ID Not Found errors for which the LBA requested was
1268valid, servo errors, and write fault errors. Error log data structures
1269shall not include errors attributed to the receipt of faulty commands."\fP
1270The definitions of these terms are:
832b75ed
GG
1271.br
1272\fBUNC\fP (\fBUNC\fPorrectable): data is uncorrectable. This refers
1273to data which has been read from the disk, but for which the Error
1274Checking and Correction (ECC) codes are inconsistent. In effect, this
1275means that the data can not be read.
1276.br
ee38a438 1277\fBIDNF\fP (\fBID N\fPot \fBF\fPound): user-accessible address could
f9e10201 1278not be found. For READ LOG type commands, \fBIDNF\fP can also indicate
832b75ed 1279that a device data log structure checksum was incorrect.
f9e10201 1280.Sp
832b75ed
GG
1281If the command that caused the error was a READ or WRITE command, then
1282the Logical Block Address (LBA) at which the error occurred will be
1283printed in base 10 and base 16. The LBA is a linear address, which
ee38a438 1284counts 512-byte sectors on the disk, starting from zero. (Because of
832b75ed
GG
1285the limitations of the SMART error log, if the LBA is greater than
12860xfffffff, then either no error log entry will be made, or the error
f9e10201
JD
1287log entry will have an incorrect LBA. This may happen for drives with
1288a capacity greater than 128 GiB or 137 GB.) On Linux systems the
832b75ed
GG
1289smartmontools web page has instructions about how to convert the LBA
1290address to the name of the disk file containing the erroneous disk
1291sector.
f9e10201 1292.Sp
832b75ed
GG
1293Please note that some manufacturers \fBignore\fP the ATA
1294specifications, and make entries in the error log if the device
1295receives a command which is not implemented or is not valid.
f9e10201 1296.Sp
2127e193
GI
1297.I error
1298\- [SCSI] prints the error counter log pages for reads, write and verifies.
832b75ed 1299The verify row is only output if it has an element other than zero.
f9e10201
JD
1300.Sp
1301.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 1302.I error[,NUM]
ff28b140 1303\- [NVMe] prints the NVMe Error Information log.
a86ec89e
GI
1304Only the 16 most recent log entries are printed by default.
1305This number can be changed by the optional parameter NUM.
1306The maximum number of log entries is vendor specific
1307(in the range from 1 to 256 inclusive).
f9e10201
JD
1308.Sp
1309.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
2127e193 1310.I xerror[,NUM][,error]
cfbba5b9
GI
1311\- [ATA only] prints the Extended Comprehensive SMART error log
1312(General Purpose Log address 0x03). Unlike the Summary SMART error
f9e10201 1313log (see \*(Aq\-l error\*(Aq above), it provides sufficient space to log
cfbba5b9
GI
1314the contents of the 48-bit LBA register set introduced with ATA-6.
1315It also supports logs with more than one sector. Each sector holds
f9e10201
JD
1316up to 4 log entries.
1317The actual number of log sectors is vendor specific.
1318.Sp
2127e193
GI
1319Only the 8 most recent error log entries are printed by default.
1320This number can be changed by the optional parameter NUM.
f9e10201
JD
1321.Sp
1322If \*(Aq,error\*(Aq is appended and the Extended Comprehensive SMART error
2127e193 1323log is not supported, the Summary SMART self-test log is printed.
f9e10201 1324.Sp
f4e463df
GI
1325Please note that recent drives may report errors only in the Extended
1326Comprehensive SMART error log. The Summary SMART error log may be reported
1327as supported but is always empty then.
f9e10201 1328.Sp
832b75ed 1329.I selftest
ee38a438 1330\- [ATA] prints the SMART self-test log. The disk maintains a self-test
2127e193 1331log showing the results of the self tests, which can be run using the
f9e10201 1332\*(Aq\-t\*(Aq option described below. For each of the most recent
ee38a438
GI
1333twenty-one self-tests, the log shows the type of test (short or
1334extended, off-line or captive) and the final status of the test. If
832b75ed
GG
1335the test did not complete successfully, then the percentage of the
1336test remaining is shown. The time at which the test took place,
f9e10201 1337measured in hours of disk lifetime, is also printed. [Note: this time
eb07ddf2 1338stamp wraps after 2^16 hours, or 2730 days and 16 hours, or about 7.5
f9e10201
JD
1339years.]
1340If any errors were detected, the Logical Block Address (LBA)
1341of the first error is printed in decimal notation.
1342.Sp
2127e193 1343.I selftest
ee38a438 1344\- [SCSI] the self-test log for a SCSI device has a slightly different
2127e193 1345format than for an ATA device. For each of the most recent twenty
ee38a438 1346self-tests, it shows the type of test and the status (final or in
f9e10201
JD
1347progress) of the test. SCSI standards use the terms "foreground" and
1348"background" (rather than ATA's corresponding "captive" and
1349"off-line") and "short" and "long" (rather than ATA's corresponding
832b75ed
GG
1350"short" and "extended") to describe the type of the test. The printed
1351segment number is only relevant when a test fails in the third or
1352later test segment. It identifies the test that failed and consists
1353of either the number of the segment that failed during the test, or
1354the number of the test that failed and the number of the segment in
ee38a438 1355which the test was run, using a vendor-specific method of putting both
832b75ed 1356numbers into a single byte. The Logical Block Address (LBA) of the
f9e10201 1357first error is printed in hexadecimal notation.
832b75ed 1358If provided, the SCSI Sense Key (SK), Additional Sense Code (ASC) and
f9e10201
JD
1359Additional Sense Code Qualifier (ASCQ) are also printed. The self tests
1360can be run using the \*(Aq\-t\*(Aq option described below (using the ATA
832b75ed 1361test terminology).
f9e10201 1362.Sp
2127e193 1363.I xselftest[,NUM][,selftest]
ee38a438 1364\- [ATA only] prints the Extended SMART self-test log (General Purpose
f9e10201 1365Log address 0x07). Unlike the SMART self-test log (see \*(Aq\-l selftest\*(Aq
cfbba5b9 1366above), it supports 48-bit LBA and logs with more than one sector.
f9e10201
JD
1367Each sector holds up to 19 log entries.
1368The actual number of log sectors is vendor specific.
1369.Sp
1370Only the 25 most recent log entries are printed by default.
1371This number can be changed by the optional parameter NUM.
1372.Sp
1373If \*(Aq,selftest\*(Aq is appended and the Extended SMART self-test log is not
2127e193 1374supported, the old SMART self-test log is printed.
f9e10201 1375.Sp
2127e193 1376.I selective
f9e10201 1377\- [ATA only] Please see the \*(Aq\-t select\*(Aq option below for a
ee38a438 1378description of selective self-tests. The selective self-test log
832b75ed
GG
1379shows the start/end Logical Block Addresses (LBA) of each of the five
1380test spans, and their current test status. If the span is being
ee38a438
GI
1381tested or the remainder of the disk is being read-scanned, the
1382current 65536-sector block of LBAs being tested is also displayed.
1383The selective self-test log also shows if a read-scan of the
832b75ed 1384remainder of the disk will be carried out after the selective
f9e10201 1385self-test has completed (see \*(Aq\-t afterselect\*(Aq option) and the time
ee38a438 1386delay before restarting this read-scan if it is interrupted (see
f9e10201
JD
1387\*(Aq\-t pending\*(Aq option).
1388.Sp
2127e193
GI
1389.I directory[,gs]
1390\- [ATA only] if the device supports the General Purpose Logging feature
ee38a438 1391set (ATA-6 and above) then this prints the Log Directory (the log at
832b75ed
GG
1392address 0). The Log Directory shows what logs are available and their
1393length in sectors (512 bytes). The contents of the logs at address 1
ee38a438
GI
1394[Summary SMART error log] and at address 6 [SMART self-test log] may
1395be printed using the previously-described
832b75ed
GG
1396.I error
1397and
1398.I selftest
2127e193
GI
1399arguments to this option.
1400If your version of smartctl supports 48-bit ATA commands, both the
1401General Purpose Log (GPL) and SMART Log (SL) directories are printed in
f9e10201
JD
1402one combined table. The output can be restricted to the GPL directory or
1403SL directory by \*(Aq\-l directory,q\*(Aq or \*(Aq\-l directory,s\*(Aq
1404respectively.
1405.Sp
2127e193
GI
1406.I background
1407\- [SCSI only] the background scan results log outputs information derived
ee38a438 1408from Background Media Scans (BMS) done after power up and/or periodically
f9e10201 1409(e.g.\& every 24 hours) on recent SCSI disks. If supported, the BMS status
4d59bff9
GG
1410is output first, indicating whether a background scan is currently
1411underway (and if so a progress percentage), the amount of time the disk
f9e10201
JD
1412has been powered up and the number of scans already completed.
1413Then there is a header and a line for each background scan "event".
1414These will typically be either recovered or unrecoverable errors.
1415That latter group may need some attention.
1416There is a description of the background scan mechanism in section 4.18 of
1417SBC-3 revision 6 (see www.t10.org ).
1418.Sp
2127e193
GI
1419.I scttemp, scttempsts, scttemphist
1420\- [ATA only] prints the disk temperature information provided by the
1421SMART Command Transport (SCT) commands.
f9e10201
JD
1422The option \*(Aqscttempsts\*(Aq prints current temperature and temperature
1423ranges returned by the SCT Status command, \*(Aqscttemphist\*(Aq prints
a37e7145 1424temperature limits and the temperature history table returned by
f9e10201 1425the SCT Data Table command, and \*(Aqscttemp\*(Aq prints both.
a37e7145 1426The temperature values are preserved across power cycles.
d008864d 1427The logging interval can be configured with the
f9e10201 1428\*(Aq\-l scttempint,N[,p]\*(Aq option, see below.
ee38a438
GI
1429The SCT commands were introduced in ATA8-ACS and were also
1430supported by many ATA-7 disks.
f9e10201 1431.Sp
d008864d
GI
1432.I scttempint,N[,p]
1433\- [ATA only] clears the SCT temperature history table and sets the
1434time interval for temperature logging to N minutes.
f9e10201 1435If \*(Aq,p\*(Aq is specified, the setting is preserved across power cycles.
d008864d
GI
1436Otherwise, the setting is volatile and will be reverted to the last
1437non-volatile setting by the next hard reset. The default interval
1438is vendor specific, typical values are 1, 2, or 5 minutes.
f9e10201 1439.Sp
7f0798ef 1440.I scterc[,READTIME,WRITETIME]
d008864d 1441\- [ATA only] prints values and descriptions of the SCT Error Recovery
f9e10201
JD
1442Control settings.
1443These are equivalent to TLER (as used by Western Digital), CCTL (as used
1444by Samsung and Hitachi/HGST) and ERC (as used by Seagate).
1445READTIME and WRITETIME arguments (deciseconds) set the specified values.
1446Values of 0 disable the feature, other values less than 65 are probably not
1447supported.
1448For RAID configurations, this is typically set to 70,70 deciseconds.
1449.Sp
d008864d 1450.I devstat[,PAGE]
ee38a438
GI
1451\- [ATA only] prints values and descriptions of the ATA Device Statistics
1452log pages (General Purpose Log address 0x04). If no PAGE number is specified,
d008864d
GI
1453entries from all supported pages are printed. If PAGE 0 is specified,
1454the list of supported pages is printed. Device Statistics was
d2e702cf 1455introduced in ACS-2 and is only supported by some recent devices.
f9e10201
JD
1456.Sp
1457.I defects[,NUM]
1458\- [ATA only]
1459[NEW EXPERIMENTAL SMARTCTL FEATURE]
1460prints LBA and hours values from the ATA Pending Defects log
1461(General Purpose Log address 0x0c).
1462Only the 31 entries from first log page are printed by default.
1463This number can be changed by the optional parameter NUM.
1464The size of the log and the order of the entries are vendor specific.
1465The Pending Defects log was introduced in ACS-4 Revision 01 (Mar 2014).
1466.Sp
2127e193 1467.I sataphy[,reset]
cfbba5b9 1468\- [SATA only] prints values and descriptions of the SATA Phy Event
f9e10201 1469Counters (General Purpose Log address 0x11). If \*(Aq\-l sataphy,reset\*(Aq
cfbba5b9 1470is specified, all counters are reset after reading the values.
ee38a438
GI
1471This also works for SATA devices with Packet interface like CD/DVD
1472drives.
f9e10201 1473.Sp
2127e193 1474.I sasphy[,reset]
cfbba5b9 1475\- [SAS (SCSI) only] prints values and descriptions of the SAS (SSP)
f9e10201 1476Protocol Specific log page (log page 0x18). If \*(Aq\-l sasphy,reset\*(Aq
cfbba5b9 1477is specified, all counters are reset after reading the values.
f9e10201 1478.Sp
2127e193 1479.I gplog,ADDR[,FIRST[\-LAST|+SIZE]]
cfbba5b9
GI
1480\- [ATA only] prints a hex dump of any log accessible via General
1481Purpose Logging (GPL) feature. The log address ADDR is the hex address
f9e10201 1482listed in the log directory (see \*(Aq\-l directory\*(Aq above).
cfbba5b9
GI
1483The range of log sectors (pages) can be specified by decimal values
1484FIRST\-LAST or FIRST+SIZE. FIRST defaults to 0, SIZE defaults to 1.
f9e10201
JD
1485LAST can be set to \*(Aqmax\*(Aq to specify the last page of the log.
1486.Sp
2127e193 1487.I smartlog,ADDR[,FIRST[\-LAST|+SIZE]]
cfbba5b9 1488\- [ATA only] prints a hex dump of any log accessible via SMART Read
f9e10201
JD
1489Log command. See \*(Aq\-l gplog,...\*(Aq above for parameter syntax.
1490.Sp
2127e193 1491For example, all these commands:
f9e10201
JD
1492.Vb 3
1493 smartctl \-l gplog,0x80,10\-15 /dev/sda
2127e193 1494 smartctl \-l gplog,0x80,10+6 /dev/sda
f9e10201
JD
1495 smartctl \-l smartlog,0x80,10\-15 /dev/sda
1496.Ve
1497print pages 10\(en15 of log 0x80 (first host vendor specific log).
1498.Sp
1499The hex dump format is compatible with the \*(Aqxxd \-r\*(Aq command.
2127e193 1500This command:
f9e10201
JD
1501.Vb 1
1502 smartctl \-l gplog,0x11 /dev/sda | grep ^0 | xxd \-r >log.bin
1503.Ve
2127e193
GI
1504writes a binary representation of the one sector log 0x11
1505(SATA Phy Event Counters) to file log.bin.
f9e10201
JD
1506.Sp
1507.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 1508.I nvmelog,PAGE,SIZE
ff28b140
TL
1509\- [NVMe only] prints a hex dump of the first SIZE bytes from the NVMe
1510log with identifier PAGE.
a86ec89e
GI
1511PAGE is a hexadecimal number in the range from 0x1 to 0xff.
1512SIZE is a hexadecimal number in the range from 0x4 to 0x4000 (16 KiB).
1513\fBWARNING: Do not specify the identifier of an unknown log page.
1514Reading a log page may have undesirable side effects.\fP
f9e10201
JD
1515.Sp
1516.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
d008864d
GI
1517.I ssd
1518\- [ATA] prints the Solid State Device Statistics log page.
f9e10201
JD
1519This has the same effect as \*(Aq\-l devstat,7\*(Aq, see above.
1520.Sp
d008864d
GI
1521.I ssd
1522\- [SCSI] prints the Solid State Media percentage used endurance
f9e10201 1523indicator. A value of 0 indicates as new condition while 100
d008864d 1524indicates the device is at the end of its lifetime as projected by the
f9e10201
JD
1525manufacturer.
1526The value may reach 255.
832b75ed 1527.TP
f9e10201 1528.B \-v ID,FORMAT[:BYTEORDER][,NAME], \-\-vendorattribute=ID,FORMAT...
ee38a438 1529[ATA only] Sets a vendor-specific raw value print FORMAT, an optional
a23d5117 1530BYTEORDER and an optional NAME for Attribute ID.
bed94269 1531This option may be used multiple times.
f9e10201
JD
1532.Sp
1533The Attribute ID can be in the range 1 to 255.
1534If \*(AqN\*(Aq is specified as ID, the settings for all Attributes are changed.
1535.Sp
a23d5117 1536The optional BYTEORDER consists of 1 to 8 characters from the
f9e10201
JD
1537set \*(Aq012345rvwz\*(Aq.
1538The characters \*(Aq0\*(Aq to \*(Aq5\*(Aq select the byte 0 to 5 from the
153948-bit raw value, \*(Aqr\*(Aq selects the reserved byte of the attribute
1540data block, \*(Aqv\*(Aq selects the normalized value, \*(Aqw\*(Aq selects
1541the worst value and \*(Aqz\*(Aq inserts a zero byte.
1542The default BYTEORDER is \*(Aq543210\*(Aq for all 48-bit formats,
1543\*(Aqr543210\*(Aq for the 54-bit formats, and \*(Aq543210wv\*(Aq for the
154464-bit formats.
1545For example, \*(Aq\-v 5,raw48:012345\*(Aq prints the raw value of
a23d5117
GI
1546attribute 5 with big endian instead of little endian
1547byte ordering.
f9e10201 1548.Sp
d008864d 1549The NAME is a string of letters, digits and underscore. Its length should
f9e10201
JD
1550not exceed 23 characters.
1551The \*(Aq\-P showall\*(Aq option reports an error if this is the case.
1552.Sp
bed94269 1553.I \-v help
832b75ed
GG
1554\- Prints (to STDOUT) a list of all valid arguments to this option,
1555then exits.
f9e10201 1556.Sp
bed94269 1557Valid arguments for FORMAT are:
f9e10201 1558.Sp
bed94269 1559.I raw8
ee38a438 1560\- Print the Raw value as six 8-bit unsigned base-10 integers.
bed94269 1561This may be useful for decoding the meaning of the Raw value.
f9e10201 1562.Sp
bed94269 1563.I raw16
ee38a438 1564\- Print the Raw value as three 16-bit unsigned base-10 integers.
bed94269 1565This may be useful for decoding the meaning of the Raw value.
f9e10201 1566.Sp
bed94269 1567.I raw48
ee38a438 1568\- Print the Raw value as a 48-bit unsigned base-10 integer.
bed94269 1569This is the default for most attributes.
f9e10201 1570.Sp
bed94269
GI
1571.I hex48
1572\- Print the Raw value as a 12 digit hexadecimal number.
1573This may be useful for decoding the meaning of the Raw value.
f9e10201 1574.Sp
e165493d 1575.I raw56
ee38a438
GI
1576\- Print the Raw value as a 54-bit unsigned base-10 integer.
1577This includes the reserved byte which follows the 48-bit raw value.
f9e10201 1578.Sp
e165493d
GI
1579.I hex56
1580\- Print the Raw value as a 14 digit hexadecimal number.
ee38a438 1581This includes the reserved byte which follows the 48-bit raw value.
f9e10201 1582.Sp
bed94269 1583.I raw64
ee38a438 1584\- Print the Raw value as a 64-bit unsigned base-10 integer.
bed94269 1585This includes two bytes from the normalized and worst attribute value.
e165493d 1586This raw format is used by some SSD devices with Indilinx controller.
f9e10201 1587.Sp
bed94269
GI
1588.I hex64
1589\- Print the Raw value as a 16 digit hexadecimal number.
1590This includes two bytes from the normalized and worst attribute value.
e165493d 1591This raw format is used by some SSD devices with Indilinx controller.
f9e10201 1592.Sp
bed94269 1593.I min2hour
ee38a438 1594\- Raw Attribute is power-on time in minutes. Its raw value
832b75ed 1595will be displayed in the form "Xh+Ym". Here X is hours, and Y is
f9e10201 1596minutes in the range 0\(en59 inclusive. Y is always printed with two
832b75ed 1597digits, for example "06" or "31" or "00".
f9e10201 1598.Sp
bed94269 1599.I sec2hour
ee38a438 1600\- Raw Attribute is power-on time in seconds. Its raw value
832b75ed 1601will be displayed in the form "Xh+Ym+Zs". Here X is hours, Y is
f9e10201
JD
1602minutes in the range 0\(en59 inclusive, and Z is seconds in the range
16030\(en59 inclusive. Y and Z are always printed with two digits, for
832b75ed 1604example "06" or "31" or "00".
f9e10201 1605.Sp
bed94269 1606.I halfmin2hour
ee38a438 1607\- Raw Attribute is power-on time, measured in units of 30
832b75ed
GG
1608seconds. This format is used by some Samsung disks. Its raw value
1609will be displayed in the form "Xh+Ym". Here X is hours, and Y is
f9e10201 1610minutes in the range 0\(en59 inclusive. Y is always printed with two
832b75ed 1611digits, for example "06" or "31" or "00".
f9e10201 1612.Sp
cfbba5b9 1613.I msec24hour32
ee38a438 1614\- Raw Attribute is power-on time measured in 32-bit hours and 24-bit
cfbba5b9
GI
1615milliseconds since last hour update. It will be displayed in the form
1616"Xh+Ym+Z.Ms". Here X is hours, Y is minutes, Z is seconds and M is
1617milliseconds.
f9e10201 1618.Sp
bed94269
GI
1619.I tempminmax
1620\- Raw Attribute is the disk temperature in Celsius. Info about
cfbba5b9
GI
1621Min/Max temperature is printed if available. This is the default
1622for Attributes 190 and 194. The recording interval (lifetime,
1623last power cycle, last soft reset) of the min/max values is device
1624specific.
f9e10201 1625.Sp
bed94269
GI
1626.I temp10x
1627\- Raw Attribute is ten times the disk temperature in Celsius.
f9e10201 1628.Sp
bed94269 1629.I raw16(raw16)
ee38a438
GI
1630\- Print the raw attribute as a 16-bit value and two optional
163116-bit values if these words are nonzero. This is the default
bed94269 1632for Attributes 5 and 196.
f9e10201 1633.Sp
bed94269
GI
1634.I raw16(avg16)
1635\- Raw attribute is spin-up time. It is printed as a 16-bit value
1636and an optional "Average" 16-bit value if the word is nonzero.
1637This is the default for Attribute 3.
f9e10201 1638.Sp
e165493d 1639.I raw24(raw8)
ee38a438
GI
1640\- Print the raw attribute as a 24-bit value and three optional
16418-bit values if these bytes are nonzero. This is the default
e165493d 1642for Attribute 9.
f9e10201 1643.Sp
bed94269 1644.I raw24/raw24
f9e10201 1645\- Raw Attribute contains two 24-bit values. The first is the
832b75ed
GG
1646number of load cycles. The second is the number of unload cycles.
1647The difference between these two values is the number of times that
1648the drive was unexpectedly powered off (also called an emergency
f9e10201 1649unload). As a rule of thumb, the mechanical stress created by one
832b75ed
GG
1650emergency unload is equivalent to that created by one hundred normal
1651unloads.
f9e10201 1652.Sp
cfbba5b9 1653.I raw24/raw32
ee38a438
GI
1654\- Raw attribute is an error rate which consists of a 24-bit error
1655count and a 32-bit total count.
f9e10201
JD
1656.Sp
1657The following old arguments to \*(Aq\-v\*(Aq are also still valid:
1658.Sp
bed94269
GI
1659.I 9,minutes
1660\- same as:
1661.I 9,min2hour,Power_On_Minutes.
f9e10201 1662.Sp
bed94269
GI
1663.I 9,seconds
1664\- same as:
1665.I 9,sec2hour,Power_On_Seconds.
f9e10201 1666.Sp
bed94269
GI
1667.I 9,halfminutes
1668\- same as:
1669.I 9,halfmin2hour,Power_On_Half_Minutes.
f9e10201 1670.Sp
bed94269
GI
1671.I 9,temp
1672\- same as:
1673.I 9,tempminmax,Temperature_Celsius.
f9e10201 1674.Sp
bed94269
GI
1675.I 192,emergencyretractcyclect
1676\- same as:
1677.I 192,raw48,Emerg_Retract_Cycle_Ct
f9e10201 1678.Sp
bed94269
GI
1679.I 193,loadunload
1680\- same as:
1681.I 193,raw24/raw24.
f9e10201 1682.Sp
832b75ed 1683.I 194,10xCelsius
bed94269
GI
1684\- same as:
1685.I 194,temp10x,Temperature_Celsius_x10.
f9e10201 1686.Sp
832b75ed 1687.I 194,unknown
bed94269
GI
1688\- same as:
1689.I 194,raw48,Unknown_Attribute.
f9e10201 1690.Sp
2127e193 1691.I 197,increasing
bed94269
GI
1692\- same as:
1693.I 197,raw48,Total_Pending_Sectors.
1694Also means that Attribute number 197 (Current Pending Sector Count)
1695is not reset if uncorrectable sectors are reallocated
1696(see \fBsmartd.conf\fP(5) man page).
f9e10201 1697.Sp
2127e193 1698.I 198,increasing
bed94269
GI
1699\- same as:
1700.I 198,raw48,Total_Offl_Uncorrectabl.
1701Also means that Attribute number 198 (Offline Uncorrectable Sector Count)
1702is not reset if uncorrectable sectors are reallocated
1703(see \fBsmartd.conf\fP(5) man page).
f9e10201 1704.Sp
832b75ed 1705.I 198,offlinescanuncsectorct
bed94269
GI
1706\- same as:
1707.I 198,raw48,Offline_Scan_UNC_SectCt.
f9e10201 1708.Sp
832b75ed 1709.I 200,writeerrorcount
bed94269
GI
1710\- same as:
1711.I 200,raw48,Write_Error_Count.
f9e10201 1712.Sp
832b75ed 1713.I 201,detectedtacount
bed94269
GI
1714\- same as:
1715.I 201,raw48,Detected_TA_Count.
f9e10201 1716.Sp
832b75ed 1717.I 220,temp
bed94269 1718\- same as:
ee38a438 1719.I 220,tempminmax,Temperature_Celsius.
832b75ed
GG
1720.TP
1721.B \-F TYPE, \-\-firmwarebug=TYPE
2127e193 1722[ATA only] Modifies the behavior of \fBsmartctl\fP to compensate for some
ee38a438
GI
1723known and understood device firmware or driver bug. This option may be used
1724multiple times. The valid arguments are:
f9e10201 1725.Sp
832b75ed
GG
1726.I none
1727\- Assume that the device firmware obeys the ATA specifications. This
f9e10201 1728is the default, unless the device has presets for \*(Aq\-F\*(Aq in the
d2e702cf 1729drive database. Using this option on the command line will override any
ee38a438 1730preset values.
f9e10201 1731.Sp
ee38a438
GI
1732.I nologdir
1733\- Suppresses read attempts of SMART or GP Log Directory.
1734Support for all standard logs is assumed without an actual check.
1735Some Intel SSDs may freeze if log address 0 is read.
f9e10201 1736.Sp
832b75ed
GG
1737.I samsung
1738\- In some Samsung disks (example: model SV4012H Firmware Version:
ee38a438
GI
1739RM100-08) some of the two- and four-byte quantities in the SMART data
1740structures are byte-swapped (relative to the ATA specification).
832b75ed 1741Enabling this option tells \fBsmartctl\fP to evaluate these quantities
ee38a438
GI
1742in byte-reversed order. Some signs that your disk needs this option
1743are (1) no self-test log printed, even though you have run self-tests;
832b75ed
GG
1744(2) very large numbers of ATA errors reported in the ATA error log;
1745(3) strange and impossible values for the ATA error log timestamps.
f9e10201 1746.Sp
832b75ed 1747.I samsung2
e9583e0c
GI
1748\- In some Samsung disks the number of ATA errors reported is byte swapped.
1749Enabling this option tells \fBsmartctl\fP to evaluate this quantity in
f9e10201 1750byte-reversed order. An indication that your Samsung disk needs this
ee38a438 1751option is that the self-test log is printed correctly, but there are a
832b75ed
GG
1752very large number of errors in the SMART error log. This is because
1753the error count is byte swapped. Thus a disk with five errors
1754(0x0005) will appear to have 20480 errors (0x5000).
f9e10201 1755.Sp
a37e7145 1756.I samsung3
ee38a438
GI
1757\- Some Samsung disks (at least SP2514N with Firmware VF100-37) report
1758a self-test still in progress with 0% remaining when the test was already
f9e10201
JD
1759completed. Enabling this option modifies the output of the self-test
1760execution status (see options \*(Aq\-c\*(Aq or \*(Aq\-a\*(Aq above)
1761accordingly.
1762.Sp
ee38a438
GI
1763.I xerrorlba
1764\- Fixes LBA byte ordering in Extended Comprehensive SMART error log.
d2e702cf 1765Some disks use little endian byte ordering instead of ATA register
ff28b140 1766ordering to specify the LBA addresses in the log entries.
f9e10201 1767.Sp
a37e7145
GG
1768.I swapid
1769\- Fixes byte swapped ATA identify strings (device name, serial number,
1770firmware version) returned by some buggy device drivers.
832b75ed
GG
1771.TP
1772.B \-P TYPE, \-\-presets=TYPE
2127e193 1773[ATA only] Specifies whether \fBsmartctl\fP should use any preset options
f9e10201 1774that are available for this drive. By default, if the drive is recognized
832b75ed 1775in the \fBsmartmontools\fP database, then the presets are used.
f9e10201 1776.Sp
832b75ed
GG
1777The argument
1778.I show
1779will show any preset options for your drive and the argument
1780.I showall
1781will show all known drives in the \fBsmartmontools\fP database, along
1782with their preset options. If there are no presets for your drive and
1783you think there should be (for example, a \-v or \-F option is needed
1784to get \fBsmartctl\fP to display correct values) then please contact
1785the \fBsmartmontools\fP developers so that this information can be
1786added to the \fBsmartmontools\fP database. Contact information is at the
1787end of this man page.
f9e10201 1788.Sp
832b75ed 1789The valid arguments to this option are:
f9e10201 1790.Sp
832b75ed
GG
1791.I use
1792\- if a drive is recognized, then use the stored presets for it. This
f9e10201
JD
1793is the default. Note that presets will NOT override additional
1794Attribute interpretation (\*(Aq\-v N,something\*(Aq) command-line options or
1795explicit \*(Aq\-F\*(Aq command-line options..
1796.Sp
832b75ed
GG
1797.I ignore
1798\- do not use presets.
f9e10201 1799.Sp
832b75ed
GG
1800.I show
1801\- show if the drive is recognized in the database, and if so, its
1802presets, then exit.
f9e10201 1803.Sp
832b75ed
GG
1804.I showall
1805\- list all recognized drives, and the presets that are set for them,
d008864d
GI
1806then exit. This also checks the drive database regular expressions
1807and settings for syntax errors.
f9e10201
JD
1808.Sp
1809The \*(Aq\-P showall\*(Aq option takes up to two optional arguments to
1810match a specific drive type and firmware version.
1811The command:
1812.Vb 1
832b75ed 1813 smartctl \-P showall
f9e10201 1814.Ve
832b75ed 1815lists all entries, the command:
f9e10201
JD
1816.Vb 1
1817 smartctl \-P showall \*(AqMODEL\*(Aq
1818.Ve
832b75ed 1819lists all entries matching MODEL, and the command:
f9e10201
JD
1820.Vb 1
1821 smartctl \-P showall \*(AqMODEL\*(Aq \*(AqFIRMWARE\*(Aq
1822.Ve
832b75ed 1823lists all entries for this MODEL and a specific FIRMWARE version.
2127e193
GI
1824.TP
1825.B \-B [+]FILE, \-\-drivedb=[+]FILE
cfbba5b9 1826[ATA only] Read the drive database from FILE. The new database replaces
f9e10201 1827the built in database by default. If \*(Aq+\*(Aq is specified, then the new
cfbba5b9 1828entries prepend the built in entries.
f9e10201 1829.Sp
d008864d
GI
1830Optional entries are read from the file
1831.\" %IF NOT OS Windows
1832\fB/usr/local/etc/smart_drivedb.h\fP
1833.\" %ENDIF NOT OS Windows
1834.\" %IF OS ALL
f9e10201 1835(Windows: \fBEXEDIR/drivedb-add.h\fP)
d008864d
GI
1836.\" %ENDIF OS ALL
1837.\" %IF OS Windows
1838.\"! \fBEXEDIR/drivedb-add.h\fP.
1839.\" %ENDIF OS Windows
1840.\" %IF ENABLE_DRIVEDB
1841if this option is not specified.
f9e10201 1842.Sp
d008864d
GI
1843If
1844.\" %IF NOT OS Windows
1845\fB/usr/local/share/smartmontools/drivedb.h\fP
1846.\" %ENDIF NOT OS Windows
1847.\" %IF OS ALL
1848(Windows: \fBEXEDIR/drivedb.h\fP)
1849.\" %ENDIF OS ALL
1850.\" %IF OS Windows
1851.\"! \fBEXEDIR/drivedb.h\fP
1852.\" %ENDIF OS Windows
1853is present, the contents of this file is used instead of the built in table.
a86ec89e 1854.\" %IF ENABLE_UPDATE_SMART_DRIVEDB
f9e10201 1855.Sp
d008864d
GI
1856Run
1857.\" %IF NOT OS Windows
1858\fB/usr/local/sbin/update-smart-drivedb\fP
1859.\" %ENDIF NOT OS Windows
1860.\" %IF OS ALL
1861(Windows: \fBEXEDIR/update-smart-drivedb.exe\fP)
1862.\" %ENDIF OS ALL
1863.\" %IF OS Windows
1864.\"! \fBEXEDIR/update-smart-drivedb.exe\fP
1865.\" %ENDIF OS Windows
1866to update this file from the smartmontools SVN repository.
a86ec89e 1867.\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB
d008864d 1868.\" %ENDIF ENABLE_DRIVEDB
f9e10201 1869.Sp
2127e193 1870The database files use the same C/C++ syntax that is used to initialize
f9e10201
JD
1871the built in database array.
1872C/C++ style comments are allowed.
2127e193 1873Example:
f9e10201
JD
1874.Sp
1875.Vb 8
2127e193
GI
1876 /* Full entry: */
1877 {
1878 "Model family", // Info about model family/series.
1879 "MODEL1.*REGEX", // Regular expression to match model of device.
1880 "VERSION.*REGEX", // Regular expression to match firmware version(s).
1881 "Some warning", // Warning message.
1882 "\-v 9,minutes" // String of preset \-v and \-F options.
1883 },
1884 /* Minimal entry: */
1885 {
1886 "", // No model family/series info.
1887 "MODEL2.*REGEX", // Regular expression to match model of device.
1888 "", // All firmware versions.
1889 "", // No warning.
1890 "" // No options preset.
1891 },
e9583e0c
GI
1892 /* USB ID entry: */
1893 {
1894 "USB: Device; Bridge", // Info about USB device and bridge name.
1895 "0x1234:0xabcd", // Regular expression to match vendor:product ID.
1896 "0x0101", // Regular expression to match bcdDevice.
1897 "", // Not used.
1898 "\-d sat" // String with device type option.
1899 },
2127e193 1900 /* ... */
f9e10201
JD
1901.Ve
1902.Sp
832b75ed 1903.TP
ee38a438 1904.B SMART RUN/ABORT OFFLINE TEST AND self-test OPTIONS:
832b75ed
GG
1905.TP
1906.B \-t TEST, \-\-test=TEST
f9e10201 1907Executes TEST immediately. The \*(Aq\-C\*(Aq option can be used in
832b75ed 1908conjunction with this option to run the short or long (and also for
ee38a438 1909ATA devices, selective or conveyance) self-tests in captive mode
832b75ed
GG
1910(known as "foreground mode" for SCSI devices). Note that only one
1911test type can be run at a time, so only one test type should be
1912specified per command line. Note also that if a computer is shutdown
ee38a438
GI
1913or power cycled during a self-test, no harm should result. The
1914self-test will either be aborted or will resume automatically.
f9e10201
JD
1915.Sp
1916All \*(Aq\-t TEST\*(Aq commands can be given during normal system operation
1917unless captive mode (\*(Aq\-C\*(Aq option) is used.
ee38a438
GI
1918A running self-test can, however, degrade performance of the drive.
1919Frequent I/O requests from the operating system increase the duration
1920of a test. These impacts may vary from device to device.
f9e10201 1921.Sp
ee38a438
GI
1922If a test failure occurs then the device may discontinue the testing
1923and report the result immediately.
f9e10201
JD
1924.Sp
1925[ATA]
1926Note that the ATA command SMART EXECUTE OFF-LINE IMMEDIATE (the command to
1927start a test) was declared obsolete in ATA ACS-4 Revision 10 (Nov 2015).
1928.Sp
ee38a438 1929The valid arguments to this option are:
f9e10201 1930.Sp
832b75ed 1931.I offline
e9583e0c 1932\- [ATA] runs SMART Immediate Offline Test. This immediately
832b75ed
GG
1933starts the test described above. This command can be given during
1934normal system operation. The effects of this test are visible only in
1935that it updates the SMART Attribute values, and if errors are
f9e10201
JD
1936found they will appear in the SMART error log, visible with the
1937\*(Aq\-l error\*(Aq option.
1938.Sp
1939If the \*(Aq\-c\*(Aq option to \fBsmartctl\fP shows that the device has the
832b75ed 1940"Suspend Offline collection upon new command" capability then you can
f9e10201
JD
1941track the progress of the Immediate Offline test using the \*(Aq\-c\*(Aq
1942option to \fBsmartctl\fP. If the \*(Aq\-c\*(Aq option show that the device
832b75ed
GG
1943has the "Abort Offline collection upon new command" capability then
1944most commands will abort the Immediate Offline Test, so you should not
f9e10201 1945try to track the progress of the test with \*(Aq\-c\*(Aq, as it will abort
832b75ed 1946the test.
f9e10201 1947.Sp
e9583e0c 1948.I offline
f9e10201
JD
1949\- [SCSI] runs the default self test in foreground.
1950No entry is placed in the self test log.
1951.Sp
832b75ed 1952.I short
e9583e0c 1953\- [ATA] runs SMART Short Self Test (usually under ten minutes).
832b75ed 1954This command can be given during normal system operation (unless run in
f9e10201 1955captive mode \- see the \*(Aq\-C\*(Aq option below). This is a
832b75ed
GG
1956test in a different category than the immediate or automatic offline
1957tests. The "Self" tests check the electrical and mechanical
1958performance as well as the read performance of the disk. Their
1959results are reported in the Self Test Error Log, readable with
f9e10201
JD
1960the \*(Aq\-l selftest\*(Aq option. Note that on some disks the progress of
1961the self-test can be monitored by watching this log during the self-test;
1962with other disks use the \*(Aq\-c\*(Aq option to monitor progress.
1963.Sp
e9583e0c 1964.I short
ee38a438 1965\- [SCSI] runs the "Background short" self-test.
f9e10201 1966.Sp
832b75ed 1967.I long
f9e10201
JD
1968\- [ATA] runs SMART Extended Self Test (tens of minutes to several hours).
1969This is a longer and more thorough version of the Short Self Test described
832b75ed 1970above. Note that this command can be given during normal
f9e10201
JD
1971system operation (unless run in captive mode \- see the \*(Aq\-C\*(Aq option
1972below).
1973.Sp
e9583e0c 1974.I long
ee38a438 1975\- [SCSI] runs the "Background long" self-test.
f9e10201 1976.Sp
832b75ed 1977.I conveyance
2127e193 1978\- [ATA only] runs a SMART Conveyance Self Test (minutes). This
ee38a438 1979self-test routine is intended to identify damage incurred during
f9e10201 1980transporting of the device. This self-test routine should take on the
832b75ed
GG
1981order of minutes to complete. Note that this command can be given
1982during normal system operation (unless run in captive mode \- see the
f9e10201
JD
1983\*(Aq\-C\*(Aq option below).
1984.Sp
a37e7145 1985.I select,N\-M, select,N+SIZE
2127e193
GI
1986\- [ATA only] runs a SMART Selective Self Test, to test a \fBrange\fP
1987of disk Logical Block Addresses (LBAs), rather than the entire disk.
1988Each range of LBAs that is checked is called a "span" and is specified
1989by a starting LBA (N) and an ending LBA (M) with N less than or equal
f9e10201
JD
1990to M.
1991The range can also be specified as N+SIZE.
1992A span at the end of a disk can be specified by N\-\fBmax\fP.
1993.Sp
a37e7145 1994For example the commands:
f9e10201 1995.Vb 2
a86ec89e
GI
1996 smartctl \-t select,10\-20 /dev/sda
1997 smartctl \-t select,10+11 /dev/sda
f9e10201 1998.Ve
a37e7145 1999both runs a self test on one span consisting of LBAs ten to twenty
f9e10201
JD
2000(inclusive).
2001The command:
2002.Vb 1
a86ec89e 2003 smartctl \-t select,100000000\-max /dev/sda
f9e10201 2004.Ve
a37e7145 2005run a self test from LBA 100000000 up to the end of the disk.
f9e10201 2006The \*(Aq\-t\*(Aq option can be given up to five times, to test
832b75ed 2007up to five spans. For example the command:
f9e10201 2008.Vb 1
a86ec89e 2009 smartctl \-t select,0\-100 \-t select,1000\-2000 /dev/sda
f9e10201 2010.Ve
832b75ed
GG
2011runs a self test on two spans. The first span consists of 101 LBAs
2012and the second span consists of 1001 LBAs. Note that the spans can
2013overlap partially or completely, for example:
f9e10201 2014.Vb 1
a86ec89e 2015 smartctl \-t select,0\-10 \-t select,5\-15 \-t select,10\-20 /dev/sda
f9e10201 2016.Ve
ee38a438
GI
2017The results of the selective self-test can be obtained (both during
2018and after the test) by printing the SMART self-test log, using the
f9e10201
JD
2019\*(Aq\-l selftest\*(Aq option to smartctl.
2020.Sp
832b75ed
GG
2021Selective self tests are particularly useful as disk capacities
2022increase: an extended self test (smartctl \-t long) can take several
ee38a438
GI
2023hours. Selective self-tests are helpful if (based on SYSLOG error
2024messages, previous failed self-tests, or SMART error log entries) you
832b75ed
GG
2025suspect that a disk is having problems at a particular range of
2026Logical Block Addresses (LBAs).
f9e10201 2027.Sp
ee38a438 2028Selective self-tests can be run during normal system operation (unless
f9e10201
JD
2029done in captive mode \- see the \*(Aq\-C\*(Aq option below).
2030.Sp
ee38a438 2031The following variants of the selective self-test command use spans based
a37e7145 2032on the ranges from past tests already stored on the disk:
f9e10201 2033.Sp
a37e7145 2034.I select,redo[+SIZE]
2127e193 2035\- [ATA only] redo the last SMART Selective Self Test using the same LBA
f9e10201
JD
2036range.
2037The starting LBA is identical to the LBA used by last test, same for ending
2038LBA unless a new span size is specified by optional +SIZE argument.
2039.Sp
a37e7145 2040For example the commands:
f9e10201 2041.Vb 3
a86ec89e
GI
2042 smartctl \-t select,10\-20 /dev/sda
2043 smartctl \-t select,redo /dev/sda
2044 smartctl \-t select,redo+20 /dev/sda
f9e10201 2045.Ve
a37e7145 2046have the same effect as:
f9e10201 2047.Vb 3
a86ec89e
GI
2048 smartctl \-t select,10\-20 /dev/sda
2049 smartctl \-t select,10\-20 /dev/sda
2050 smartctl \-t select,10\-29 /dev/sda
f9e10201
JD
2051.Ve
2052.Sp
a37e7145 2053.I select,next[+SIZE]
2127e193 2054\- [ATA only] runs a SMART Selective Self Test on the LBA range which
f9e10201
JD
2055follows the range of the last test.
2056The starting LBA is set to (ending LBA +1) of the last test.
2057A new span size may be specified by the optional +SIZE argument.
2058.Sp
a37e7145 2059For example the commands:
f9e10201 2060.Vb 3
a86ec89e
GI
2061 smartctl \-t select,0\-999 /dev/sda
2062 smartctl \-t select,next /dev/sda
2063 smartctl \-t select,next+2000 /dev/sda
f9e10201 2064.Ve
a37e7145 2065have the same effect as:
f9e10201 2066.Vb 3
a86ec89e
GI
2067 smartctl \-t select,0\-999 /dev/sda
2068 smartctl \-t select,1000\-1999 /dev/sda
2069 smartctl \-t select,2000\-3999 /dev/sda
f9e10201
JD
2070.Ve
2071.Sp
a37e7145 2072If the last test ended at the last LBA of the disk, the new range starts
f9e10201 2073at LBA 0. The span size of the last span of a disk is adjusted such that
a37e7145 2074the total number of spans to check the full disk will not be changed
f9e10201
JD
2075by future uses of \*(Aq\-t select,next\*(Aq.
2076.Sp
a37e7145 2077.I select,cont[+SIZE]
f9e10201
JD
2078\- [ATA only] performs a \*(Aqredo\*(Aq (above) if the self test status
2079reports that the last test was aborted by the host.
2080Otherwise it run the \*(Aqnext\*(Aq (above) test.
2081.Sp
832b75ed 2082.I afterselect,on
ee38a438 2083\- [ATA only] perform an offline read scan after a Selective self-test
f9e10201
JD
2084has completed. This option must be used together with one or more of
2085the \fIselect,N\-M\fP options above. If the LBAs that have been
ee38a438 2086specified in the Selective self-test pass the test with no errors
832b75ed 2087found, then read scan the \fBremainder\fP of the disk. If the device
ee38a438 2088is powered-cycled while this read scan is in progress, the read scan
832b75ed
GG
2089will be automatically resumed after a time specified by the pending
2090timer (see below). The value of this option is preserved between
ee38a438 2091selective self-tests.
f9e10201 2092.Sp
832b75ed 2093.I afterselect,off
2127e193 2094\- [ATA only] do not read scan the remainder of the disk after a
ee38a438 2095Selective self-test has completed. This option must be use together
832b75ed 2096with one or more of the \fIselect,N\-M\fP options above. The value of this
ee38a438 2097option is preserved between selective self-tests.
f9e10201
JD
2098.Sp
2099.I pending,N
2127e193 2100\- [ATA only] set the pending offline read scan timer to N minutes.
832b75ed 2101Here N is an integer in the range from 0 to 65535 inclusive. If the
ee38a438
GI
2102device is powered off during a read scan after a Selective self-test,
2103then resume the test automatically N minutes after power-up. This
832b75ed 2104option must be use together with one or more of the \fIselect,N\-M\fP
f9e10201
JD
2105options above.
2106The value of this option is preserved between selective self-tests.
2107.Sp
cfbba5b9
GI
2108.I vendor,N
2109\- [ATA only] issues the ATA command SMART EXECUTE OFF-LINE IMMEDIATE
f9e10201
JD
2110with subcommand N in LBA LOW register. The subcommand is specified as
2111a hex value in the range 0x00 to 0xff. Subcommands 0x40\(en0x7e and
21120x90\(en0xff are reserved for vendor specific use, see table 61 of
a7e8ffec 2113T13/1699-D Revision 6a (ATA8-ACS). Note that the subcommands
f9e10201
JD
21140x00\(en0x04, 0x7f, 0x81\(en0x84 are supported by other smartctl options
2115(e.g.\& 0x01: \*(Aq\-t short\*(Aq, 0x7f: \*(Aq\-X\*(Aq, 0x82:
2116\*(Aq\-C \-t long\*(Aq).
2117.Sp
cfbba5b9
GI
2118\fBWARNING: Only run subcommands documented by the vendor of the
2119device.\fP
f9e10201 2120.Sp
d2e702cf 2121Example for some Intel SSDs only:
f9e10201 2122The subcommand 0x40 (\*(Aq\-t vendor,0x40\*(Aq) clears the timed workload
a7e8ffec
GI
2123related SMART attributes (226, 227, 228). Note that the raw values of
2124these attributes are held at 65535 (0xffff) until the workload timer
2125reaches 60 minutes.
f9e10201 2126.Sp
d008864d 2127.I force
ee38a438
GI
2128\- start new self-test even if another test is already running.
2129By default a running self-test will not be interrupted to begin another
d008864d 2130test.
832b75ed
GG
2131.TP
2132.B \-C, \-\-captive
f9e10201
JD
2133[ATA] Runs self-tests in captive mode. This has no effect with \*(Aq\-t
2134offline\*(Aq or if the \*(Aq\-t\*(Aq option is not used.
2135.Sp
832b75ed
GG
2136\fBWARNING: Tests run in captive mode may busy out the drive for the
2137length of the test. Only run captive tests on drives without any
2138mounted partitions!\fP
f9e10201 2139.Sp
ee38a438 2140[SCSI] Runs the self-test in "Foreground" mode.
832b75ed
GG
2141.TP
2142.B \-X, \-\-abort
ee38a438 2143Aborts non-captive SMART Self Tests. Note that this
832b75ed
GG
2144command will abort the Offline Immediate Test routine only if your
2145disk has the "Abort Offline collection upon new command" capability.
f9e10201 2146.Sp
2127e193
GI
2147.SH ATA, SCSI command sets and SAT
2148In the past there has been a clear distinction between storage devices
f9e10201
JD
2149that used the ATA and SCSI command sets. This distinction was often
2150reflected in their device naming and hardware. Now various SCSI
2151transports (e.g.\& SAS, FC and iSCSI) can interconnect to both SCSI
2152disks (e.g.\& FC and SAS) and ATA disks (especially SATA). USB and
2127e193 2153IEEE 1394 storage devices use the SCSI command set externally but
f9e10201 2154almost always contain ATA or SATA disks (or flash). The storage
2127e193
GI
2155subsystems in some operating systems have started to remove the
2156distinction between ATA and SCSI in their device naming policies.
2157.PP
215899% of operations that an OS performs on a disk involve the SCSI INQUIRY,
f9e10201 2159READ CAPACITY, READ and WRITE commands, or their ATA equivalents. Since
2127e193
GI
2160the SCSI commands are slightly more general than their ATA equivalents,
2161many OSes are generating SCSI commands (mainly READ and WRITE) and
2162letting a lower level translate them to their ATA equivalents as the
f9e10201 2163need arises. An important note here is that "lower level" may be in
2127e193
GI
2164external equipment and hence outside the control of an OS.
2165.PP
2166SCSI to ATA Translation (SAT) is a standard (ANSI INCITS 431-2007) that
f9e10201
JD
2167specifies how this translation is done. For the other 1% of operations
2168that an OS performs on a disk, SAT provides two options. First is an
2169optional ATA PASS-THROUGH SCSI command (there are two variants).
2170The second is a translation from the closest SCSI command.
2171Most current interest is in the "pass-through" option.
2127e193
GI
2172.PP
2173The relevance to smartmontools (and hence smartctl) is that its
f9e10201 2174interactions with disks fall solidly into the "1%" category. So even
2127e193
GI
2175if the OS can happily treat (and name) a disk as "SCSI", smartmontools
2176needs to detect the native command set and act accordingly.
2177As more storage manufacturers (including external SATA drives) comply
2178with SAT, smartmontools is able to automatically distinguish the native
f9e10201
JD
2179command set of the device.
2180In some cases the \*(Aq\-d sat\*(Aq option is needed on the command line.
2127e193
GI
2181.PP
2182There are also virtual disks which typically have no useful information
f9e10201
JD
2183to convey to smartmontools, but could conceivably in the future. An
2184example of a virtual disk is the OS's view of a RAID 1 box. There are
2185most likely two SATA disks inside a RAID 1 box. Addressing those SATA
2186disks from a distant OS is a challenge for smartmontools. Another
2127e193
GI
2187approach is running a tool like smartmontools inside the RAID 1 box (e.g.
2188a Network Attached Storage (NAS) box) and fetching the logs via a
f9e10201
JD
2189browser.
2190.Sp
832b75ed 2191.SH EXAMPLES
a86ec89e 2192.B smartctl \-a /dev/sda
f9e10201
JD
2193.br
2194Print a large amount of SMART information for drive /dev/sda.
2127e193 2195.PP
a86ec89e 2196.B smartctl \-s off /dev/sdd
f9e10201
JD
2197.br
2198Disable SMART monitoring and data log collection on drive /dev/sdd.
832b75ed 2199.PP
a86ec89e 2200.B smartctl \-\-smart=on \-\-offlineauto=on \-\-saveauto=on /dev/sda
f9e10201 2201.br
a86ec89e 2202Enable SMART on drive /dev/sda, enable automatic offline
832b75ed 2203testing every four hours, and enable autosaving of
f9e10201 2204SMART Attributes. This is a good start-up line for your system's
832b75ed
GG
2205init files. You can issue this command on a running system.
2206.PP
a86ec89e 2207.B smartctl \-t long /dev/sdc
f9e10201 2208.br
a86ec89e 2209Begin an extended self-test of drive /dev/sdc. You can issue this
ee38a438 2210command on a running system. The results can be seen in the self-test
f9e10201 2211log visible with the \*(Aq\-l selftest\*(Aq option after it has completed.
832b75ed 2212.PP
a86ec89e 2213.B smartctl \-s on \-t offline /dev/sda
f9e10201 2214.br
832b75ed 2215Enable SMART on the disk, and begin an immediate offline test of
a86ec89e 2216drive /dev/sda. You can issue this command on a running system. The
832b75ed 2217results are only used to update the SMART Attributes, visible
f9e10201
JD
2218with the \*(Aq\-A\*(Aq option. If any device errors occur, they are logged to
2219the SMART error log, which can be seen with the \*(Aq\-l error\*(Aq option.
832b75ed 2220.PP
a86ec89e 2221.B smartctl \-A \-v 9,minutes /dev/sda
f9e10201 2222.br
ee38a438 2223Shows the vendor Attributes, when the disk stores its power-on time
832b75ed
GG
2224internally in minutes rather than hours.
2225.PP
a86ec89e 2226.B smartctl \-q errorsonly \-H \-l selftest /dev/sda
f9e10201 2227.br
832b75ed 2228Produces output only if the device returns failing SMART status,
ee38a438 2229or if some of the logged self-tests ended with errors.
832b75ed 2230.PP
a86ec89e 2231.B smartctl \-q silent \-a /dev/sda
f9e10201 2232.br
a86ec89e 2233Examine all SMART data for device /dev/sda, but produce no
832b75ed
GG
2234printed output. You must use the exit status (the
2235.B $?
2236shell variable) to learn if any Attributes are out of bound, if the
2237SMART status is failing, if there are errors recorded in the
ee38a438 2238self-test log, or if there are errors recorded in the disk error log.
832b75ed 2239.PP
cfbba5b9 2240.B smartctl \-a \-d 3ware,0 /dev/twl0
f9e10201 2241.br
cfbba5b9
GI
2242Examine all SMART data for the first SATA (not SAS) disk connected to a
22433ware RAID 9750 controller card.
832b75ed 2244.PP
2127e193 2245.B smartctl \-t long \-d areca,4 /dev/sg2
f9e10201 2246.br
ee38a438 2247Start a long self-test on the fourth SATA disk connected to an Areca RAID
2127e193
GI
2248controller addressed by /dev/sg2.
2249.PP
2127e193 2250.B smartctl \-a \-d hpt,1/3 /dev/sda (under Linux)
f9e10201 2251.br
2127e193 2252.B smartctl \-a \-d hpt,1/3 /dev/hptrr (under FreeBSD)
f9e10201
JD
2253.br
2254Examine all SMART data for the (S)ATA disk directly connected to the third
2255channel of the first HighPoint RocketRAID controller card.
4d59bff9 2256.PP
2127e193 2257.B smartctl \-t short \-d hpt,1/1/2 /dev/sda (under Linux)
f9e10201 2258.br
2127e193 2259.B smartctl \-t short \-d hpt,1/1/2 /dev/hptrr (under FreeBSD)
f9e10201 2260.br
ee38a438 2261Start a short self-test on the (S)ATA disk connected to second pmport on the
4d59bff9
GG
2262first channel of the first HighPoint RocketRAID controller card.
2263.PP
a86ec89e 2264.B smartctl \-t select,10\-100 \-t select,30\-300 \-t afterselect,on \-t pending,45 /dev/sda
f9e10201 2265.br
ee38a438 2266Run a selective self-test on LBAs 10 to 100 and 30 to 300. After the
f9e10201
JD
2267these LBAs have been tested, read-scan the remainder of the disk.
2268If the disk is power-cycled during the read-scan, resume the scan 45 minutes
2269after power to the device is restored.
832b75ed 2270.PP
ba59cff1 2271.B smartctl \-a \-d cciss,0 /dev/cciss/c0d0
f9e10201 2272.br
ba59cff1
GG
2273Examine all SMART data for the first SCSI disk connected to a cciss
2274RAID controller card.
f9e10201 2275.Sp
a86ec89e
GI
2276.SH EXIT STATUS
2277The exit statuses of \fBsmartctl\fP are defined by a bitmask.
2278If all is well with the disk, the exit status (return value) of
832b75ed 2279\fBsmartctl\fP is 0 (all bits turned off). If a problem occurs, or an
ee38a438 2280error, potential error, or fault is detected, then a non-zero status
a86ec89e
GI
2281is returned. In this case, the eight different bits in the exit status
2282have the following meanings for ATA disks; some of these values
832b75ed
GG
2283may also be returned for SCSI disks.
2284.TP
2285.B Bit 0:
2286Command line did not parse.
2287.TP
2288.B Bit 1:
cfbba5b9 2289Device open failed, device did not return an IDENTIFY DEVICE structure,
f9e10201 2290or device is in a low-power mode (see \*(Aq\-n\*(Aq option above).
832b75ed
GG
2291.TP
2292.B Bit 2:
d008864d 2293Some SMART or other ATA command to the disk failed, or there was a checksum
f9e10201 2294error in a SMART data structure (see \*(Aq\-b\*(Aq option above).
832b75ed
GG
2295.TP
2296.B Bit 3:
2297SMART status check returned "DISK FAILING".
2298.TP
2299.B Bit 4:
a37e7145 2300We found prefail Attributes <= threshold.
832b75ed
GG
2301.TP
2302.B Bit 5:
2303SMART status check returned "DISK OK" but we found that some (usage
2304or prefail) Attributes have been <= threshold at some time in the
f9e10201 2305past.
832b75ed
GG
2306.TP
2307.B Bit 6:
2308The device error log contains records of errors.
2309.TP
2310.B Bit 7:
ee38a438 2311The device self-test log contains records of errors.
cfbba5b9 2312[ATA only] Failed self-tests outdated by a newer successful extended
ee38a438 2313self-test are ignored.
d008864d 2314.PP
832b75ed 2315To test within the shell for whether or not the different bits are
d2e702cf
GI
2316turned on or off, you can use the following type of construction
2317(which should work with any POSIX compatible shell):
f9e10201 2318.br
832b75ed 2319.B smartstat=$(($? & 8))
f9e10201 2320.br
832b75ed
GG
2321This looks at only at bit 3 of the exit status
2322.B $?
2323(since 8=2^3). The shell variable
2324$smartstat will be nonzero if SMART status check returned "disk
2325failing" and zero otherwise.
d2e702cf
GI
2326.PP
2327This shell script prints all status bits:
f9e10201 2328.Vb 5
d2e702cf
GI
2329val=$?; mask=1
2330for i in 0 1 2 3 4 5 6 7; do
2331 echo "Bit $i: $(((val & mask) && 1))"
2332 mask=$((mask << 1))
d008864d 2333done
f9e10201
JD
2334.Ve
2335.Sp
d2e702cf
GI
2336.\" %IF NOT OS Windows
2337.SH FILES
2338.TP
2339.B /usr/local/sbin/smartctl
2340full path of this executable.
2341.\" %IF ENABLE_DRIVEDB
2342.TP
2343.B /usr/local/share/smartmontools/drivedb.h
f9e10201 2344drive database (see \*(Aq\-B\*(Aq option).
d2e702cf
GI
2345.\" %ENDIF ENABLE_DRIVEDB
2346.TP
2347.B /usr/local/etc/smart_drivedb.h
f9e10201
JD
2348optional local drive database (see \*(Aq\-B\*(Aq option).
2349.Sp
d2e702cf 2350.\" %ENDIF NOT OS Windows
ee38a438 2351.SH AUTHORS
a86ec89e 2352\fBBruce Allen\fP (project initiator),
ee38a438 2353.br
a86ec89e 2354\fBChristian Franke\fP (project manager, Windows port and all sort of things),
ee38a438 2355.br
a86ec89e 2356\fBDouglas Gilbert\fP (SCSI subsystem),
ee38a438 2357.br
a86ec89e 2358\fBVolker Kuhlmann\fP (moderator of support and database mailing list),
d2e702cf 2359.br
a86ec89e 2360\fBGabriele Pohl\fP (wiki & development team support),
d2e702cf 2361.br
a86ec89e 2362\fBAlex Samorukov\fP (FreeBSD port and more, new Trac wiki).
f9e10201 2363.PP
a86ec89e
GI
2364Many other individuals have made contributions and corrections,
2365see AUTHORS, ChangeLog and repository files.
f9e10201 2366.PP
a86ec89e
GI
2367The first smartmontools code was derived from the smartsuite package,
2368written by Michael Cornwell and Andre Hedrick.
f9e10201 2369.Sp
a86ec89e
GI
2370.SH REPORTING BUGS
2371To submit a bug report, create a ticket in smartmontools wiki:
d2e702cf 2372.br
f9e10201 2373<\fBhttps://www.smartmontools.org/\fP>.
d2e702cf 2374.br
a86ec89e 2375Alternatively send the info to the smartmontools support mailing list:
d2e702cf 2376.br
f9e10201
JD
2377<\fBhttps://listi.jpberlin.de/mailman/listinfo/smartmontools-support\fB>.
2378.Sp
d2e702cf 2379.SH SEE ALSO
a86ec89e
GI
2380\fBsmartd\fP(8).
2381.\" %IF ENABLE_UPDATE_SMART_DRIVEDB
2382.br
2383\fBupdate-smart-drivedb\fP(8).
2384.\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB
f9e10201 2385.Sp
d2e702cf
GI
2386.SH REFERENCES
2387Please see the following web site for more info:
f9e10201
JD
2388<\fBhttps://www.smartmontools.org/\fP>
2389.PP
832b75ed
GG
2390An introductory article about smartmontools is \fIMonitoring Hard
2391Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
f9e10201
JD
2392pages 74\(en77.
2393See <\fBhttps://www.linuxjournal.com/article/6983\fP>.
2394.PP
832b75ed
GG
2395If you would like to understand better how SMART works, and what it
2396does, a good place to start is with Sections 4.8 and 6.54 of the first
f9e10201 2397volume of the \*(AqAT Attachment with Packet Interface-7\*(Aq (ATA/ATAPI-7)
e9583e0c
GI
2398specification Revision 4b. This documents the SMART functionality which the
2399\fBsmartmontools\fP utilities provide access to.
f9e10201 2400.PP
ee38a438
GI
2401The functioning of SMART was originally defined by the SFF-8035i
2402revision 2 and the SFF-8055i revision 1.4 specifications. These are
e9583e0c 2403publications of the Small Form Factors (SFF) Committee.
f9e10201 2404.PP
e9583e0c 2405Links to these and other documents may be found on the Links page of the
f9e10201
JD
2406\fBsmartmontools\fP Wiki at <\fBhttps://www.smartmontools.org/wiki/Links\fP>.
2407.Sp
a86ec89e
GI
2408.SH PACKAGE VERSION
2409CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
2410.br
ff28b140 2411$Id: smartctl.8.in 4882 2018-12-29 21:26:45Z chrfranke $