root/trunk/sm5/smartctl.8.in @ 2270

Revision 2270, 59.8 KB (checked in by chrfranke, 8 years ago)

Windows: Added support for 3ware 9000 controllers.

Line 
1.ig
2 Copyright (C) 2002-6 Bruce Allen <smartmontools-support@lists.sourceforge.net>
3
4 $Id: smartctl.8.in,v 1.86 2006/09/27 21:42:03 chrfranke Exp $
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
57the final argument to \fBsmartctl\fP.  Device paths are as follows:
58.IP \fBLINUX\fP: 9
59Use the forms \fB"/dev/hd[a\-t]"\fP for IDE/ATA
60devices, and \fB"/dev/sd[a\-z]"\fP for SCSI devices. For
61SCSI Tape Drives and Changers with TapeAlert support use the devices
62\fB"/dev/nst*"\fP and \fB"/dev/sg*"\fP.
63For SATA disks accessed with libata, use \fB"/dev/sd[a\-z]"\fP
64and append \fB"\-d ata"\fP. For disks behind 3ware controllers
65you may need \fB"/dev/sd[a\-z]"\fP or \fB"/dev/twe[0\-9]"\fP
66or \fB"/dev/twa[0\-9]"\fP: see details below. For disks behind
67HighPoint RocketRAID controllers you may need \fB"/dev/sd[a\-z]"\fP.
68More general paths (such as devfs ones) may also be specified.
69.IP \fBDARWIN\fP: 9
70Use the forms \fB/dev/disk[0\-9]\fP or equivalently \fBdisk[0\-9]\fP or equivalently
71\fB/dev/rdisk[0\-9]\fP.  Long forms are also available: please use \'\-h\' to see some
72examples. Note that there is currently no Darwin SCSI support.
73.IP \fBFREEBSD\fP: 9
74Use the forms \fB"/dev/ad[0\-9]+"\fP for IDE/ATA
75devices and \fB"/dev/da[0\-9]+"\fP for SCSI devices.
76.IP \fBNETBSD/OPENBSD\fP: 9
77Use the form \fB"/dev/wd[0\-9]+c"\fP for IDE/ATA
78devices.  For SCSI disk and tape devices, use the device names
79\fB"/dev/sd[0\-9]+c"\fP and \fB"/dev/st[0\-9]+c"\fP respectively. 
80Be sure to specify the correct "whole disk" partition letter for
81your architecture.
82.IP \fBSOLARIS\fP: 9
83Use the forms \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
84devices, and \fB"/dev/rmt/*"\fP for SCSI tape devices.
85.IP \fBWINDOWS\fP: 9
86Use the forms \fB"/dev/hd[a\-j]"\fP for IDE/ATA devices
87"\\\\.\\PhysicalDrive[0\-9]" on WinNT4/2000/XP/2003,
88and \fB"/dev/scsi[0\-9][0\-f]"\fP for SCSI devices on ASPI adapter 0\-9, ID 0\-15.
89For IDE/ATA devices on Win95/98/98SE/ME, use \fB"/dev/hd[a\-d]"\fP for standard devices
90accessed via SMARTVSD.VXD, and \fB"/dev/hd[e\-h]"\fP for additional devices
91accessed via a patched SMARTVSE.VXD (see INSTALL file for details).
92For disks behind 3ware controllers use \fB"/dev/hd[a\-j],N"\fP where
93N specifies the disk number (3ware \'port\') behind the controller
94providing the logical drive (\'unit\') specified by \fB"/dev/hd[a\-j]"\fP.
95The option \'-d 3ware,N\' is not necessary on Windows.
96The prefix \fB"/dev/"\fP is optional.
97.IP \fBCYGWIN\fP: 9
98See "WINDOWS" above.
99.IP \fBOS/2,eComStation\fP: 9
100Use the form \fB"/dev/hd[a\-z]"\fP for IDE/ATA devices.
101.PP
102Based on the device path, \fBsmartctl\fP will guess the device type
103(ATA or SCSI).  If necessary, the \'\-d\' option can be used to over\-ride
104this guess
105
106Note that the printed output of \fBsmartctl\fP displays most numerical
107values in base 10 (decimal), but some values are displayed in base 16
108(hexadecimal).  To distinguish them, the base 16 values are always
109displayed with a leading \fB"0x"\fP, for example: "0xff". This man
110page follows the same convention.
111
112.PP
113.SH OPTIONS
114.PP
115The options are grouped below into several categories.  \fBsmartctl\fP
116will execute the corresponding commands in the order: INFORMATION,
117ENABLE/DISABLE, DISPLAY DATA, RUN/ABORT TESTS.
118
119SCSI devices only accept the options \fB\-h, \-V, \-i, \-a, \-A, \-d,
120\-s, \-S,\-H, \-t, \-C, \-l background, \-l error, \-l selftest, \-r,\fP
121and \fB\-X\fP.  TapeAlert devices only accept the options \fB\-h, \-V,
122\-i, \-a, \-A, \-d, \-s, \-S, \-t, \-l error, \-l selftest, \-r,\fP
123and \fB\-H\fP.
124
125Long options  are  not  supported  on  all  systems.   Use
126.B \'smartctl \-h\'
127to see the available options.
128
129.TP
130.B SHOW INFORMATION OPTIONS:
131.TP
132.B \-h, \-\-help, \-\-usage
133Prints a usage message to STDOUT and exits.
134.TP
135.B \-V, \-\-version, \-\-copyright, \-\-license
136Prints version, copyright, license, home page and CVS\-id information
137for your copy of \fBsmartctl\fP to STDOUT and then exits.  Please
138include this information if you are reporting bugs or problems.
139.TP
140.B \-i, \-\-info
141Prints the device model number, serial number, firmware version, and
142ATA Standard version/revision information.  Says if the device
143supports SMART, and if so, whether SMART support is currently enabled
144or disabled.  If the device supports Logical Block Address mode (LBA
145mode) print current user drive capacity in bytes. (If drive is has a
146user protected area reserved, or is "clipped", this may be smaller
147than the potential maximum drive capacity.)  Indicates if the drive is
148in the smartmontools database (see \'\-v\' options below).  If so, the
149drive model family may also be printed. If \'\-n\' (see below) is
150specified, the power mode of the drive is printed.
151.TP
152.B \-a, \-\-all
153Prints all SMART information about the disk, or TapeAlert information
154about the tape drive or changer.  For ATA devices this is equivalent
155to
156.nf
157\'\-H \-i \-c \-A \-l error \-l selftest -l selective\'
158.fi
159and for SCSI, this is equivalent to
160.nf
161\'\-H \-i \-A \-l error \-l selftest\'.
162.fi
163Note that for ATA disks this does \fBnot\fP enable the \'\-l
164directory\' option.
165
166.TP
167.B RUN\-TIME BEHAVIOR OPTIONS:
168.TP
169.B \-q TYPE, \-\-quietmode=TYPE
170Specifies that \fBsmartctl\fP should run in one of the two quiet modes
171described here.  The valid arguments to this option are:
172
173.I errorsonly
174\- only print: For the \'\-l error\' option, if nonzero, the number
175of errors recorded in the SMART error log and the power\-on time when
176they occurred; For the \'\-l selftest\' option, errors recorded in the device
177self\-test log; For the \'\-H\' option, SMART "disk failing" status or device
178Attributes (pre\-failure or usage) which failed either now or in the
179past; For the \'\-A\' option, device Attributes (pre\-failure or usage)
180which failed either now or in the past.
181
182.I silent
183\- print no output.  The only way to learn about what was found is to
184use the exit status of \fBsmartctl\fP (see RETURN VALUES below).
185.TP
186.B \-d TYPE, \-\-device=TYPE
187Specifies the type of the device.  The valid arguments to this option
188are \fIata\fP, \fIscsi\fP, \fIsat\fP, \fImarvell\fP, \fI3ware,N\fP, and \fIhpt,L/M\fP
189or \fIhpt,L/M/N\fP.  If this option is not used then \fBsmartctl\fP will attempt to
190guess the device type from the device name.
191
192The \'sat\' device type is for ATA disks that have a SCSI to ATA
193Translation (SAT) Layer (SATL) between the disk and the operating system.
194SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and
195the other 16 bytes long that \fBsmartctl\fP will utilize when this device
196type is selected. The default is the 16 byte variant which can be
197overridden with either \'\-d sat,12\' or \'\-d sat,16\'.
198
199Under Linux, to look at SATA disks behind Marvell SATA controllers
200(using Marvell's \'linuxIAL\' driver rather than libata driver) use \'\-d marvell\'. Such
201controllers show up as Marvell Technology Group Ltd. SATA I or II controllers
202using lspci, or using lspci -n show a vendor ID 0x11ab and a device ID of
203either 0x5040, 0x5041, 0x5080, 0x5081, 0x6041 or 0x6081. The \'linuxIAL\' driver
204seems not (yet?) available in the Linux kernel source tree, but should be available
205from system vendors (ftp://ftp.aslab.com/ is known to provide a patch with the driver).
206
207Under Linux and FreeBSD, to look at ATA disks behind 3ware SCSI RAID controllers,
208use syntax such as:
209.nf
210\fBsmartctl \-a \-d 3ware,2 /dev/sda\fP
211.fi
212.nf
213\fBsmartctl \-a \-d 3ware,0 /dev/twe0\fP
214.fi
215.nf
216\fBsmartctl \-a \-d 3ware,1 /dev/twa0\fP
217.fi
218where in the argument \fI3ware,N\fP, the integer N is the disk number
219(3ware \'port\') within the 3ware ATA RAID controller.  The allowed
220values of N are from 0 to 15 inclusive.  The first two forms, which
221refer to devices /dev/sda-z and /dev/twe0-15, may be used with 3ware
222series 6000, 7000, and 8000 series controllers that use the 3x-xxxx
223driver.  \fBNote that the /dev/sda-z form is deprecated\fP starting
224with the Linux 2.6 kernel series and may not be supported by the Linux
225kernel in the near future. The final form, which refers to devices
226/dev/twa0-15, must be used with 3ware 9000 series controllers, which
227use the 3w-9xxx driver.
228
229Note that if the special character device nodes /dev/twa? and
230/dev/twe? do not exist, or exist with the incorrect major or minor
231numbers, smartctl will recreate them on the fly.  Typically /dev/twa0
232refers to the first 9000-series controller, /dev/twa1 refers to the
233second 9000 series controller, and so on. Likewise /dev/twe0 refers to
234the first 6/7/8000-series controller, /dev/twa1 refers to the second
2356/7/8000 series controller, and so on.
236
237Note that for the 6/7/8000 controllers, \fBany\fP of the physical
238disks can be queried or examined using \fBany\fP of the 3ware's SCSI
239logical device /dev/sd?  entries.  Thus, if logical device /dev/sda is
240made up of two physical disks (3ware ports zero and one) and logical
241device /dev/sdb is made up of two other physical disks (3ware ports
242two and three) then you can examine the SMART data on \fBany\fP of the
243four physical disks using \fBeither\fP SCSI device /dev/sda \fBor\fP
244/dev/sdb.  If you need to know which logical SCSI device a particular
245physical disk (3ware port) is associated with, use the dmesg or SYSLOG
246output to show which SCSI ID corresponds to a particular 3ware unit,
247and then use the 3ware CLI or 3dm tool to determine which ports
248(physical disks) correspond to particular 3ware units.
249
250If the value of N corresponds to a port that does \fBnot\fP exist on
251the 3ware controller, or to a port that does not physically have a
252disk attached to it, the behavior of \fBsmartctl\fP depends upon the
253specific controller model, firmware, Linux kernel and platform.  In
254some cases you will get a warning message that the device does not
255exist. In other cases you will be presented with \'void\' data for a
256non\-existent device.
257
258Note that if the /dev/sd? addressing form is used, then older 3w\-xxxx
259drivers do not pass the "Enable Autosave"
260(\'\fB\-S on\fP\') and "Enable Automatic Offline" (\'\fB\-o on\fP\')
261commands to the disk, and produce these types of harmless syslog error
262messages instead: "\fB3w\-xxxx: tw_ioctl(): Passthru size (123392) too
263big\fP". This can be fixed by upgrading to version 1.02.00.037 or
264later of the 3w\-xxxx driver, or by applying a patch to older
265versions. See \fBhttp://smartmontools.sourceforge.net/\fP for
266instructions.  Alternatively, use the character device /dev/twe0-15 interface.
267
268The selective self\-test functions (\'\-t select,A\-B\') are only supported
269using the character device interface /dev/twa0\-15 and /dev/twe0\-15.
270The necessary WRITE LOG commands can not be passed through the SCSI
271interface.
272
273.B 3ware controllers are supported under Linux, FreeBSD and Windows.
274
275To look at (S)ATA disks behind HighPoint RocketRAID controllers, use syntax
276such as:
277.nf
278\fBsmartctl \-a \-d hpt,1/3 /dev/sda\fP
279.fi
280or
281.nf
282\fBsmartctl \-a \-d hpt,1/2/3 /dev/sda\fP
283.fi
284where in the argument \fIhpt,L/M\fP or \fIhpt,L/M/N\fP, the integer L is the
285controller id, the integer M is the channel number, and the integer N is the
286PMPort number if it is available. The allowed values of L are from 1 to 4
287inclusive, M are from 1 to 8 inclusive and N from 1 to 4 if PMPort available.
288Note that the /dev/sda-z form should be the device node which stands for
289the disks derived from the HighPoint RocketRAID controllers.  And also
290these values are limited by the model of the HighPoint RocketRAID controller.
291
292.B HighPoint RocketRAID controllers are currently ONLY supported under Linux.
293
294.TP
295.B \-T TYPE, \-\-tolerance=TYPE
296Specifies how tolerant \fBsmartctl\fP should be of ATA and SMART command
297failures.
298
299The behavior of \fBsmartctl\fP depends upon whether the command is
300"\fBoptional\fP" or "\fBmandatory\fP". Here "\fBmandatory\fP" means
301"required by the ATA/ATAPI\-5 Specification if the device implements
302the SMART command set" and "\fBoptional\fP" means "not required by the
303ATA/ATAPI\-5 Specification even if the device implements the SMART
304command set."  The "\fBmandatory\fP" ATA and SMART commands are: (1)
305ATA IDENTIFY DEVICE, (2) SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE, (3)
306SMART ENABLE/DISABLE, and (4) SMART RETURN STATUS.
307
308The valid arguments to this option are:
309
310.I normal
311\- exit on failure of any \fBmandatory\fP SMART command, and ignore
312all failures of \fBoptional\fP SMART commands.  This is the default.
313Note that on some devices, issuing unimplemented optional SMART
314commands doesn\'t cause an error.  This can result in misleading
315\fBsmartctl\fP messages such as "Feature X not implemented", followed
316shortly by "Feature X: enabled".  In most such cases, contrary to the
317final message, Feature X is \fBnot\fP enabled.
318
319.I conservative
320\- exit on failure of any \fBoptional\fP SMART command.
321
322.I permissive
323\- ignore failure(s) of \fBmandatory\fP SMART commands.  This option
324may be given more than once.  Each additional use of this option will
325cause one more additional failure to be ignored.  Note that the use of
326this option can lead to messages like "Feature X not implemented",
327followed shortly by "Error: unable to enable Feature X".  In a few
328such cases, contrary to the final message, Feature X \fBis\fP enabled.
329
330.I verypermissive
331\- equivalent to giving a large number of \'\-T permissive\' options:
332ignore failures of \fBany number\fP of \fBmandatory\fP SMART commands.
333Please see the note above.
334
335.TP
336.B \-b TYPE, \-\-badsum=TYPE
337Specifies the action \fBsmartctl\fP should take if a checksum error is
338detected in the: (1) Device Identity Structure, (2) SMART Self\-Test
339Log Structure, (3) SMART Attribute Value Structure, (4) SMART
340Attribute Threshold Structure, or (5) ATA Error Log Structure.
341
342The valid arguments to this option are:
343
344.I warn
345\- report the incorrect checksum but carry on in spite of it.  This is the
346default.
347
348.I exit
349\- exit \fBsmartctl\fP.
350
351.I ignore
352\- continue silently without issuing a warning.
353
354.TP
355.B \-r TYPE, \-\-report=TYPE
356Intended primarily to help \fBsmartmontools\fP developers understand
357the behavior of \fBsmartmontools\fP on non\-conforming or poorly
358conforming hardware.  This option reports details of \fBsmartctl\fP
359transactions with the device.  The option can be used multiple times.
360When used just once, it shows a record of the ioctl() transactions
361with the device.  When used more than once, the detail of these
362ioctl() transactions are reported in greater detail.  The valid
363arguments to this option are:
364
365.I ioctl
366\- report all ioctl() transactions.
367
368.I ataioctl
369\- report only ioctl() transactions with ATA devices.
370
371.I scsiioctl
372\- report only ioctl() transactions with SCSI devices. Invoking this once
373shows the SCSI commands in hex and the corresponding status. Invoking
374it a second time adds a hex listing of the first 64 bytes of data send to,
375or received from the device.
376
377Any argument may include a positive integer to specify the level of detail
378that should be reported.  The argument should be followed by a comma then
379the integer with no spaces.  For example,
380.I ataioctl,2
381The default
382level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are equivalent.
383
384.TP
385.B \-n POWERMODE, \-\-nocheck=POWERMODE
386Specifieds if \fBsmartctl\fP should exit before performing any checks
387when the device is in a low\-power mode. It may be used to prevent a disk
388from being spun\-up by \fBsmartctl\fP. The power mode is ignored by
389default. The allowed values of POWERMODE are:
390
391.I never
392\- check the device always, but print the power mode if \'\-i\' is
393specified.
394
395.I sleep
396\- check the device unless it is in SLEEP mode.
397
398.I standby
399\- check the device unless it is in SLEEP or STANDBY mode.  In
400these modes most disks are not spinning, so if you want to prevent
401a disk from spinning up, this is probably what you want.
402
403.I idle
404\- check the device unless it is in SLEEP, STANDBY or IDLE mode.
405In the IDLE state, most disks are still spinning, so this is probably
406not what you want.
407
408.TP
409.B SMART FEATURE ENABLE/DISABLE COMMANDS:
410.IP
411.B Note:
412if multiple options are used to both enable and disable a
413feature, then
414.B both
415the enable and disable commands will be issued.  The enable command
416will always be issued
417.B before
418the corresponding disable command.
419.TP
420.B \-s VALUE, \-\-smart=VALUE
421Enables or disables SMART on device.  The valid arguments to
422this option are \fIon\fP and \fIoff\fP.  Note that the command \'\-s on\'
423(perhaps used with with the \'\-o on\' and \'\-S on\' options) should be placed
424in a start\-up script for your machine, for example in rc.local or rc.sysinit.
425In principle the SMART feature settings are preserved over
426power\-cycling, but it doesn\'t hurt to be sure. It is not necessary (or
427useful) to enable SMART to see the TapeAlert messages.
428.TP
429.B \-o VALUE, \-\-offlineauto=VALUE
430Enables or disables SMART automatic offline test, which scans the drive
431every four hours for disk defects. This command can be given during normal
432system operation.  The valid arguments to this option are \fIon\fP
433and \fIoff\fP.
434
435Note that the SMART automatic offline test command is listed as
436"Obsolete" in every version of the ATA and ATA/ATAPI Specifications.
437It was originally part of the SFF\-8035i Revision 2.0 specification,
438but was never part of any ATA specification.  However it is
439implemented and used by many vendors. [Good documentation can be found
440in IBM\'s Official Published Disk Specifications.  For example the IBM
441Travelstar 40GNX Hard Disk Drive Specifications (Revision 1.1, 22
442April 2002, Publication # 1541, Document S07N\-7715\-02) page 164. You
443can also read the SFF\-8035i Specification \-\- see REFERENCES below.]
444You can tell if automatic offline testing is supported by seeing if
445this command enables and disables it, as indicated by the \'Auto
446Offline Data Collection\' part of the SMART capabilities report
447(displayed with \'\-c\').
448
449SMART provides \fBthree\fP basic categories of testing.  The
450\fBfirst\fP category, called "online" testing, has no effect on the
451performance of the device.  It is turned on by the \'\-s on\' option.
452
453The \fBsecond\fP category of testing is called "offline" testing. This
454type of test can, in principle, degrade the device performance.  The
455\'\-o on\' option causes this offline testing to be carried out,
456automatically, on a regular scheduled basis.  Normally, the disk will
457suspend offline testing while disk accesses are taking place, and then
458automatically resume it when the disk would otherwise be idle, so in
459practice it has little effect.  Note that a one\-time offline test can
460also be carried out immediately upon receipt of a user command.  See
461the \'\-t offline\' option below, which causes a one\-time offline test
462to be carried out immediately.
463
464The choice (made by the SFF\-8035i and ATA specification authors) of
465the word \fItesting\fP for these first two categories is unfortunate,
466and often leads to confusion.  In fact these first two categories of
467online and offline testing could have been more accurately described
468as online and offline \fBdata collection\fP.
469
470The results of this automatic or immediate offline testing (data
471collection) are reflected in the values of the SMART Attributes.
472Thus, if problems or errors are detected, the values of these
473Attributes will go below their failure thresholds; some types of
474errors may also appear in the SMART error log. These are visible with
475the \'\-A\' and \'\-l error\' options respectively.
476
477Some SMART attribute values are updated only during off\-line data
478collection activities; the rest are updated during normal operation of
479the device or during both normal operation and off\-line testing.  The
480Attribute value table produced by the \'\-A\' option indicates this in
481the UPDATED column.  Attributes of the first type are labeled
482"Offline" and Attributes of the second type are labeled "Always".
483
484The \fBthird\fP category of testing (and the \fIonly\fP category for
485which the word \'testing\' is really an appropriate choice) is "self"
486testing.  This third type of test is only performed (immediately) when
487a command to run it is issued.  The \'\-t\' and \'\-X\' options can be
488used to carry out and abort such self\-tests; please see below for
489further details.
490
491Any errors detected in the self testing will be shown in the
492SMART self\-test log, which can be examined using the \'\-l selftest\'
493option.
494
495\fBNote:\fP in this manual page, the word \fB"Test"\fP is used in
496connection with the second category just described, e.g. for the
497"offline" testing.  The words \fB"Self\-test"\fP are used in
498connection with the third category.
499.TP
500.B \-S VALUE, \-\-saveauto=VALUE
501Enables or disables SMART autosave of device vendor\-specific
502Attributes. The valid arguments to this option are \fIon\fP
503and \fIoff\fP.  Note that this feature is preserved across disk power
504cycles, so you should only need to issue it once.
505
506For SCSI devices this toggles the value of the Global Logging Target
507Save Disabled (GLTSD) bit in the Control Mode Page. Some disk
508manufacturers set this bit by default. This prevents error counters,
509power\-up hours and other useful data from being placed in non\-volatile
510storage, so these values may be reset to zero the next time the device
511is power\-cycled.  If the GLTSD bit is set then \'smartctl \-a\' will
512issue a warning. Use \fIon\fP to clear the GLTSD bit and thus enable
513saving counters to non\-volatile storage. For extreme streaming\-video
514type applications you might consider using \fIoff\fP to set the GLTSD
515bit.
516
517.TP
518.B SMART READ AND DISPLAY DATA OPTIONS:
519.TP
520.B \-H, \-\-health
521Check: Ask the device to report its SMART health status or pending
522TapeAlert messages.  SMART status is based on
523information that it has gathered from online and offline
524tests, which were used to determine/update its
525SMART vendor\-specific Attribute values. TapeAlert status is obtained
526by reading the TapeAlert log page.
527
528If the device reports failing health status, this means
529.B either
530that the device has already failed,
531.B or
532that it is predicting its own failure within the next 24 hours.  If
533this happens, use the \'\-a\' option to get more information, and
534.B get your data off the disk and someplace safe as soon as you can.
535.TP
536.B \-c, \-\-capabilities
537Prints only the generic SMART capabilities.  These show
538what SMART features are implemented and how the device will
539respond to some of the different SMART commands.  For example it
540shows if the device logs errors, if it supports offline surface
541scanning, and so on.  If the device can carry out self\-tests, this
542option also shows the estimated time required to run those tests.
543
544Note that the time required to run the Self\-tests (listed in minutes)
545are fixed.  However the time required to run the Immediate Offline
546Test (listed in seconds) is variable.  This means that if you issue a
547command to perform an Immediate Offline test with the \'\-t offline\' option,
548then the time may jump to a larger value and then count down as the
549Immediate Offline Test is carried out.  Please see REFERENCES below
550for further information about the the flags and capabilities described
551by this option.
552.TP
553.B \-A, \-\-attributes
554Prints only the vendor specific SMART Attributes.  The Attributes are
555numbered from 1 to 253 and have specific names and ID numbers. For
556example Attribute 12 is "power cycle count": how many times has the
557disk been powered up.
558
559Each Attribute has a "Raw" value, printed under the heading
560"RAW_VALUE", and a "Normalized" value printed under the heading
561"VALUE".  [Note: \fBsmartctl\fP prints these values in base\-10.]  In
562the example just given, the "Raw Value" for Attribute 12 would be the
563actual number of times that the disk has been power\-cycled, for
564example 365 if the disk has been turned on once per day for exactly
565one year.  Each vendor uses their own algorithm to convert this "Raw"
566value to a "Normalized" value in the range from 1 to 254.  Please keep
567in mind that \fBsmartctl\fP only reports the different Attribute
568types, values, and thresholds as read from the device.  It does
569\fBnot\fP carry out the conversion between "Raw" and "Normalized"
570values: this is done by the disk\'s firmware.
571
572The conversion from Raw value to a quantity with physical units is
573not specified by the SMART standard. In most cases, the values printed
574by \fBsmartctl\fP are sensible.  For example the temperature Attribute
575generally has its raw value equal to the temperature in Celsius.
576However in some cases vendors use unusual conventions.  For example
577the Hitachi disk on my laptop reports its power\-on hours in minutes,
578not hours. Some IBM disks track three temperatures rather than one, in
579their raw values.  And so on.
580
581Each Attribute also has a Threshold value (whose range is 0 to 255)
582which is printed under the heading "THRESH".  If the Normalized value
583is \fBless than or equal to\fP the Threshold value, then the Attribute
584is said to have failed.  If the Attribute is a pre\-failure Attribute,
585then disk failure is imminent.
586
587Each Attribute also has a "Worst" value shown under the heading
588"WORST".  This is the smallest (closest to failure) value that the
589disk has recorded at any time during its lifetime when SMART was
590enabled.  [Note however that some vendors firmware may actually
591\fBincrease\fP the "Worst" value for some "rate\-type" Attributes.]
592
593The Attribute table printed out by \fBsmartctl\fP also shows the
594"TYPE" of the Attribute. Attributes are one of two possible types:
595Pre\-failure or Old age.  Pre\-failure Attributes are ones which, if
596less than or equal to their threshold values, indicate pending disk
597failure.  Old age, or usage Attributes, are ones which indicate
598end\-of\-product life from old\-age or normal aging and wearout, if
599the Attribute value is less than or equal to the threshold.  \fBPlease
600note\fP: the fact that an Attribute is of type 'Pre\-fail' does
601\fBnot\fP mean that your disk is about to fail!  It only has this
602meaning if the Attribute\'s current Normalized value is less than or
603equal to the threshold value.
604
605If the Attribute\'s current Normalized value is less than or equal to
606the threshold value, then the "WHEN_FAILED" column will display
607"FAILING_NOW". If not, but the worst recorded value is less than or
608equal to the threshold value, then this column will display
609"In_the_past".  If the "WHEN_FAILED" column has no entry (indicated by
610a dash: \'\-\') then this Attribute is OK now (not failing) and has
611also never failed in the past.
612
613The table column labeled "UPDATED" shows if the SMART Attribute values
614are updated during both normal operation and off\-line testing, or
615only during offline testing.  The former are labeled "Always" and the
616latter are labeled "Offline".
617
618So to summarize: the Raw Attribute values are the ones that might have
619a real physical interpretation, such as "Temperature Celsius",
620"Hours", or "Start\-Stop Cycles".  Each manufacturer converts these,
621using their detailed knowledge of the disk\'s operations and failure
622modes, to Normalized Attribute values in the range 1\-254.  The
623current and worst (lowest measured) of these Normalized Attribute
624values are stored on the disk, along with a Threshold value that the
625manufacturer has determined will indicate that the disk is going to
626fail, or that it has exceeded its design age or aging limit.
627\fBsmartctl\fP does \fBnot\fP calculate any of the Attribute values,
628thresholds, or types, it merely reports them from the SMART data on
629the device.
630
631Note that starting with ATA/ATAPI\-4, revision 4, the meaning of these
632Attribute fields has been made entirely vendor\-specific.  However most
633ATA/ATAPI\-5 disks seem to respect their meaning, so we have retained
634the option of printing the Attribute values.
635
636For SCSI devices the "attributes" are obtained from the temperature
637and start-stop cycle counter log pages. Certain vendor specific
638attributes are listed if recognised. The attributes are output in a
639relatively free format (compared with ATA disk attributes).
640.TP
641.B \-l TYPE, \-\-log=TYPE
642Prints either the SMART Error Log, the SMART Self\-Test Log, the SMART
643Selective Self\-Test Log [ATA only], the Log Directory [ATA only], or
644the Background Scan Results Log [SCSI only].
645The valid arguments to this option are:
646
647.I error
648\- prints only the SMART error log.  SMART disks maintain a log of the
649most recent five non\-trivial errors. For each of these errors, the
650disk power\-on lifetime at which the error occurred is recorded, as is
651the device status (idle, standby, etc) at the time of the error.  For
652some common types of errors, the Error Register (ER) and Status
653Register (SR) values are decoded and printed as text. The meanings of these
654are:
655.nf
656   \fBABRT\fP:  Command \fBAB\fPo\fBRT\fPed
657   \fBAMNF\fP:  \fBA\fPddress \fBM\fPark \fBN\fPot \fBF\fPound
658   \fBCCTO\fP:  \fBC\fPommand \fBC\fPompletion \fBT\fPimed \fBO\fPut
659   \fBEOM\fP:   \fBE\fPnd \fBO\fPf \fBM\fPedia
660   \fBICRC\fP:  \fBI\fPnterface \fBC\fPyclic \fBR\fPedundancy \fBC\fPode (CRC) error
661   \fBIDNF\fP:  \fBID\fPentity \fBN\fPot \fBF\fPound
662   \fBILI\fP:   (packet command\-set specific)
663   \fBMC\fP:    \fBM\fPedia \fBC\fPhanged
664   \fBMCR\fP:   \fBM\fPedia \fBC\fPhange \fBR\fPequest
665   \fBNM\fP:    \fBN\fPo \fBM\fPedia
666   \fBobs\fP:   \fBobs\fPolete
667   \fBTK0NF\fP: \fBT\fPrac\fBK 0 N\fPot \fBF\fPound
668   \fBUNC\fP:   \fBUNC\fPorrectable Error in Data
669   \fBWP\fP:    Media is \fBW\fPrite \fBP\fProtected
670.fi
671In addition, up to the last five commands that preceded the error are
672listed, along with a timestamp measured from the start of the
673corresponding power cycle. This is displayed in the form
674Dd+HH:MM:SS.msec where D is the number of days, HH is hours, MM is
675minutes, SS is seconds and msec is milliseconds.  [Note: this time
676stamp wraps after 2^32 milliseconds, or 49 days 17 hours 2 minutes and
67747.296 seconds.]  The key ATA disk registers are also recorded in the
678log.  The final column of the error log is a text\-string description
679of the ATA command defined by the Command Register (CR) and Feature
680Register (FR) values.  Commands that are obsolete in the most current
681(ATA\-7) spec are listed like this: \fBREAD LONG (w/ retry) [OBS\-4]\fP,
682indicating that the command became obsolete with or in the ATA\-4
683specification.  Similarly, the notation \fB[RET\-\fP\fIN\fP\fB]\fP is
684used to indicate that a command was retired in the ATA\-\fIN\fP
685specification.  Some commands are not defined in any version of the
686ATA specification but are in common use nonetheless; these are marked
687\fB[NS]\fP, meaning non\-standard.
688
689The ATA Specification (ATA\-5 Revision 1c, Section 8.41.6.8.2) says:
690\fB"Error log structures shall include UNC errors, IDNF errors for
691which the address requested was valid, servo errors, write fault
692errors, etc.  Error log data structures shall not include errors
693attributed to the receipt of faulty commands such as command codes not
694implemented by the device or requests with invalid parameters or
695invalid addresses."\fP The definitions of these terms are:
696.br
697\fBUNC\fP (\fBUNC\fPorrectable): data is uncorrectable.  This refers
698to data which has been read from the disk, but for which the Error
699Checking and Correction (ECC) codes are inconsistent.  In effect, this
700means that the data can not be read.
701.br
702\fBIDNF\fP (\fBID N\fPot \fBF\fPound): user\-accessible address could
703not be found. For READ LOG type commands, \fBIDNF\fP can also indicate
704that a device data log structure checksum was incorrect.
705
706If the command that caused the error was a READ or WRITE command, then
707the Logical Block Address (LBA) at which the error occurred will be
708printed in base 10 and base 16.  The LBA is a linear address, which
709counts 512\-byte sectors on the disk, starting from zero.  (Because of
710the limitations of the SMART error log, if the LBA is greater than
7110xfffffff, then either no error log entry will be made, or the error
712log entry will have an incorrect LBA. This may happen for drives with
713a capacity greater than 128 GiB or 137 GB.) On Linux systems the
714smartmontools web page has instructions about how to convert the LBA
715address to the name of the disk file containing the erroneous disk
716sector.
717
718Please note that some manufacturers \fBignore\fP the ATA
719specifications, and make entries in the error log if the device
720receives a command which is not implemented or is not valid.
721
722.I error [SCSI]
723\- prints the error counter log pages for reads, write and verifies.
724The verify row is only output if it has an element other than zero.
725
726.I selftest
727\- prints the SMART self\-test log.  The disk maintains a self\-test log
728showing the results of the self tests, which can be run using the
729\'\-t\' option described below.  For each of the most recent
730twenty\-one self\-tests, the log shows the type of test (short or
731extended, off\-line or captive) and the final status of the test.  If
732the test did not complete successfully, then the percentage of the
733test remaining is shown.  The time at which the test took place,
734measured in hours of disk lifetime, is also printed.  If any errors
735were detected, the Logical Block Address (LBA) of the first error is
736printed in decimal notation. On Linux systems the smartmontools
737web page has instructions about how to convert this LBA address to the
738name of the disk file containing the erroneous block.
739
740.I selftest [SCSI]
741\- the self\-test log for a SCSI device has a slightly different format
742than for an ATA device.  For each of the most recent twenty
743self\-tests, it shows the type of test and the status (final or in
744progress) of the test. SCSI standards use the terms "foreground" and
745"background" (rather than ATA\'s corresponding "captive" and
746"off\-line") and "short" and "long" (rather than ATA\'s corresponding
747"short" and "extended") to describe the type of the test.  The printed
748segment number is only relevant when a test fails in the third or
749later test segment.  It identifies the test that failed and consists
750of either the number of the segment that failed during the test, or
751the number of the test that failed and the number of the segment in
752which the test was run, using a vendor\-specific method of putting both
753numbers into a single byte.  The Logical Block Address (LBA) of the
754first error is printed in hexadecimal notation.  On Linux systems the
755smartmontools web page has instructions about how to convert this LBA
756address to the name of the disk file containing the erroneous block.
757If provided, the SCSI Sense Key (SK), Additional Sense Code (ASC) and
758Additional Sense Code Qualifier (ASQ) are also printed. The self tests
759can be run using the \'\-t\' option described below (using the ATA
760test terminology).
761
762.I selective [ATA]
763\- Some ATA\-7 disks (example: Maxtor) also maintain a selective
764self\-test log.  Please see the \'\-t select\' option below for a
765description of selective self\-tests.  The selective self\-test log
766shows the start/end Logical Block Addresses (LBA) of each of the five
767test spans, and their current test status.  If the span is being
768tested or the remainder of the disk is being read\-scanned, the
769current 65536\-sector block of LBAs being tested is also displayed.
770The selective self\-test log also shows if a read\-scan of the
771remainder of the disk will be carried out after the selective
772self\-test has completed (see \'\-t afterselect\' option) and the time
773delay before restarting this read\-scan if it is interrupted (see
774\'\-t pending\' option). This is a new smartmontools feature; please
775report unusual or incorrect behavior to the smartmontools\-support
776mailing list.
777
778.I directory
779\- if the device supports the General Purpose Logging feature set
780(ATA\-6 and ATA\-7 only) then this prints the Log Directory (the log at
781address 0).  The Log Directory shows what logs are available and their
782length in sectors (512 bytes).  The contents of the logs at address 1
783[Summary SMART error log] and at address 6 [SMART self\-test log] may
784be printed using the previously\-described
785.I error
786and
787.I selftest
788arguments to this option. [Please note: this is a new, experimental
789feature.  We would like to add support for printing the contents of
790extended and comprehensive SMART self\-test and error logs.  If your
791disk supports these, and you would like to assist, please contact the
792\fBsmartmontools\fP developers.]
793
794.I background [SCSI]
795\- the background scan results log outputs information derived from
796Background Media Scans (BMS) done after power up and/or periodocally (e.g.
797every 24 hours) on recent SCSI disks. If supported, the BMS status
798is output first, indicating whether a background scan is currently
799underway (and if so a progress percentage), the amount of time the disk
800has been powered up and the number of scans already completed. Then there
801is a header and a line for each background scan "event". These will
802typically be either recovered or unrecoverable errors. That latter group
803may need some attention. There is a description of the background scan
804mechansim in section 4.18 of SBC\-3 revision 6 (see www.t10.org ).
805
806.TP
807.B \-v N,OPTION, \-\-vendorattribute=N,OPTION
808Sets a vendor\-specific display OPTION for Attribute N.  This option
809may be used multiple times. Valid arguments to this option are:
810
811.I help
812\- Prints (to STDOUT) a list of all valid arguments to this option,
813then exits.
814
815.I 9,minutes
816\- Raw Attribute number 9 is power\-on time in minutes.  Its raw value
817will be displayed in the form "Xh+Ym".  Here X is hours, and Y is
818minutes in the range 0\-59 inclusive.  Y is always printed with two
819digits, for example "06" or "31" or "00".
820
821.I 9,seconds
822\- Raw Attribute number 9 is power\-on time in seconds.  Its raw value
823will be displayed in the form "Xh+Ym+Zs".  Here X is hours, Y is
824minutes in the range 0\-59 inclusive, and Z is seconds in the range
8250\-59 inclusive.  Y and Z are always printed with two digits, for
826example "06" or "31" or "00".
827
828.I 9,halfminutes
829\- Raw Attribute number 9 is power\-on time, measured in units of 30
830seconds.  This format is used by some Samsung disks.  Its raw value
831will be displayed in the form "Xh+Ym".  Here X is hours, and Y is
832minutes in the range 0\-59 inclusive.  Y is always printed with two
833digits, for example "06" or "31" or "00".
834
835.I 9,temp
836\- Raw Attribute number 9 is the disk temperature in Celsius.
837
838.I 192,emergencyretractcyclect
839\- Raw Attribute number 192 is the Emergency Retract Cycle Count.
840
841.I 193,loadunload
842\- Raw Attribute number 193 contains two values. The first is the
843number of load cycles.  The second is the number of unload cycles.
844The difference between these two values is the number of times that
845the drive was unexpectedly powered off (also called an emergency
846unload). As a rule of thumb, the mechanical stress created by one
847emergency unload is equivalent to that created by one hundred normal
848unloads.
849
850.I 194,10xCelsius
851\- Raw Attribute number 194 is ten times the disk temperature in
852Celsius.  This is used by some Samsung disks (example: model SV1204H
853with RK100\-13 firmware).
854
855.I 194,unknown
856\- Raw Attribute number 194 is NOT the disk temperature, and its
857interpretation is unknown. This is primarily useful for the \-P
858(presets) option.
859
860.I 198,offlinescanuncsectorct
861\- Raw Attribute number 198 is the Offline Scan UNC Sector Count.
862
863.I 200,writeerrorcount
864\- Raw Attribute number 200 is the Write Error Count.
865
866.I 201,detectedtacount
867\- Raw Attribute number 201 is the Detected TA Count.
868
869.I 220,temp
870\- Raw Attribute number 220 is the disk temperature in Celsius.
871
872Note: a table of hard drive models, listing which Attribute
873corresponds to temperature, can be found at:
874\fBhttp://www.guzu.net/linux/hddtemp.db\fP
875
876.I N,raw8
877\- Print the Raw value of Attribute N as six 8\-bit unsigned base\-10
878integers.  This may be useful for decoding the meaning of the Raw
879value.  The form \'N,raw8\' prints Raw values for ALL Attributes in this
880form.  The form (for example) \'123,raw8\' only prints the Raw value for
881Attribute 123 in this form.
882
883.I N,raw16
884\- Print the Raw value of Attribute N as three 16\-bit unsigned base\-10
885integers.  This may be useful for decoding the meaning of the Raw
886value.  The form \'N,raw16\' prints Raw values for ALL Attributes in this
887form.  The form (for example) \'123,raw16\' only prints the Raw value for
888Attribute 123 in this form.
889
890.I N,raw48
891\- Print the Raw value of Attribute N as a 48\-bit unsigned base\-10
892integer.  This may be useful for decoding the meaning of the Raw
893value.  The form \'N,raw48\' prints Raw values for ALL Attributes in
894this form.  The form (for example) \'123,raw48\' only prints the Raw
895value for Attribute 123 in this form.
896
897.TP
898.B \-F TYPE, \-\-firmwarebug=TYPE
899Modifies the behavior of \fBsmartctl\fP to compensate for some known
900and understood device firmware bug.  The arguments to this option are
901exclusive, so that only the final option given is used.  The valid
902values are:
903
904.I none
905\- Assume that the device firmware obeys the ATA specifications.  This
906is the default, unless the device has presets for \'\-F\' in the
907device database (see note below).
908
909.I samsung
910\- In some Samsung disks (example: model SV4012H Firmware Version:
911RM100\-08) some of the two\- and four\-byte quantities in the SMART data
912structures are byte\-swapped (relative to the ATA specification).
913Enabling this option tells \fBsmartctl\fP to evaluate these quantities
914in byte\-reversed order.  Some signs that your disk needs this option
915are (1) no self\-test log printed, even though you have run self\-tests;
916(2) very large numbers of ATA errors reported in the ATA error log;
917(3) strange and impossible values for the ATA error log timestamps.
918
919.I samsung2
920\- In more recent Samsung disks (firmware revisions ending in "\-23")
921the number of ATA errors reported is byte swapped.  Enabling this
922option tells \fBsmartctl\fP to evaluate this quantity in
923byte\-reversed order. An indication that your Samsung disk needs this
924option is that the self-test log is printed correctly, but there are a
925very large number of errors in the SMART error log.  This is because
926the error count is byte swapped.  Thus a disk with five errors
927(0x0005) will appear to have 20480 errors (0x5000).
928
929Note that an explicit \'\-F\' option on the command line will
930over\-ride any preset values for \'\-F\' (see the \'\-P\' option
931below).
932
933.TP
934.B \-P TYPE, \-\-presets=TYPE
935Specifies whether \fBsmartctl\fP should use any preset options that
936are available for this drive. By default, if the drive is recognized
937in the \fBsmartmontools\fP database, then the presets are used.
938
939\fBsmartctl\fP can automatically set appropriate options for known
940drives.  For example, the Maxtor 4D080H4 uses Attribute 9 to stores
941power\-on time in minutes whereas most drives use that Attribute to
942store the power\-on time in hours.  The command\-line option \'\-v
9439,minutes\' ensures that \fBsmartctl\fP correctly interprets Attribute
9449 in this case, but that option is preset for the Maxtor 4D080H4 and
945so need not be specified by the user on the \fBsmartctl\fP command
946line.
947
948The argument
949.I show
950will show any preset options for your drive and the argument
951.I showall
952will show all known drives in the \fBsmartmontools\fP database, along
953with their preset options.  If there are no presets for your drive and
954you think there should be (for example, a \-v or \-F option is needed
955to get \fBsmartctl\fP to display correct values) then please contact
956the \fBsmartmontools\fP developers so that this information can be
957added to the \fBsmartmontools\fP database.  Contact information is at the
958end of this man page.
959
960The valid arguments to this option are:
961
962.I use
963\- if a drive is recognized, then use the stored presets for it.  This
964is the default. Note that presets will NOT over\-ride additional
965Attribute interpretation (\'\-v N,something\') command\-line options or
966explicit \'\-F\' command\-line options..
967
968.I ignore
969\- do not use presets.
970
971.I show
972\- show if the drive is recognized in the database, and if so, its
973presets, then exit.
974
975.I showall
976\- list all recognized drives, and the presets that are set for them,
977then exit.
978
979The \'\-P showall\' option takes up to two optional arguments to
980match a specific drive type and firmware version. The command:
981.nf
982  smartctl \-P showall
983.fi
984lists all entries, the command:
985.nf
986  smartctl \-P showall \'MODEL\'
987.fi
988lists all entries matching MODEL, and the command:
989.nf
990  smartctl \-P showall \'MODEL\' \'FIRMWARE\'
991.fi
992lists all entries for this MODEL and a specific FIRMWARE version.
993
994.TP
995.B SMART RUN/ABORT OFFLINE TEST AND SELF\-TEST OPTIONS:
996.TP
997.B \-t TEST, \-\-test=TEST
998Executes TEST immediately.  The \'\-C\' option can be used in
999conjunction with this option to run the short or long (and also for
1000ATA devices, selective or conveyance) self\-tests in captive mode
1001(known as "foreground mode" for SCSI devices).  Note that only one
1002test type can be run at a time, so only one test type should be
1003specified per command line.  Note also that if a computer is shutdown
1004or power cycled during a self\-test, no harm should result.  The
1005self\-test will either be aborted or will resume automatically.
1006
1007The valid arguments to this option are: 
1008
1009.I offline
1010\- runs SMART Immediate Offline Test.  This immediately
1011starts the test described above.  This command can be given during
1012normal system operation.  The effects of this test are visible only in
1013that it updates the SMART Attribute values, and if errors are
1014found they will appear in the SMART error log, visible with the \'\-l error\'
1015option. [In the case of SCSI devices runs the default self test in
1016foreground. No entry is placed in the self test log.]
1017
1018If the \'\-c\' option to \fBsmartctl\fP shows that the device has the
1019"Suspend Offline collection upon new command" capability then you can
1020track the progress of the Immediate Offline test using the \'\-c\'
1021option to \fBsmartctl\fP.  If the \'\-c\' option show that the device
1022has the "Abort Offline collection upon new command" capability then
1023most commands will abort the Immediate Offline Test, so you should not
1024try to track the progress of the test with \'\-c\', as it will abort
1025the test.
1026
1027.I short
1028\- runs SMART Short Self Test (usually under ten minutes).
1029[Note: in the case of SCSI devices,
1030this command option runs the "Background short" self\-test.]
1031This command can be given during normal system operation (unless run in
1032captive mode \- see the \'\-C\' option below).  This is a
1033test in a different category than the immediate or automatic offline
1034tests.  The "Self" tests check the electrical and mechanical
1035performance as well as the read performance of the disk.  Their
1036results are reported in the Self Test Error Log, readable with
1037the \'\-l selftest\' option.  Note that on some disks the progress of the
1038self\-test can be monitored by watching this log during the self\-test; with other disks
1039use the \'\-c\' option to monitor progress.
1040
1041.I long
1042\- runs SMART Extended Self Test (tens of minutes).
1043[Note: in the case of SCSI devices,
1044this command option runs the "Background long" self\-test.]
1045This is a
1046longer and more thorough version of the Short Self Test described
1047above.  Note that this command can be given during normal
1048system operation (unless run in captive mode \- see the \'\-C\' option below).
1049
1050.I conveyance
1051\- [ATA ONLY] runs a SMART Conveyance Self Test (minutes).  This
1052self\-test routine is intended to identify damage incurred during
1053transporting of the device. This self\-test routine should take on the
1054order of minutes to complete.  Note that this command can be given
1055during normal system operation (unless run in captive mode \- see the
1056\'\-C\' option below).
1057
1058.I select,N\-M
1059\- [ATA ONLY] [NEW EXPERIMENTAL SMARTCTL FEATURE] runs a SMART
1060Selective Self Test, to test a \fBrange\fP of disk Logical Block
1061Addresses (LBAs), rather than the entire disk.  Each range of LBAs
1062that is checked is called a "span" and is specified by a starting LBA
1063(N) and an ending LBA (M) with N less than or equal to M.  For example
1064the command:
1065.nf
1066  smartctl \-t select,10\-20 /dev/hda
1067.fi
1068runs a self test on one span consisting of LBAs ten to twenty
1069(inclusive). The \'\-t\' option can be given up to five times, to test
1070up to five spans.  For example the command:
1071.nf
1072  smartctl \-t select,0\-100 \-t select,1000\-2000 /dev/hda
1073.fi
1074runs a self test on two spans.  The first span consists of 101 LBAs
1075and the second span consists of 1001 LBAs.  Note that the spans can
1076overlap partially or completely, for example:
1077.nf
1078  smartctl \-t select,0\-10 \-t select,5\-15 \-t select,10\-20 /dev/hda
1079.fi
1080The results of the selective self\-test can be obtained (both during
1081and after the test) by printing the SMART self\-test log, using the
1082\'\-l selftest\' option to smartctl.
1083
1084Selective self tests are particularly useful as disk capacities
1085increase: an extended self test (smartctl \-t long) can take several
1086hours.  Selective self\-tests are helpful if (based on SYSLOG error
1087messages, previous failed self\-tests, or SMART error log entries) you
1088suspect that a disk is having problems at a particular range of
1089Logical Block Addresses (LBAs).
1090
1091Selective self\-tests can be run during normal system operation (unless
1092done in captive mode \- see the \'\-C\' option below).
1093
1094[Note: this new experimental smartmontools feature is currently only
1095available under Linux.  The Linux kernel must be compiled with the
1096configuration option CONFIG_IDE_TASKFILE_IO enabled.  Please report
1097unusual or incorrect behavior to the smartmontools\-support mailing
1098list.]
1099
1100.I afterselect,on
1101\- [ATA ONLY] perform an offline read scan after a Selective Self\-test
1102has completed. This option must be used together with one or more of
1103the \fIselect,N\-M\fP options above. If the LBAs that have been
1104specified in the Selective self\-test pass the test with no errors
1105found, then read scan the \fBremainder\fP of the disk.  If the device
1106is powered\-cycled while this read scan is in progress, the read scan
1107will be automatically resumed after a time specified by the pending
1108timer (see below).  The value of this option is preserved between
1109selective self\-tests.
1110
1111.I afterselect,off
1112\- [ATA ONLY] do not read scan the remainder of the disk after a
1113Selective self\-test has completed.  This option must be use together
1114with one or more of the \fIselect,N\-M\fP options above.  The value of this
1115option is preserved between selective self\-tests.
1116
1117.I pending,N
1118\- [ATA ONLY] set the pending offline read scan timer to N minutes.
1119Here N is an integer in the range from 0 to 65535 inclusive.  If the
1120device is powered off during a read scan after a Selective self\-test,
1121then resume the test automatically N minutes after power\-up.  This
1122option must be use together with one or more of the \fIselect,N\-M\fP
1123options above. The value of this option is preserved between selective
1124self\-tests.
1125
1126.TP
1127.B \-C, \-\-captive
1128Runs self\-tests in captive mode.  This has no effect with \'\-t
1129offline\' or if the \'\-t\' option is not used. [Note: in the case of
1130SCSI devices, this command option runs the self\-test in "Foreground"
1131mode.]
1132
1133\fBWARNING: Tests run in captive mode may busy out the drive for the
1134length of the test.  Only run captive tests on drives without any
1135mounted partitions!\fP
1136
1137.TP
1138.B \-X, \-\-abort
1139Aborts non\-captive SMART Self Tests.  Note that this
1140command will abort the Offline Immediate Test routine only if your
1141disk has the "Abort Offline collection upon new command" capability.
1142.PP
1143.SH EXAMPLES
1144.nf
1145.B smartctl \-a /dev/hda
1146.fi
1147Print all SMART information for drive /dev/hda (Primary Master).
1148.PP
1149.nf
1150.B smartctl \-s off /dev/hdd
1151.fi
1152Disable SMART on drive /dev/hdd (Secondary Slave).
1153.PP
1154.nf
1155.B smartctl \-\-smart=on \-\-offlineauto=on \-\-saveauto=on /dev/hda
1156.fi
1157Enable SMART on drive /dev/hda, enable automatic offline
1158testing every four hours, and enable autosaving of
1159SMART Attributes.  This is a good start\-up line for your system\'s
1160init files.  You can issue this command on a running system.
1161.PP
1162.nf
1163.B smartctl \-t long /dev/hdc
1164.fi
1165Begin an extended self\-test of drive /dev/hdc.  You can issue this
1166command on a running system.  The results can be seen in the self\-test
1167log visible with the \'\-l selftest\' option after it has completed.
1168.PP
1169.nf
1170.B smartctl \-s on \-t offline /dev/hda
1171.fi
1172Enable SMART on the disk, and begin an immediate offline test of
1173drive /dev/hda.  You can issue this command on a running system.  The
1174results are only used to update the SMART Attributes, visible
1175with the \'\-A\' option.  If any device errors occur, they are logged to
1176the SMART error log, which can be seen with the \'\-l error\' option.
1177.PP
1178.nf
1179.B smartctl \-A \-v 9,minutes /dev/hda
1180.fi
1181Shows the vendor Attributes, when the disk stores its power\-on time
1182internally in minutes rather than hours.
1183.PP
1184.nf
1185.B smartctl \-q errorsonly \-H \-l selftest /dev/hda
1186.fi
1187Produces output only if the device returns failing SMART status,
1188or if some of the logged self\-tests ended with errors.
1189.PP
1190.nf
1191.B smartctl \-q silent \-a /dev/hda
1192.fi
1193Examine all SMART data for device /dev/hda, but produce no
1194printed output.  You must use the exit status (the
1195.B $?
1196shell variable) to learn if any Attributes are out of bound, if the
1197SMART status is failing, if there are errors recorded in the
1198self\-test log, or if there are errors recorded in the disk error log.
1199.PP
1200.nf
1201.B smartctl \-a \-d 3ware,0 /dev/sda
1202.fi
1203Examine all SMART data for the first ATA disk connected to a 3ware
1204RAID controller card.
1205.PP
1206.nf
1207.B smartctl \-a \-d 3ware,0 /dev/twe0
1208.fi
1209Examine all SMART data for the first ATA disk connected to a 3ware
1210RAID 6000/7000/8000 controller card.
1211.PP
1212.nf
1213.B smartctl \-a \-d 3ware,0 /dev/twa0
1214.fi
1215Examine all SMART data for the first ATA disk connected to a 3ware
1216RAID 9000 controller card.
1217.PP
1218.nf
1219.B smartctl \-t short \-d 3ware,3 /dev/sdb
1220.fi
1221Start a short self\-test on the fourth ATA disk connected to the 3ware RAID
1222controller card which is the second SCSI device /dev/sdb.
1223.PP
1224.nf
1225.B smartctl \-a \-d hpt,1/3 /dev/sda
1226.fi
1227Examine all SMART data for the (S)ATA disk directly connected to the third channel of the
1228first HighPoint RocketRAID controller card.
1229.nf
1230.PP
1231.nf
1232.B smartctl \-t short \-d hpt,1/1/2 /dev/sda
1233.fi
1234Start a short self\-test on the (S)ATA disk connected to second pmport on the
1235first channel of the first HighPoint RocketRAID controller card.
1236.PP
1237.nf
1238.B smartctl \-t select,10\-100 \-t select,30\-300 \-t afterselect,on \-t pending,45 /dev/hda
1239.fi
1240Run a selective self\-test on LBAs 10 to 100 and 30 to 300.  After the
1241these LBAs have been tested, read\-scan the remainder of the disk.  If the disk is
1242power\-cycled during the read\-scan, resume the scan 45 minutes after power to the
1243device is restored.
1244.PP
1245.SH RETURN VALUES
1246The return values of \fBsmartctl\fP are defined by a bitmask.  If all
1247is well with the disk, the return value (exit status) of
1248\fBsmartctl\fP is 0 (all bits turned off).  If a problem occurs, or an
1249error, potential error, or fault is detected, then a non\-zero status
1250is returned.  In this case, the eight different bits in the return
1251value have the following meanings for ATA disks; some of these values
1252may also be returned for SCSI disks.
1253.TP
1254.B Bit 0:
1255Command line did not parse.
1256.TP
1257.B Bit 1:
1258Device open failed, or device did not return an IDENTIFY DEVICE structure.
1259.TP
1260.B Bit 2:
1261Some SMART command to the disk failed, or there was a checksum error
1262in a SMART data structure (see \'\-b\' option above).
1263.TP
1264.B Bit 3:
1265SMART status check returned "DISK FAILING".
1266.TP
1267.B Bit 4:
1268SMART status check returned "DISK OK" but we found prefail Attributes <= threshold.
1269.TP
1270.B Bit 5:
1271SMART status check returned "DISK OK" but we found that some (usage
1272or prefail) Attributes have been <= threshold at some time in the
1273past.
1274.TP
1275.B Bit 6:
1276The device error log contains records of errors.
1277.TP
1278.B Bit 7:
1279The device self\-test log contains records of errors.
1280
1281To test within the shell for whether or not the different bits are
1282turned on or off, you can use the following type of construction (this
1283is bash syntax):
1284.nf
1285.B smartstat=$(($? & 8))
1286.fi
1287This looks at only at bit 3 of the exit status
1288.B $?
1289(since 8=2^3).  The shell variable
1290$smartstat will be nonzero if SMART status check returned "disk
1291failing" and zero otherwise.
1292
1293.PP
1294.SH NOTES
1295The TapeAlert log page flags are cleared for the initiator when the
1296page is read. This means that each alert condition is reported only
1297once by \fBsmartctl\fP for each initiator for each activation of the
1298condition.
1299
1300.PP
1301.SH AUTHOR
1302\fBBruce Allen\fP smartmontools\-support@lists.sourceforge.net
1303.fi
1304University of Wisconsin \- Milwaukee Physics Department
1305 
1306.PP
1307.SH CONTRIBUTORS
1308The following have made large contributions to smartmontools:
1309.nf
1310\fBCasper Dik\fP (Solaris SCSI interface)
1311\fBChristian Franke\fP (Windows interface and Cygwin package)
1312\fBDouglas Gilbert\fP (SCSI subsystem)
1313\fBGuido Guenther\fP (Autoconf/Automake packaging)
1314\fBGeoffrey Keating\fP (Darwin ATA interface)
1315\fBEduard Martinescu\fP (FreeBSD interface)
1316\fBFr\*'ed\*'eric L. W. Meunier\fP (Web site and Mailing list)
1317\fBKeiji Sawada\fP (Solaris ATA interface)
1318\fBSergey Svishchev\fP (NetBSD interface)
1319\fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
1320\fBPhil Williams\fP (User interface and drive database)
1321\fBYuri Dario\fP (OS/2, eComStation interface)
1322.fi
1323Many other individuals have made smaller contributions and corrections.
1324
1325.PP
1326.SH CREDITS
1327.fi
1328This code was derived from the smartsuite package, written by Michael
1329Cornwell, and from the previous UCSC smartsuite package.  It extends
1330these to cover ATA\-5 disks.  This code was originally developed as a
1331Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
1332(now part of the Storage Systems Research Center), Jack Baskin School
1333of Engineering, University of California, Santa
1334Cruz. \fBhttp://ssrc.soe.ucsc.edu/\fP .
1335.SH
1336HOME PAGE FOR SMARTMONTOOLS:
1337.fi
1338Please see the following web site for updates, further documentation, bug
1339reports and patches: \fBhttp://smartmontools.sourceforge.net/\fP
1340
1341.SH
1342SEE ALSO:
1343\fBsmartd\fP(8), \fBbadblocks\fP(8), \fBide\-smart\fP(8).
1344.SH
1345REFERENCES FOR SMART
1346.fi
1347An introductory article about smartmontools is \fIMonitoring Hard
1348Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
1349pages 74-77. This is \fBhttp://www.linuxjournal.com/article.php?sid=6983\fP
1350online.
1351
1352If you would like to understand better how SMART works, and what it
1353does, a good place to start is with Sections 4.8 and 6.54 of the first
1354volume of the \'AT Attachment with Packet Interface-7\' (ATA/ATAPI-7)
1355specification.  This documents the SMART functionality which the
1356\fBsmartmontools\fP utilities provide access to.  You can find
1357Revision 4b of this document at
1358\fBhttp://www.t13.org/docs2004/d1532v1r4b-ATA-ATAPI-7.pdf\fP .
1359Earlier and later versions of this Specification are available from
1360the T13 web site \fBhttp://www.t13.org/\fP .
1361
1362.fi
1363The functioning of SMART was originally defined by the SFF\-8035i
1364revision 2 and the SFF\-8055i revision 1.4 specifications.  These are
1365publications of the Small Form Factors (SFF) Committee.  Links to
1366these documents may be found in the References section of the
1367\fBsmartmontools\fP home page at
1368\fBhttp://smartmontools.sourceforge.net/\fP .
1369
1370.SH
1371CVS ID OF THIS PAGE:
1372$Id: smartctl.8.in,v 1.86 2006/09/27 21:42:03 chrfranke Exp $
1373.\" Local Variables:             
1374.\" mode: nroff         
1375.\" End:
Note: See TracBrowser for help on using the browser.