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