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