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