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