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