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