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