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