]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - smartctl.8.in
Imported Upstream version 5.38+svn2956
[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
eb07ddf2 4 $Id: smartctl.8.in 2922 2009-09-22 16:27:33Z 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..
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,
eb07ddf2
GI
878measured in hours of disk lifetime, is also printed. [Note: this time
879stamp wraps after 2^16 hours, or 2730 days and 16 hours, or about 7.5
880years.] If any errors were detected, the Logical Block Address (LBA)
881of the first error is printed in decimal notation. On Linux systems the
882smartmontools web page has instructions about how to convert this LBA
883address to the name of the disk file containing the erroneous block.
832b75ed 884
2127e193
GI
885.I selftest
886\- [SCSI] the self\-test log for a SCSI device has a slightly different
887format than for an ATA device. For each of the most recent twenty
832b75ed
GG
888self\-tests, it shows the type of test and the status (final or in
889progress) of the test. SCSI standards use the terms "foreground" and
890"background" (rather than ATA\'s corresponding "captive" and
891"off\-line") and "short" and "long" (rather than ATA\'s corresponding
892"short" and "extended") to describe the type of the test. The printed
893segment number is only relevant when a test fails in the third or
894later test segment. It identifies the test that failed and consists
895of either the number of the segment that failed during the test, or
896the number of the test that failed and the number of the segment in
897which the test was run, using a vendor\-specific method of putting both
898numbers into a single byte. The Logical Block Address (LBA) of the
899first error is printed in hexadecimal notation. On Linux systems the
900smartmontools web page has instructions about how to convert this LBA
901address to the name of the disk file containing the erroneous block.
902If provided, the SCSI Sense Key (SK), Additional Sense Code (ASC) and
903Additional Sense Code Qualifier (ASQ) are also printed. The self tests
904can be run using the \'\-t\' option described below (using the ATA
905test terminology).
906
2127e193
GI
907.I xselftest[,NUM][,selftest]
908\- [ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] prints the Extended
909SMART self\-test log (General Purpose Log address 0x07). Unlike the SMART
910self\-test log (see \'\-l selftest\' above), it supports 48-bit LBA
911and logs with more than one sector. Each sector holds up to 19 log
912entries. The actual number of log sectors is vendor specific, typical
913values are 1 (Seagate) or 2 (Samsung).
914
915Only the 25 most recent log entries are printed by default. This number
916can be changed by the optional parameter NUM.
917
918If ',selftest' is appended and the Extended SMART self-test log is not
919supported, the old SMART self-test log is printed.
920
921.I selective
922\- [ATA only] Please see the \'\-t select\' option below for a
832b75ed
GG
923description of selective self\-tests. The selective self\-test log
924shows the start/end Logical Block Addresses (LBA) of each of the five
925test spans, and their current test status. If the span is being
926tested or the remainder of the disk is being read\-scanned, the
927current 65536\-sector block of LBAs being tested is also displayed.
928The selective self\-test log also shows if a read\-scan of the
929remainder of the disk will be carried out after the selective
930self\-test has completed (see \'\-t afterselect\' option) and the time
931delay before restarting this read\-scan if it is interrupted (see
932\'\-t pending\' option). This is a new smartmontools feature; please
933report unusual or incorrect behavior to the smartmontools\-support
934mailing list.
935
2127e193
GI
936.I directory[,gs]
937\- [ATA only] if the device supports the General Purpose Logging feature
938set (ATA\-6 and above) then this prints the Log Directory (the log at
832b75ed
GG
939address 0). The Log Directory shows what logs are available and their
940length in sectors (512 bytes). The contents of the logs at address 1
941[Summary SMART error log] and at address 6 [SMART self\-test log] may
942be printed using the previously\-described
943.I error
944and
945.I selftest
2127e193
GI
946arguments to this option.
947If your version of smartctl supports 48-bit ATA commands, both the
948General Purpose Log (GPL) and SMART Log (SL) directories are printed in
949one combined table. The output can be restricted to the GPL directory or
950SL directory by \'\-l directory,q\' or \'\-l directory,s\' respectively.
951
952.I background
953\- [SCSI only] the background scan results log outputs information derived
954from Background Media Scans (BMS) done after power up and/or periodocally
955(e.g. every 24 hours) on recent SCSI disks. If supported, the BMS status
4d59bff9
GG
956is output first, indicating whether a background scan is currently
957underway (and if so a progress percentage), the amount of time the disk
958has been powered up and the number of scans already completed. Then there
959is a header and a line for each background scan "event". These will
960typically be either recovered or unrecoverable errors. That latter group
961may need some attention. There is a description of the background scan
962mechansim in section 4.18 of SBC\-3 revision 6 (see www.t10.org ).
963
2127e193
GI
964.I scttemp, scttempsts, scttemphist
965\- [ATA only] prints the disk temperature information provided by the
966SMART Command Transport (SCT) commands.
a37e7145
GG
967The option \'scttempsts\' prints current temperature and temperature
968ranges returned by the SCT Status command, \'scttemphist\' prints
969temperature limits and the temperature history table returned by
970the SCT Data Table command, and \'scttemp\' prints both.
971The temperature values are preserved across power cycles.
972The default temperature logging interval is 1 minute and can be
973configured with the \'\-t scttempint,N[,p]\' option, see below.
974The SCT commands are specified in the proposed ATA\-8 Command Set
975(ACS), and are already implemented in some recent ATA\-7 disks.
976
2127e193
GI
977.I sataphy[,reset]
978\- [SATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] prints values
979and descriptions of the SATA Phy Event Counters (General Purpose Log
980address 0x11). If \'\-l sataphy,reset\' is specified, all counters
981are reset after reading the values.
982
983.I sasphy[,reset]
984\- [SAS (SCSI) only] [NEW EXPERIMENTAL SMARTCTL FEATURE] prints values
985and descriptions of the SAS (SSP) Protocol Specific log page (log page
9860x18). If \'\-l sasphy,reset\' is specified, all counters
987are reset after reading the values.
988
989.I gplog,ADDR[,FIRST[\-LAST|+SIZE]]
990\- [ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] prints a hex dump
991of any log accessible via General Purpose Logging (GPL) feature.
992The log address ADDR is the hex address listed in the log directory
993(see \'\-l directory\' above). The range of log sectors (pages) can
994be specified by decimal values FIRST\-LAST or FIRST+SIZE. FIRST
995defaults to 0, SIZE defaults to 1. LAST can be set to \'max\' to
996specify the last page of the log.
997
998.I smartlog,ADDR[,FIRST[\-LAST|+SIZE]]
999\- [ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] prints a hex dump
1000of any log accessible via SMART Read Log command. See
1001\'\-l gplog,...\' above for parameter syntax.
1002
1003For example, all these commands:
1004.nf
1005 smartctl \-l gplog,0x80,10-15 /dev/sda
1006 smartctl \-l gplog,0x80,10+6 /dev/sda
1007 smartctl \-l smartlog,0x80,10-15 /dev/sda
1008.fi
1009print pages 10-15 of log 0x80 (first host vendor specific log).
1010
1011The hex dump format is compatible with the \'xxd \-r\' command.
1012This command:
1013.nf
1014 smartctl \-l gplog,0x11 /dev/sda | grep ^0 | xxd -r >log.bin
1015.fi
1016writes a binary representation of the one sector log 0x11
1017(SATA Phy Event Counters) to file log.bin.
1018
832b75ed
GG
1019.TP
1020.B \-v N,OPTION, \-\-vendorattribute=N,OPTION
2127e193
GI
1021[ATA only] Sets a vendor\-specific display OPTION for Attribute N. This
1022option may be used multiple times. Valid arguments to this option are:
832b75ed
GG
1023
1024.I help
1025\- Prints (to STDOUT) a list of all valid arguments to this option,
1026then exits.
1027
1028.I 9,minutes
1029\- Raw Attribute number 9 is power\-on time in minutes. Its raw value
1030will be displayed in the form "Xh+Ym". Here X is hours, and Y is
1031minutes in the range 0\-59 inclusive. Y is always printed with two
1032digits, for example "06" or "31" or "00".
1033
1034.I 9,seconds
1035\- Raw Attribute number 9 is power\-on time in seconds. Its raw value
1036will be displayed in the form "Xh+Ym+Zs". Here X is hours, Y is
1037minutes in the range 0\-59 inclusive, and Z is seconds in the range
10380\-59 inclusive. Y and Z are always printed with two digits, for
1039example "06" or "31" or "00".
1040
1041.I 9,halfminutes
1042\- Raw Attribute number 9 is power\-on time, measured in units of 30
1043seconds. This format is used by some Samsung disks. Its raw value
1044will be displayed in the form "Xh+Ym". Here X is hours, and Y is
1045minutes in the range 0\-59 inclusive. Y is always printed with two
1046digits, for example "06" or "31" or "00".
1047
1048.I 9,temp
1049\- Raw Attribute number 9 is the disk temperature in Celsius.
1050
1051.I 192,emergencyretractcyclect
1052\- Raw Attribute number 192 is the Emergency Retract Cycle Count.
1053
1054.I 193,loadunload
1055\- Raw Attribute number 193 contains two values. The first is the
1056number of load cycles. The second is the number of unload cycles.
1057The difference between these two values is the number of times that
1058the drive was unexpectedly powered off (also called an emergency
1059unload). As a rule of thumb, the mechanical stress created by one
1060emergency unload is equivalent to that created by one hundred normal
1061unloads.
1062
1063.I 194,10xCelsius
1064\- Raw Attribute number 194 is ten times the disk temperature in
1065Celsius. This is used by some Samsung disks (example: model SV1204H
1066with RK100\-13 firmware).
1067
1068.I 194,unknown
1069\- Raw Attribute number 194 is NOT the disk temperature, and its
1070interpretation is unknown. This is primarily useful for the \-P
1071(presets) option.
1072
2127e193
GI
1073.I 197,increasing
1074\- Raw Attribute number 197 (Current Pending Sector Count) is not
1075reset if uncorrectable sectors are reallocated.
1076
1077.I 198,increasing
1078\- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not
1079reset if uncorrectable sectors are reallocated.
1080
832b75ed
GG
1081.I 198,offlinescanuncsectorct
1082\- Raw Attribute number 198 is the Offline Scan UNC Sector Count.
1083
1084.I 200,writeerrorcount
1085\- Raw Attribute number 200 is the Write Error Count.
1086
1087.I 201,detectedtacount
1088\- Raw Attribute number 201 is the Detected TA Count.
1089
1090.I 220,temp
1091\- Raw Attribute number 220 is the disk temperature in Celsius.
1092
1093Note: a table of hard drive models, listing which Attribute
1094corresponds to temperature, can be found at:
1095\fBhttp://www.guzu.net/linux/hddtemp.db\fP
1096
1097.I N,raw8
1098\- Print the Raw value of Attribute N as six 8\-bit unsigned base\-10
1099integers. This may be useful for decoding the meaning of the Raw
1100value. The form \'N,raw8\' prints Raw values for ALL Attributes in this
1101form. The form (for example) \'123,raw8\' only prints the Raw value for
1102Attribute 123 in this form.
1103
1104.I N,raw16
1105\- Print the Raw value of Attribute N as three 16\-bit unsigned base\-10
1106integers. This may be useful for decoding the meaning of the Raw
1107value. The form \'N,raw16\' prints Raw values for ALL Attributes in this
1108form. The form (for example) \'123,raw16\' only prints the Raw value for
1109Attribute 123 in this form.
1110
1111.I N,raw48
1112\- Print the Raw value of Attribute N as a 48\-bit unsigned base\-10
1113integer. This may be useful for decoding the meaning of the Raw
1114value. The form \'N,raw48\' prints Raw values for ALL Attributes in
1115this form. The form (for example) \'123,raw48\' only prints the Raw
1116value for Attribute 123 in this form.
1117
1118.TP
1119.B \-F TYPE, \-\-firmwarebug=TYPE
2127e193
GI
1120[ATA only] Modifies the behavior of \fBsmartctl\fP to compensate for some
1121known and understood device firmware or driver bug. Except \'swapid\',
a37e7145
GG
1122the arguments to this option are exclusive, so that only the final
1123option given is used. The valid values are:
832b75ed
GG
1124
1125.I none
1126\- Assume that the device firmware obeys the ATA specifications. This
1127is the default, unless the device has presets for \'\-F\' in the
1128device database (see note below).
1129
1130.I samsung
1131\- In some Samsung disks (example: model SV4012H Firmware Version:
1132RM100\-08) some of the two\- and four\-byte quantities in the SMART data
1133structures are byte\-swapped (relative to the ATA specification).
1134Enabling this option tells \fBsmartctl\fP to evaluate these quantities
1135in byte\-reversed order. Some signs that your disk needs this option
1136are (1) no self\-test log printed, even though you have run self\-tests;
1137(2) very large numbers of ATA errors reported in the ATA error log;
1138(3) strange and impossible values for the ATA error log timestamps.
1139
1140.I samsung2
1141\- In more recent Samsung disks (firmware revisions ending in "\-23")
1142the number of ATA errors reported is byte swapped. Enabling this
1143option tells \fBsmartctl\fP to evaluate this quantity in
1144byte\-reversed order. An indication that your Samsung disk needs this
a37e7145 1145option is that the self\-test log is printed correctly, but there are a
832b75ed
GG
1146very large number of errors in the SMART error log. This is because
1147the error count is byte swapped. Thus a disk with five errors
1148(0x0005) will appear to have 20480 errors (0x5000).
1149
a37e7145
GG
1150.I samsung3
1151\- Some Samsung disks (at least SP2514N with Firmware VF100\-37) report
1152a self\-test still in progress with 0% remaining when the test was already
1153completed. Enabling this option modifies the output of the self\-test
1154execution status (see options \'\-c\' or \'\-a\' above) accordingly.
1155
832b75ed
GG
1156Note that an explicit \'\-F\' option on the command line will
1157over\-ride any preset values for \'\-F\' (see the \'\-P\' option
1158below).
1159
a37e7145
GG
1160.I swapid
1161\- Fixes byte swapped ATA identify strings (device name, serial number,
1162firmware version) returned by some buggy device drivers.
1163
832b75ed
GG
1164.TP
1165.B \-P TYPE, \-\-presets=TYPE
2127e193
GI
1166[ATA only] Specifies whether \fBsmartctl\fP should use any preset options
1167that are available for this drive. By default, if the drive is recognized
832b75ed
GG
1168in the \fBsmartmontools\fP database, then the presets are used.
1169
1170\fBsmartctl\fP can automatically set appropriate options for known
1171drives. For example, the Maxtor 4D080H4 uses Attribute 9 to stores
1172power\-on time in minutes whereas most drives use that Attribute to
1173store the power\-on time in hours. The command\-line option \'\-v
11749,minutes\' ensures that \fBsmartctl\fP correctly interprets Attribute
11759 in this case, but that option is preset for the Maxtor 4D080H4 and
1176so need not be specified by the user on the \fBsmartctl\fP command
1177line.
1178
1179The argument
1180.I show
1181will show any preset options for your drive and the argument
1182.I showall
1183will show all known drives in the \fBsmartmontools\fP database, along
1184with their preset options. If there are no presets for your drive and
1185you think there should be (for example, a \-v or \-F option is needed
1186to get \fBsmartctl\fP to display correct values) then please contact
1187the \fBsmartmontools\fP developers so that this information can be
1188added to the \fBsmartmontools\fP database. Contact information is at the
1189end of this man page.
1190
1191The valid arguments to this option are:
1192
1193.I use
1194\- if a drive is recognized, then use the stored presets for it. This
1195is the default. Note that presets will NOT over\-ride additional
1196Attribute interpretation (\'\-v N,something\') command\-line options or
1197explicit \'\-F\' command\-line options..
1198
1199.I ignore
1200\- do not use presets.
1201
1202.I show
1203\- show if the drive is recognized in the database, and if so, its
1204presets, then exit.
1205
1206.I showall
1207\- list all recognized drives, and the presets that are set for them,
1208then exit.
1209
1210The \'\-P showall\' option takes up to two optional arguments to
1211match a specific drive type and firmware version. The command:
1212.nf
1213 smartctl \-P showall
1214.fi
1215lists all entries, the command:
1216.nf
1217 smartctl \-P showall \'MODEL\'
1218.fi
1219lists all entries matching MODEL, and the command:
1220.nf
1221 smartctl \-P showall \'MODEL\' \'FIRMWARE\'
1222.fi
1223lists all entries for this MODEL and a specific FIRMWARE version.
1224
2127e193
GI
1225.TP
1226.B \-B [+]FILE, \-\-drivedb=[+]FILE
1227[ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE] Read the drive database from
1228FILE. The new database replaces the built in database by default. If \'+\' is
1229specified, then the new entries prepend the built in entries.
1230
1231If this option is not specified, optional entries are read from the file
1232\fB/usr/local/etc/smart_drivedb.h\fP (Windows: \fB./smart_drivedb.conf\fP).
1233.\" BEGIN ENABLE_DRIVEDB
1234If \fB/usr/local/share/smartmontools/drivedb.h\fP is present, the
1235contents of this file is used instead of the built in table.
1236.\" END ENABLE_DRIVEDB
1237
1238The database files use the same C/C++ syntax that is used to initialize
1239the built in database array. C/C++ style comments are allowed.
1240Example:
1241
1242.nf
1243 /* Full entry: */
1244 {
1245 "Model family", // Info about model family/series.
1246 "MODEL1.*REGEX", // Regular expression to match model of device.
1247 "VERSION.*REGEX", // Regular expression to match firmware version(s).
1248 "Some warning", // Warning message.
1249 "\-v 9,minutes" // String of preset \-v and \-F options.
1250 },
1251 /* Minimal entry: */
1252 {
1253 "", // No model family/series info.
1254 "MODEL2.*REGEX", // Regular expression to match model of device.
1255 "", // All firmware versions.
1256 "", // No warning.
1257 "" // No options preset.
1258 },
1259 /* ... */
1260.fi
1261
832b75ed
GG
1262.TP
1263.B SMART RUN/ABORT OFFLINE TEST AND SELF\-TEST OPTIONS:
1264.TP
1265.B \-t TEST, \-\-test=TEST
1266Executes TEST immediately. The \'\-C\' option can be used in
1267conjunction with this option to run the short or long (and also for
1268ATA devices, selective or conveyance) self\-tests in captive mode
1269(known as "foreground mode" for SCSI devices). Note that only one
1270test type can be run at a time, so only one test type should be
1271specified per command line. Note also that if a computer is shutdown
1272or power cycled during a self\-test, no harm should result. The
1273self\-test will either be aborted or will resume automatically.
1274
1275The valid arguments to this option are:
1276
1277.I offline
1278\- runs SMART Immediate Offline Test. This immediately
1279starts the test described above. This command can be given during
1280normal system operation. The effects of this test are visible only in
1281that it updates the SMART Attribute values, and if errors are
1282found they will appear in the SMART error log, visible with the \'\-l error\'
1283option. [In the case of SCSI devices runs the default self test in
1284foreground. No entry is placed in the self test log.]
1285
1286If the \'\-c\' option to \fBsmartctl\fP shows that the device has the
1287"Suspend Offline collection upon new command" capability then you can
1288track the progress of the Immediate Offline test using the \'\-c\'
1289option to \fBsmartctl\fP. If the \'\-c\' option show that the device
1290has the "Abort Offline collection upon new command" capability then
1291most commands will abort the Immediate Offline Test, so you should not
1292try to track the progress of the test with \'\-c\', as it will abort
1293the test.
1294
1295.I short
1296\- runs SMART Short Self Test (usually under ten minutes).
1297[Note: in the case of SCSI devices,
1298this command option runs the "Background short" self\-test.]
1299This command can be given during normal system operation (unless run in
1300captive mode \- see the \'\-C\' option below). This is a
1301test in a different category than the immediate or automatic offline
1302tests. The "Self" tests check the electrical and mechanical
1303performance as well as the read performance of the disk. Their
1304results are reported in the Self Test Error Log, readable with
1305the \'\-l selftest\' option. Note that on some disks the progress of the
1306self\-test can be monitored by watching this log during the self\-test; with other disks
1307use the \'\-c\' option to monitor progress.
1308
1309.I long
1310\- runs SMART Extended Self Test (tens of minutes).
1311[Note: in the case of SCSI devices,
1312this command option runs the "Background long" self\-test.]
1313This is a
1314longer and more thorough version of the Short Self Test described
1315above. Note that this command can be given during normal
1316system operation (unless run in captive mode \- see the \'\-C\' option below).
1317
1318.I conveyance
2127e193 1319\- [ATA only] runs a SMART Conveyance Self Test (minutes). This
832b75ed
GG
1320self\-test routine is intended to identify damage incurred during
1321transporting of the device. This self\-test routine should take on the
1322order of minutes to complete. Note that this command can be given
1323during normal system operation (unless run in captive mode \- see the
1324\'\-C\' option below).
1325
a37e7145 1326.I select,N\-M, select,N+SIZE
2127e193
GI
1327\- [ATA only] runs a SMART Selective Self Test, to test a \fBrange\fP
1328of disk Logical Block Addresses (LBAs), rather than the entire disk.
1329Each range of LBAs that is checked is called a "span" and is specified
1330by a starting LBA (N) and an ending LBA (M) with N less than or equal
1331to M. The range can also be specified as N+SIZE. A span at the end of
1332a disk can be specified by N\-\fBmax\fP.
a37e7145
GG
1333
1334For example the commands:
832b75ed
GG
1335.nf
1336 smartctl \-t select,10\-20 /dev/hda
a37e7145 1337 smartctl \-t select,10+11 /dev/hda
832b75ed 1338.fi
a37e7145
GG
1339both runs a self test on one span consisting of LBAs ten to twenty
1340(inclusive). The command:
1341.nf
1342 smartctl \-t select,100000000\-max /dev/hda
1343.fi
1344run a self test from LBA 100000000 up to the end of the disk.
1345The \'\-t\' option can be given up to five times, to test
832b75ed
GG
1346up to five spans. For example the command:
1347.nf
1348 smartctl \-t select,0\-100 \-t select,1000\-2000 /dev/hda
1349.fi
1350runs a self test on two spans. The first span consists of 101 LBAs
1351and the second span consists of 1001 LBAs. Note that the spans can
1352overlap partially or completely, for example:
1353.nf
1354 smartctl \-t select,0\-10 \-t select,5\-15 \-t select,10\-20 /dev/hda
1355.fi
1356The results of the selective self\-test can be obtained (both during
1357and after the test) by printing the SMART self\-test log, using the
1358\'\-l selftest\' option to smartctl.
1359
1360Selective self tests are particularly useful as disk capacities
1361increase: an extended self test (smartctl \-t long) can take several
1362hours. Selective self\-tests are helpful if (based on SYSLOG error
1363messages, previous failed self\-tests, or SMART error log entries) you
1364suspect that a disk is having problems at a particular range of
1365Logical Block Addresses (LBAs).
1366
1367Selective self\-tests can be run during normal system operation (unless
1368done in captive mode \- see the \'\-C\' option below).
1369
a37e7145
GG
1370[Note: To use this feature on Linux, the kernel must be compiled with
1371the configuration option CONFIG_IDE_TASKFILE_IO enabled. Please report
1372unusual or incorrect behavior to the smartmontools\-support mailing list.]
1373
1374The following variants of the selective self\-test command use spans based
1375on the ranges from past tests already stored on the disk:
1376
1377.I select,redo[+SIZE]
2127e193
GI
1378\- [ATA only] redo the last SMART Selective Self Test using the same LBA
1379range. The starting LBA is identical to the LBA used by last test, same
1380for ending LBA unless a new span size is specified by optional +SIZE
1381argument.
a37e7145
GG
1382
1383For example the commands:
1384.nf
1385 smartctl \-t select,10\-20 /dev/hda
1386 smartctl \-t select,redo /dev/hda
1387 smartctl \-t select,redo+20 /dev/hda
1388.fi
1389have the same effect as:
1390.nf
1391 smartctl \-t select,10\-20 /dev/hda
1392 smartctl \-t select,10\-20 /dev/hda
1393 smartctl \-t select,10\-29 /dev/hda
1394.fi
1395
1396.I select,next[+SIZE]
2127e193
GI
1397\- [ATA only] runs a SMART Selective Self Test on the LBA range which
1398follows the range of the last test. The starting LBA is set to (ending
1399LBA +1) of the last test. A new span size may be specified by the
1400optional +SIZE argument.
a37e7145
GG
1401
1402For example the commands:
1403.nf
1404 smartctl \-t select,0\-999 /dev/hda
1405 smartctl \-t select,next /dev/hda
1406 smartctl \-t select,next+2000 /dev/hda
1407.fi
1408have the same effect as:
1409.nf
1410 smartctl \-t select,0\-999 /dev/hda
1411 smartctl \-t select,1000\-1999 /dev/hda
1412 smartctl \-t select,2000\-3999 /dev/hda
1413.fi
1414
1415If the last test ended at the last LBA of the disk, the new range starts
1416at LBA 0. The span size of the last span of a disk is adjusted such that
1417the total number of spans to check the full disk will not be changed
1418by future uses of \'\-t select,next\'.
1419
1420.I select,cont[+SIZE]
2127e193
GI
1421\- [ATA only] performs a \'redo\' (above) if the self test status reports
1422that the last test was aborted by the host. Otherwise it run the \'next\'
1423(above) test.
832b75ed
GG
1424
1425.I afterselect,on
2127e193 1426\- [ATA only] perform an offline read scan after a Selective Self\-test
832b75ed
GG
1427has completed. This option must be used together with one or more of
1428the \fIselect,N\-M\fP options above. If the LBAs that have been
1429specified in the Selective self\-test pass the test with no errors
1430found, then read scan the \fBremainder\fP of the disk. If the device
1431is powered\-cycled while this read scan is in progress, the read scan
1432will be automatically resumed after a time specified by the pending
1433timer (see below). The value of this option is preserved between
1434selective self\-tests.
1435
1436.I afterselect,off
2127e193 1437\- [ATA only] do not read scan the remainder of the disk after a
832b75ed
GG
1438Selective self\-test has completed. This option must be use together
1439with one or more of the \fIselect,N\-M\fP options above. The value of this
1440option is preserved between selective self\-tests.
1441
1442.I pending,N
2127e193 1443\- [ATA only] set the pending offline read scan timer to N minutes.
832b75ed
GG
1444Here N is an integer in the range from 0 to 65535 inclusive. If the
1445device is powered off during a read scan after a Selective self\-test,
1446then resume the test automatically N minutes after power\-up. This
1447option must be use together with one or more of the \fIselect,N\-M\fP
1448options above. The value of this option is preserved between selective
1449self\-tests.
1450
a37e7145 1451.I scttempint,N[,p]
2127e193
GI
1452\- [ATA only] set the time interval for SCT temperature logging to N
1453minutes. If \',p\' is specified, the setting is preserved across power
1454cycles. Otherwise, the setting is volatile and will be reverted to
1455default (1 minute), or last non-volatile setting by the next hard reset.
1456This command also clears the temperature history table. See
1457\'\-l scttemp\' above for more information about SCT temperature logging.
a37e7145 1458
832b75ed
GG
1459.TP
1460.B \-C, \-\-captive
1461Runs self\-tests in captive mode. This has no effect with \'\-t
1462offline\' or if the \'\-t\' option is not used. [Note: in the case of
1463SCSI devices, this command option runs the self\-test in "Foreground"
1464mode.]
1465
1466\fBWARNING: Tests run in captive mode may busy out the drive for the
1467length of the test. Only run captive tests on drives without any
1468mounted partitions!\fP
1469
1470.TP
1471.B \-X, \-\-abort
1472Aborts non\-captive SMART Self Tests. Note that this
1473command will abort the Offline Immediate Test routine only if your
1474disk has the "Abort Offline collection upon new command" capability.
1475.PP
2127e193
GI
1476.SH ATA, SCSI command sets and SAT
1477In the past there has been a clear distinction between storage devices
1478that used the ATA and SCSI command sets. This distinction was often
1479reflected in their device naming and hardware. Now various SCSI
1480transports (e.g. SAS, FC and iSCSI) can interconnect to both SCSI
1481disks (e.g. FC and SAS) and ATA disks (especially SATA). USB and
1482IEEE 1394 storage devices use the SCSI command set externally but
1483almost always contain ATA or SATA disks (or flash). The storage
1484subsystems in some operating systems have started to remove the
1485distinction between ATA and SCSI in their device naming policies.
1486.PP
148799% of operations that an OS performs on a disk involve the SCSI INQUIRY,
1488READ CAPACITY, READ and WRITE commands, or their ATA equivalents. Since
1489the SCSI commands are slightly more general than their ATA equivalents,
1490many OSes are generating SCSI commands (mainly READ and WRITE) and
1491letting a lower level translate them to their ATA equivalents as the
1492need arises. An important note here is that "lower level" may be in
1493external equipment and hence outside the control of an OS.
1494.PP
1495SCSI to ATA Translation (SAT) is a standard (ANSI INCITS 431-2007) that
1496specifies how this translation is done. For the other 1% of operations
1497that an OS performs on a disk, SAT provides two options. First is an
1498optional ATA PASS-THROUGH SCSI command (there are two variants). The
1499second is a translation from the closest SCSI command. Most current
1500interest is in the "pass-through" option.
1501.PP
1502The relevance to smartmontools (and hence smartctl) is that its
1503interactions with disks fall solidly into the "1%" category. So even
1504if the OS can happily treat (and name) a disk as "SCSI", smartmontools
1505needs to detect the native command set and act accordingly.
1506As more storage manufacturers (including external SATA drives) comply
1507with SAT, smartmontools is able to automatically distinguish the native
1508command set of the device. In some cases the '\-d sat' option is needed
1509on the command line.
1510.PP
1511There are also virtual disks which typically have no useful information
1512to convey to smartmontools, but could conceivably in the future. An
1513example of a virtual disk is the OS's view of a RAID 1 box. There are
1514most likely two SATA disks inside a RAID 1 box. Addressing those SATA
1515disks from a distant OS is a challenge for smartmontools. Another
1516approach is running a tool like smartmontools inside the RAID 1 box (e.g.
1517a Network Attached Storage (NAS) box) and fetching the logs via a
1518browser.
1519.PP
832b75ed
GG
1520.SH EXAMPLES
1521.nf
1522.B smartctl \-a /dev/hda
1523.fi
2127e193
GI
1524Print a large amount of SMART information for drive /dev/hda which is
1525typically an ATA (IDE) or SATA disk in Linux.
1526.PP
1527.nf
1528.B smartctl \-a /dev/sdb
1529.fi
1530Print a large amount of SMART information for drive /dev/sda . This may
1531be a SCSI disk or an ATA (SATA) disk.
832b75ed
GG
1532.PP
1533.nf
1534.B smartctl \-s off /dev/hdd
1535.fi
2127e193 1536Disable SMART monitoring and data log collection on drive /dev/hdd .
832b75ed
GG
1537.PP
1538.nf
1539.B smartctl \-\-smart=on \-\-offlineauto=on \-\-saveauto=on /dev/hda
1540.fi
1541Enable SMART on drive /dev/hda, enable automatic offline
1542testing every four hours, and enable autosaving of
1543SMART Attributes. This is a good start\-up line for your system\'s
1544init files. You can issue this command on a running system.
1545.PP
1546.nf
1547.B smartctl \-t long /dev/hdc
1548.fi
1549Begin an extended self\-test of drive /dev/hdc. You can issue this
1550command on a running system. The results can be seen in the self\-test
1551log visible with the \'\-l selftest\' option after it has completed.
1552.PP
1553.nf
1554.B smartctl \-s on \-t offline /dev/hda
1555.fi
1556Enable SMART on the disk, and begin an immediate offline test of
1557drive /dev/hda. You can issue this command on a running system. The
1558results are only used to update the SMART Attributes, visible
1559with the \'\-A\' option. If any device errors occur, they are logged to
1560the SMART error log, which can be seen with the \'\-l error\' option.
1561.PP
1562.nf
1563.B smartctl \-A \-v 9,minutes /dev/hda
1564.fi
1565Shows the vendor Attributes, when the disk stores its power\-on time
1566internally in minutes rather than hours.
1567.PP
1568.nf
1569.B smartctl \-q errorsonly \-H \-l selftest /dev/hda
1570.fi
1571Produces output only if the device returns failing SMART status,
1572or if some of the logged self\-tests ended with errors.
1573.PP
1574.nf
1575.B smartctl \-q silent \-a /dev/hda
1576.fi
1577Examine all SMART data for device /dev/hda, but produce no
1578printed output. You must use the exit status (the
1579.B $?
1580shell variable) to learn if any Attributes are out of bound, if the
1581SMART status is failing, if there are errors recorded in the
1582self\-test log, or if there are errors recorded in the disk error log.
1583.PP
1584.nf
1585.B smartctl \-a \-d 3ware,0 /dev/sda
1586.fi
1587Examine all SMART data for the first ATA disk connected to a 3ware
1588RAID controller card.
1589.PP
1590.nf
1591.B smartctl \-a \-d 3ware,0 /dev/twe0
1592.fi
1593Examine all SMART data for the first ATA disk connected to a 3ware
1594RAID 6000/7000/8000 controller card.
1595.PP
1596.nf
1597.B smartctl \-a \-d 3ware,0 /dev/twa0
1598.fi
1599Examine all SMART data for the first ATA disk connected to a 3ware
1600RAID 9000 controller card.
1601.PP
1602.nf
1603.B smartctl \-t short \-d 3ware,3 /dev/sdb
1604.fi
1605Start a short self\-test on the fourth ATA disk connected to the 3ware RAID
1606controller card which is the second SCSI device /dev/sdb.
4d59bff9
GG
1607.PP
1608.nf
2127e193
GI
1609.B smartctl \-t long \-d areca,4 /dev/sg2
1610.fi
1611Start a long self\-test on the fourth SATA disk connected to an Areca RAID
1612controller addressed by /dev/sg2.
1613.PP
1614.nf
1615.B smartctl \-a \-d hpt,1/3 /dev/sda (under Linux)
1616.B smartctl \-a \-d hpt,1/3 /dev/hptrr (under FreeBSD)
4d59bff9
GG
1617.fi
1618Examine all SMART data for the (S)ATA disk directly connected to the third channel of the
1619first HighPoint RocketRAID controller card.
1620.nf
1621.PP
1622.nf
2127e193
GI
1623.B smartctl \-t short \-d hpt,1/1/2 /dev/sda (under Linux)
1624.B smartctl \-t short \-d hpt,1/1/2 /dev/hptrr (under FreeBSD)
4d59bff9
GG
1625.fi
1626Start a short self\-test on the (S)ATA disk connected to second pmport on the
1627first channel of the first HighPoint RocketRAID controller card.
1628.PP
832b75ed
GG
1629.nf
1630.B smartctl \-t select,10\-100 \-t select,30\-300 \-t afterselect,on \-t pending,45 /dev/hda
1631.fi
1632Run a selective self\-test on LBAs 10 to 100 and 30 to 300. After the
1633these LBAs have been tested, read\-scan the remainder of the disk. If the disk is
1634power\-cycled during the read\-scan, resume the scan 45 minutes after power to the
1635device is restored.
1636.PP
ba59cff1
GG
1637.nf
1638.B smartctl \-a \-d cciss,0 /dev/cciss/c0d0
1639.fi
1640Examine all SMART data for the first SCSI disk connected to a cciss
1641RAID controller card.
1642.PP
832b75ed
GG
1643.SH RETURN VALUES
1644The return values of \fBsmartctl\fP are defined by a bitmask. If all
1645is well with the disk, the return value (exit status) of
1646\fBsmartctl\fP is 0 (all bits turned off). If a problem occurs, or an
1647error, potential error, or fault is detected, then a non\-zero status
1648is returned. In this case, the eight different bits in the return
1649value have the following meanings for ATA disks; some of these values
1650may also be returned for SCSI disks.
1651.TP
1652.B Bit 0:
1653Command line did not parse.
1654.TP
1655.B Bit 1:
1656Device open failed, or device did not return an IDENTIFY DEVICE structure.
1657.TP
1658.B Bit 2:
1659Some SMART command to the disk failed, or there was a checksum error
1660in a SMART data structure (see \'\-b\' option above).
1661.TP
1662.B Bit 3:
1663SMART status check returned "DISK FAILING".
1664.TP
1665.B Bit 4:
a37e7145 1666We found prefail Attributes <= threshold.
832b75ed
GG
1667.TP
1668.B Bit 5:
1669SMART status check returned "DISK OK" but we found that some (usage
1670or prefail) Attributes have been <= threshold at some time in the
1671past.
1672.TP
1673.B Bit 6:
1674The device error log contains records of errors.
1675.TP
1676.B Bit 7:
1677The device self\-test log contains records of errors.
1678
1679To test within the shell for whether or not the different bits are
1680turned on or off, you can use the following type of construction (this
1681is bash syntax):
1682.nf
1683.B smartstat=$(($? & 8))
1684.fi
1685This looks at only at bit 3 of the exit status
1686.B $?
1687(since 8=2^3). The shell variable
1688$smartstat will be nonzero if SMART status check returned "disk
1689failing" and zero otherwise.
1690
1691.PP
1692.SH NOTES
1693The TapeAlert log page flags are cleared for the initiator when the
1694page is read. This means that each alert condition is reported only
1695once by \fBsmartctl\fP for each initiator for each activation of the
1696condition.
1697
1698.PP
1699.SH AUTHOR
1700\fBBruce Allen\fP smartmontools\-support@lists.sourceforge.net
1701.fi
1702University of Wisconsin \- Milwaukee Physics Department
1703
1704.PP
1705.SH CONTRIBUTORS
1706The following have made large contributions to smartmontools:
1707.nf
1708\fBCasper Dik\fP (Solaris SCSI interface)
2127e193 1709\fBChristian Franke\fP (Windows interface, C++ redesign, USB support, ...)
832b75ed
GG
1710\fBDouglas Gilbert\fP (SCSI subsystem)
1711\fBGuido Guenther\fP (Autoconf/Automake packaging)
1712\fBGeoffrey Keating\fP (Darwin ATA interface)
1713\fBEduard Martinescu\fP (FreeBSD interface)
1714\fBFr\*'ed\*'eric L. W. Meunier\fP (Web site and Mailing list)
2127e193 1715\fBGabriele Pohl\fP (Web site and Wiki, conversion from CVS to SVN)
832b75ed 1716\fBKeiji Sawada\fP (Solaris ATA interface)
2127e193 1717\fBManfred Schwarb\fP (Drive database)
832b75ed
GG
1718\fBSergey Svishchev\fP (NetBSD interface)
1719\fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
1720\fBPhil Williams\fP (User interface and drive database)
1721\fBYuri Dario\fP (OS/2, eComStation interface)
2127e193 1722\fBShengfeng Zhou\fP (Linux/FreeBSD HighPoint RocketRAID interface)
832b75ed
GG
1723.fi
1724Many other individuals have made smaller contributions and corrections.
1725
1726.PP
1727.SH CREDITS
1728.fi
1729This code was derived from the smartsuite package, written by Michael
1730Cornwell, and from the previous UCSC smartsuite package. It extends
1731these to cover ATA\-5 disks. This code was originally developed as a
1732Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
1733(now part of the Storage Systems Research Center), Jack Baskin School
1734of Engineering, University of California, Santa
1735Cruz. \fBhttp://ssrc.soe.ucsc.edu/\fP .
1736.SH
1737HOME PAGE FOR SMARTMONTOOLS:
1738.fi
1739Please see the following web site for updates, further documentation, bug
1740reports and patches: \fBhttp://smartmontools.sourceforge.net/\fP
1741
1742.SH
1743SEE ALSO:
1744\fBsmartd\fP(8), \fBbadblocks\fP(8), \fBide\-smart\fP(8).
1745.SH
1746REFERENCES FOR SMART
1747.fi
1748An introductory article about smartmontools is \fIMonitoring Hard
1749Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
a37e7145 1750pages 74\-77. This is \fBhttp://www.linuxjournal.com/article.php?sid=6983\fP
832b75ed
GG
1751online.
1752
1753If you would like to understand better how SMART works, and what it
1754does, a good place to start is with Sections 4.8 and 6.54 of the first
a37e7145 1755volume of the \'AT Attachment with Packet Interface\-7\' (ATA/ATAPI\-7)
832b75ed
GG
1756specification. This documents the SMART functionality which the
1757\fBsmartmontools\fP utilities provide access to. You can find
1758Revision 4b of this document at
1759\fBhttp://www.t13.org/docs2004/d1532v1r4b-ATA-ATAPI-7.pdf\fP .
1760Earlier and later versions of this Specification are available from
1761the T13 web site \fBhttp://www.t13.org/\fP .
1762
1763.fi
1764The functioning of SMART was originally defined by the SFF\-8035i
1765revision 2 and the SFF\-8055i revision 1.4 specifications. These are
1766publications of the Small Form Factors (SFF) Committee. Links to
1767these documents may be found in the References section of the
1768\fBsmartmontools\fP home page at
1769\fBhttp://smartmontools.sourceforge.net/\fP .
1770
1771.SH
2127e193 1772SVN ID OF THIS PAGE:
eb07ddf2 1773$Id: smartctl.8.in 2922 2009-09-22 16:27:33Z chrfranke $
832b75ed
GG
1774.\" Local Variables:
1775.\" mode: nroff
1776.\" End: