1SMARTCTL(8) SMART Monitoring Tools SMARTCTL(8)
2
3
4
6 smartctl - Control and Monitor Utility for SMART Disks
7
8
10 smartctl [options] device
11
12
14 [This man page is generated for the Linux version of smartmontools. It
15 does not contain info specific to other platforms.]
16
17 smartctl controls the Self-Monitoring, Analysis and Reporting Technol‐
18 ogy (SMART) system built into most ATA/SATA and SCSI/SAS hard drives
19 and solid-state drives. The purpose of SMART is to monitor the relia‐
20 bility of the hard drive and predict drive failures, and to carry out
21 different types of drive self-tests. smartctl also supports some fea‐
22 tures not related to SMART. This version of smartctl is compatible
23 with ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards (see
24 REFERENCES below).
25
26 smartctl also provides support for polling TapeAlert messages from SCSI
27 tape drives and changers.
28
29 The user must specify the device to be controlled or interrogated as
30 the final argument to smartctl. The command set used by the device is
31 often derived from the device path but may need help with the '-d'
32 option (for more information see the section on "ATA, SCSI command sets
33 and SAT" below). Device paths are as follows:
34
35 LINUX: Use the forms "/dev/sd[a-z]" for ATA/SATA and SCSI/SAS
36 devices. For SCSI Tape Drives and Changers with TapeAlert
37 support use the devices "/dev/nst*" and "/dev/sg*". For disks
38 behind 3ware controllers you may need "/dev/sd[a-z]" or
39 "/dev/twe[0-9]", "/dev/twa[0-9]" or "/dev/twl[0-9]": see
40 details below. For disks behind HighPoint RocketRAID con‐
41 trollers you may need "/dev/sd[a-z]". For disks behind Areca
42 SATA RAID controllers, you need "/dev/sg[2-9]" (note that
43 smartmontools interacts with the Areca controllers via a SCSI
44 generic device which is different than the SCSI device used
45 for reading and writing data)! For HP Smart Array RAID con‐
46 trollers, there are three currently supported drivers: cciss,
47 hpsa, and hpahcisr. For disks accessed via the cciss driver
48 the device nodes are of the form "/dev/cciss/c[0-9]d0". For
49 disks accessed via the hpahcisr and hpsa drivers, the device
50 nodes you need are "/dev/sg[0-9]*". ("lsscsi -g" is helpful
51 in determining which scsi generic device node corresponds to
52 which device.) Use the nodes corresponding to the RAID con‐
53 trollers, not the nodes corresponding to logical drives. See
54 the -d option below, as well. Use the forms "/dev/nvme[0-9]"
55 (broadcast namespace) or "/dev/nvme[0-9]n[1-9]" (specific
56 namespace 1-9) for NVMe devices.
57
58 if '-' is specified as the device path, smartctl reads and interprets
59 it's own debug output from standard input. See '-r ataioctl' below for
60 details.
61
62 smartctl guesses the device type if possible. If necessary, the '-d'
63 option can be used to override this guess.
64
65 Note that the printed output of smartctl displays most numerical values
66 in base 10 (decimal), but some values are displayed in base 16 (hexa‐
67 decimal). To distinguish them, the base 16 values are always displayed
68 with a leading "0x", for example: "0xff". This man page follows the
69 same convention.
70
71
73 The options are grouped below into several categories. smartctl will
74 execute the corresponding commands in the order: INFORMATION,
75 ENABLE/DISABLE, DISPLAY DATA, RUN/ABORT TESTS.
76
77
78 SHOW INFORMATION OPTIONS:
79
80 -h, --help, --usage
81 Prints a usage message to STDOUT and exits.
82
83 -V, --version, --copyright, --license
84 Prints version, copyright, license, home page and SVN revision
85 information for your copy of smartctl to STDOUT and then exits.
86
87 -i, --info
88 Prints the device model number, serial number, firmware version,
89 and ATA Standard version/revision information. Says if the
90 device supports SMART, and if so, whether SMART support is cur‐
91 rently enabled or disabled. If the device supports Logical
92 Block Address mode (LBA mode) print current user drive capacity
93 in bytes. (If drive has a user protected area reserved, or is
94 "clipped", this may be smaller than the potential maximum drive
95 capacity.) Indicates if the drive is in the smartmontools data‐
96 base (see '-v' options below). If so, the drive model family
97 may also be printed. If '-n' (see below) is specified, the
98 power mode of the drive is printed.
99
100 [NVMe] For NVMe devices the information is obtained from the
101 Identify Controller and the Identify Namespace data structure.
102
103 --identify[=[w][nvb]]
104 [ATA only] Prints an annotated table of the IDENTIFY DEVICE
105 data. By default, only valid words (words not equal to 0x0000
106 or 0xffff) and nonzero bits and bit fields are printed. This
107 can be changed by the optional argument which consists of one or
108 two characters from the set 'wnvb'. The character 'w' enables
109 printing of all 256 words. The character 'n' suppresses print‐
110 ing of bits, 'v' enables printing of all bits from valid words,
111 'b' enables printing of all bits. For example '--identify=n'
112 (valid words, no bits) produces the shortest output and '--iden‐
113 tify=wb' (all words, all bits) produces the longest output.
114
115 -a, --all
116 Prints all SMART information about the disk, or TapeAlert infor‐
117 mation about the tape drive or changer. For ATA devices this is
118 equivalent to
119 '-H -i -c -A -l error -l selftest -l selective'
120 and for SCSI, this is equivalent to
121 '-H -i -A -l error -l selftest'.
122 For NVMe, this is equivalent to
123 '-H -i -c -A -l error'.
124 Note that for ATA disks this does not enable the non-SMART
125 options and the SMART options which require support for 48-bit
126 ATA commands.
127
128 -x, --xall
129 Prints all SMART and non-SMART information about the device.
130 For ATA devices this is equivalent to
131 '-H -i -g all -g wcreorder -c -A -f brief -l xerror,error -l
132 xselftest,selftest -l selective -l directory -l scttemp -l
133 scterc -l devstat -l defects -l sataphy'.
134 and for SCSI, this is equivalent to
135 '-H -i -g all -A -l error -l selftest -l background -l sasphy'.
136 For NVMe, this is equivalent to
137 '-H -i -c -A -l error'.
138
139 --scan Scans for devices and prints each device name, device type and
140 protocol ([ATA] or [SCSI]) info. May be used in conjunction
141 with '-d TYPE' to restrict the scan to a specific TYPE. See
142 also info about platform specific device scan and the DEVICESCAN
143 directive on smartd(8) man page.
144
145 --scan-open
146 Same as --scan, but also tries to open each device before print‐
147 ing device info. The device open may change the device type due
148 to autodetection (see also '-d test').
149
150 This option can be used to create a draft smartd.conf file. All
151 options after '--' are appended to each output line. For exam‐
152 ple:
153 smartctl --scan-open -- -a -W 4,45,50 -m admin@work > smartd.conf
154
155 Multiple '-d TYPE' options may be specified with '--scan[-open]'
156 to combine the scan results of more than one TYPE.
157
158 -g NAME, --get=NAME
159 Get non-SMART device settings. See '-s, --set' below for fur‐
160 ther info.
161
162
163 RUN-TIME BEHAVIOR OPTIONS:
164
165 -j, --json[=cgiosuv]
166 [NEW EXPERIMENTAL SMARTCTL FEATURE] Enables JSON output mode.
167
168 The output could be modified or enhanced by the optional argu‐
169 ment which consists of one or more characters from the set
170 'cgiosuv':
171 'c': Outputs compact format without extra spaces and newlines.
172 By default, output is pretty-printed.
173 'g': Outputs JSON structure as single assignments to allow the
174 usage of grep. Each assignment reflects the absolute path of a
175 value. The syntax is compatible with gron:
176 'json.KEY1[INDEX2].KEY3 = VALUE;'.
177 'o': Includes the full original plaintext output of smartctl as
178 a JSON array 'smartctl.output[]'.
179 's': Outputs JSON object elements sorted by key. By default,
180 object elements are ordered as generated internally.
181 'v': Enables verbose output of possible unsafe integers. If
182 specified, values which may exceed JSON safe integer (53-bit)
183 range are always output as a number (with some 'KEY') and a
184 string ('KEY_s'), regardless of the actual value. Values which
185 may exceed 64-bit range are also output as a little endian byte
186 array ('KEY_le'). By default, the additional elements are only
187 output if the value actually exceeds the range.
188
189 The following two arguments are primarily indented for develop‐
190 ment:
191 'i': Includes lines from the plaintext output which print info
192 already implemented for JSON output. The lines appear as
193 objects with key 'smartctl_NNNN_i'.
194 'u': Includes lines from the plaintext output which print info
195 still unimplemented for JSON output. The lines appear as
196 objects with key 'smartctl_NNNN_u'.
197
198 -q TYPE, --quietmode=TYPE
199 Specifies that smartctl should run in one of the quiet modes
200 described here. The valid arguments to this option are:
201
202 errorsonly - only print: For the '-l error' option, if nonzero,
203 the number of errors recorded in the SMART error log and the
204 power-on time when they occurred; For the '-l selftest' option,
205 errors recorded in the device self-test log; For the '-H'
206 option, SMART "disk failing" status or device Attributes (pre-
207 failure or usage) which failed either now or in the past; For
208 the '-A' option, device Attributes (pre-failure or usage) which
209 failed either now or in the past.
210
211 silent - print no output. The only way to learn about what was
212 found is to use the exit status of smartctl (see EXIT STATUS
213 below).
214
215 noserial - Do not print the serial number of the device.
216
217 -d TYPE, --device=TYPE
218 Specifies the type of the device. The valid arguments to this
219 option are:
220
221 auto - attempt to guess the device type from the device name or
222 from controller type info provided by the operating system or
223 from a matching USB ID entry in the drive database. This is the
224 default.
225
226 test - prints the guessed TYPE, then opens the device and prints
227 the (possibly changed) TYPE name and then exits without perform‐
228 ing any further commands.
229
230 ata - the device type is ATA. This prevents smartctl from issu‐
231 ing SCSI commands to an ATA device.
232
233 scsi - the device type is SCSI. This prevents smartctl from
234 issuing ATA commands to a SCSI device.
235
236 nvme[,NSID] - the device type is NVM Express (NVMe). The
237 optional parameter NSID specifies the namespace id (in hex)
238 passed to the driver. Use 0xffffffff for the broadcast names‐
239 pace id. The default for NSID is the namespace id addressed by
240 the device name.
241
242 sat[,auto][,N] - the device type is SCSI to ATA Translation
243 (SAT). This is for ATA disks that have a SCSI to ATA Transla‐
244 tion Layer (SATL) between the disk and the operating system.
245 SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes
246 long and the other 16 bytes long. The default is the 16 byte
247 variant which can be overridden with either '-d sat,12' or '-d
248 sat,16'.
249
250 If '-d sat,auto' is specified, device type SAT (for ATA/SATA
251 disks) is only used if the SCSI INQUIRY data reports a SATL
252 (VENDOR: "ATA "). Otherwise device type SCSI (for SCSI/SAS
253 disks) is used.
254
255 usbcypress - this device type is for ATA disks that are behind a
256 Cypress USB to PATA bridge. This will use the ATACB proprietary
257 scsi pass through command. The default SCSI operation code is
258 0x24, but although it can be overridden with '-d usbcy‐
259 press,0xN', where N is the scsi operation code, you're running
260 the risk of damage to the device or filesystems on it.
261
262 usbjmicron[,p][,x][,PORT] - this device type is for SATA disks
263 that are behind a JMicron USB to PATA/SATA bridge. The 48-bit
264 ATA commands (required e.g. for '-l xerror', see below) do not
265 work with all of these bridges and are therefore disabled by
266 default. These commands can be enabled by '-d usbjmicron,x'.
267 If two disks are connected to a bridge with two ports, an error
268 message is printed if no PORT is specified. The port can be
269 specified by '-d usbjmicron[,x],PORT' where PORT is 0 (master)
270 or 1 (slave). This is not necessary if the device uses a port
271 multiplier to connect multiple disks to one port. The disks
272 appear under separate /dev/ice names then. CAUTION: Specifying
273 ',x' for a device which does not support it results in I/O
274 errors and may disconnect the drive. The same applies if the
275 specified PORT does not exist or is not connected to a disk.
276
277 The Prolific PL2507/3507 USB bridges with older firmware support
278 a pass-through command similar to JMicron and work with '-d usb‐
279 jmicron,0'. Newer Prolific firmware requires a modified command
280 which can be selected by '-d usbjmicron,p'. Note that this does
281 not yet support the SMART status command.
282
283 usbprolific - this device type is for SATA disks that are behind
284 a Prolific PL2571/2771/2773/2775 USB to SATA bridge.
285
286 usbsunplus - this device type is for SATA disks that are behind
287 a SunplusIT USB to SATA bridge.
288
289 sntjmicron[,NSID] - [NEW EXPERIMENTAL SMARTCTL FEATURE] this
290 device type is for NVMe disks that are behind a JMicron USB to
291 NVMe bridge. The optional parameter NSID specifies the names‐
292 pace id (in hex) passed to the driver. The default namespace id
293 is the broadcast namespace id (0xffffffff).
294
295 marvell - [Linux only] interact with SATA disks behind Marvell
296 chip-set controllers (using the Marvell rather than libata
297 driver).
298
299 megaraid,N - [Linux only] the device consists of one or more
300 SCSI/SAS disks connected to a MegaRAID controller. The non-neg‐
301 ative integer N (in the range of 0 to 127 inclusive) denotes
302 which disk on the controller is monitored. Use syntax such as:
303 smartctl -a -d megaraid,2 /dev/sda
304 smartctl -a -d megaraid,0 /dev/sdb
305 smartctl -a -d megaraid,0 /dev/bus/0
306 This interface will also work for Dell PERC controllers. It is
307 possible to set RAID device name as /dev/bus/N, where N is a
308 SCSI bus number.
309
310 The following entry in /proc/devices must exist:
311 For PERC2/3/4 controllers: megadevN
312 For PERC5/6 controllers: megaraid_sas_ioctlN
313
314 aacraid,H,L,ID - [Linux, Windows and Cygwin only] the device
315 consists of one or more SCSI/SAS or SATA disks connected to an
316 AacRaid controller. The non-negative integers H,L,ID (Host num‐
317 ber, Lun, ID) denote which disk on the controller is monitored.
318 Use syntax such as:
319 smartctl -a -d aacraid,0,0,2 /dev/sda
320 smartctl -a -d aacraid,1,0,4 /dev/sdb
321
322 Option '-d sat,auto+...' is implicitly enabled to detect SATA
323 disks. Use '-d scsi+aacraid,H,L,ID' to disable it.
324
325 On Linux, the following entry in /proc/devices must exist: aac.
326 Character device nodes /dev/aacH (H=Host number) are created if
327 required.
328
329 3ware,N - [FreeBSD and Linux only] the device consists of one or
330 more ATA disks connected to a 3ware RAID controller. The non-
331 negative integer N (in the range from 0 to 127 inclusive)
332 denotes which disk on the controller is monitored. Use syntax
333 such as:
334 smartctl -a -d 3ware,2 /dev/sda [Linux only]
335 smartctl -a -d 3ware,0 /dev/twe0
336 smartctl -a -d 3ware,1 /dev/twa0
337 smartctl -a -d 3ware,1 /dev/twl0 [Linux only]
338 smartctl -a -d 3ware,1 /dev/tws0 [FreeBSD only]
339 The first two forms, which refer to devices /dev/sda-z (depre‐
340 cated) and /dev/twe0-15, may be used with 3ware series 6000,
341 7000, and 8000 series controllers that use the 3x-xxxx driver.
342 The devices /dev/twa0-15, must be used with 3ware 9000 series
343 controllers, which use the 3w-9xxx driver. The devices
344 /dev/twl0-15 [Linux] or /dev/tws0-15 [FreeBSD] must be used with
345 the 3ware/LSI 9750 series controllers which use the 3w-sas
346 driver.
347
348 Note that if the special character device nodes /dev/tw[ls]?,
349 /dev/twa? and /dev/twe? do not exist, or exist with the incor‐
350 rect major or minor numbers, smartctl will recreate them on the
351 fly.
352
353 areca,N - [FreeBSD, Linux, Windows and Cygwin only] the device
354 consists of one or more SATA disks connected to an Areca SATA
355 RAID controller. The positive integer N (in the range from 1 to
356 24 inclusive) denotes which disk on the controller is monitored.
357 On Linux use syntax such as:
358 smartctl -a -d areca,2 /dev/sg2
359 smartctl -a -d areca,3 /dev/sg3
360 The first line above addresses the second disk on the first
361 Areca RAID controller. The second line addresses the third disk
362 on the second Areca RAID controller. To help identify the cor‐
363 rect device on Linux, use the command:
364 cat /proc/scsi/sg/device_hdr /proc/scsi/sg/devices
365 to show the SCSI generic devices (one per line, starting with
366 /dev/sg0). The correct SCSI generic devices to address for
367 smartmontools are the ones with the type field equal to 3. If
368 the incorrect device is addressed, please read the warning/error
369 messages carefully. They should provide hints about what
370 devices to use.
371
372 Important: the Areca controller must have firmware version 1.46
373 or later. Lower-numbered firmware versions will give (harmless)
374 SCSI error messages and no SMART information.
375
376 areca,N/E - [FreeBSD, Linux, Windows and Cygwin only] the device
377 consists of one or more SATA or SAS disks connected to an Areca
378 SAS RAID controller. The integer N (range 1 to 128) denotes the
379 channel (slot) and E (range 1 to 8) denotes the enclosure.
380 Important: This requires Areca SAS controller firmware version
381 1.51 or later.
382
383 cciss,N - [FreeBSD and Linux only] the device consists of one or
384 more SCSI/SAS or SATA disks connected to a cciss RAID con‐
385 troller. The non-negative integer N (in the range from 0 to 15
386 inclusive) denotes which disk on the controller is monitored.
387
388 Option '-d sat,auto+...' is implicitly enabled to detect SATA
389 disks. Use '-d scsi+cciss,N' to disable it.
390
391 To look at disks behind HP Smart Array controllers, use syntax
392 such as:
393 smartctl -a -d cciss,0 /dev/cciss/c0d0 (cciss driver under
394 Linux)
395 smartctl -a -d cciss,0 /dev/sg2 (hpsa or hpahcisr drivers
396 under Linux)
397
398 hpt,L/M/N - [FreeBSD and Linux only] the device consists of one
399 or more ATA disks connected to a HighPoint RocketRAID con‐
400 troller. The integer L is the controller id, the integer M is
401 the channel number, and the integer N is the PMPort number if it
402 is available. The allowed values of L are from 1 to 4 inclu‐
403 sive, M are from 1 to 128 inclusive and N from 1 to 4 if PMPort
404 available. And also these values are limited by the model of
405 the HighPoint RocketRAID controller. Use syntax such as:
406 smartctl -a -d hpt,1/3 /dev/sda (under Linux)
407 smartctl -a -d hpt,1/2/3 /dev/sda (under Linux)
408 Note that the /dev/sda-z form should be the device node which
409 stands for the disks derived from the HighPoint RocketRAID con‐
410 trollers under Linux and under FreeBSD, it is the character
411 device which the driver registered (eg, /dev/hptrr,
412 /dev/hptmv6).
413
414 intelliprop,N[+TYPE] - the device consists of multiple ATA disks
415 connected to an Intelliprop controller. The integer N is the
416 port number from 0 to 3 of the ATA drive to be targeted. The
417 TYPE can be ata(default), sat, or a USB controller listed above.
418 Note: if a type of ATA does not work, try a type of sat. Use
419 syntax such as:
420 smartctl -a -d intelliprop,1 /dev/sda (under Linux)
421 smartctl -a -d intelliprop,1+sat /dev/sda (under Linux)
422 WARNING: The disks are selected by write commands to the ATA
423 Device Vendor Specific Log at address 0xc0. Using this option
424 with other devices may have undesirable side effects.
425
426 jmb39x,N[,sLBA][,force][+TYPE] - [NEW EXPERIMENTAL SMARTCTL FEA‐
427 TURE] the device consists of multiple SATA disks connected to a
428 JMicron JMB39x RAID port multiplier. The integer N is the port
429 number from 0 to 4.
430 WARNING: The ATA pass-through commands are issued via READ/WRITE
431 commands to LBA 33 of the RAID volume. Using this option with
432 other devices may overwrite this sector.
433 The LBA could be selected in the range 33 (last sector of a GPT)
434 to 62 (last sector of traditional boot area).
435 By default, access to the device is refused if the selected sec‐
436 tor is not zero filled. The 'force' flag disables this check.
437 WARNING: Orignal sector data is not written back if smartctl is
438 aborted with a signal.
439
440 -T TYPE, --tolerance=TYPE
441 [ATA only] Specifies how tolerant smartctl should be of ATA and
442 SMART command failures.
443
444 The behavior of smartctl depends upon whether the command is
445 "optional" or "mandatory". Here "mandatory" means "required by
446 the ATA Specification if the device implements the SMART command
447 set" and "optional" means "not required by the ATA Specification
448 even if the device implements the SMART command set." The
449 "mandatory" ATA and SMART commands are: (1) ATA IDENTIFY DEVICE,
450 (2) SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE, (3) SMART
451 ENABLE/DISABLE, and (4) SMART RETURN STATUS.
452
453 The valid arguments to this option are:
454
455 normal - exit on failure of any mandatory SMART command, and
456 ignore all failures of optional SMART commands. This is the
457 default. Note that on some devices, issuing unimplemented
458 optional SMART commands doesn't cause an error. This can result
459 in misleading smartctl messages such as "Feature X not imple‐
460 mented", followed shortly by "Feature X: enabled". In most such
461 cases, contrary to the final message, Feature X is not enabled.
462
463 conservative - exit on failure of any optional SMART command.
464
465 permissive - ignore failure(s) of mandatory SMART commands.
466 This option may be given more than once. Each additional use of
467 this option will cause one more additional failure to be
468 ignored. Note that the use of this option can lead to messages
469 like "Feature X not supported", followed shortly by "Feature X
470 enable failed". In a few such cases, contrary to the final mes‐
471 sage, Feature X is enabled.
472
473 verypermissive - equivalent to giving a large number of '-T per‐
474 missive' options: ignore failures of any number of mandatory
475 SMART commands. Please see the note above.
476
477 -b TYPE, --badsum=TYPE
478 [ATA only] Specifies the action smartctl should take if a check‐
479 sum error is detected in the: (1) Device Identity Structure, (2)
480 SMART Self-Test Log Structure, (3) SMART Attribute Value Struc‐
481 ture, (4) SMART Attribute Threshold Structure, or (5) ATA Error
482 Log Structure.
483
484 The valid arguments to this option are:
485
486 warn - report the incorrect checksum but carry on in spite of
487 it. This is the default.
488
489 exit - exit smartctl.
490
491 ignore - continue silently without issuing a warning.
492
493 -r TYPE, --report=TYPE
494 Intended primarily to help smartmontools developers understand
495 the behavior of smartmontools on non-conforming or poorly con‐
496 forming hardware. This option reports details of smartctl
497 transactions with the device. The option can be used multiple
498 times. When used just once, it shows a record of the ioctl()
499 transactions with the device. When used more than once, the
500 detail of these ioctl() transactions are reported in greater
501 detail. The valid arguments to this option are:
502
503 ioctl - report all ioctl() transactions.
504
505 ataioctl - report only ioctl() transactions with ATA devices.
506
507 scsiioctl - report only ioctl() transactions with SCSI devices.
508 Invoking this once shows the SCSI commands in hex and the corre‐
509 sponding status. Invoking it a second time adds a hex listing
510 of the first 64 bytes of data send to, or received from the
511 device.
512
513 nvmeioctl - report only ioctl() transactions with NVMe devices.
514
515 Any argument may include a positive integer to specify the level
516 of detail that should be reported. The argument should be fol‐
517 lowed by a comma then the integer with no spaces. For example,
518 ataioctl,2 The default level is 1, so '-r ataioctl,1' and '-r
519 ataioctl' are equivalent.
520
521 For testing purposes, the output of '-r ataioctl,2' can later be
522 parsed by smartctl itself if '-' is used as device path argu‐
523 ment. The ATA command input parameters, sector data and return
524 values are reconstructed from the debug report read from stdin.
525 Then smartctl internally simulates an ATA device with the same
526 behaviour. This is does not work for SCSI devices yet.
527
528 -n POWERMODE[,STATUS], --nocheck=POWERMODE[,STATUS]
529 [ATA only] Specifies if smartctl should exit before performing
530 any checks when the device is in a low-power mode. It may be
531 used to prevent a disk from being spun-up by smartctl. The
532 power mode is ignored by default.
533
534 Note: If this option is used it may also be necessary to specify
535 the device type with the '-d' option. Otherwise the device may
536 spin up due to commands issued during device type autodetection.
537
538 By default, exit status 2 is returned if the device is in one of
539 the specified low-power modes. This status is also returned if
540 the device open or identification failed (see EXIT STATUS
541 below). The optional STATUS parameter allows to override this
542 default. STATUS is an integer in the range from 0 to 255 inclu‐
543 sive. For example use '-n standby,0' to return success if a
544 device is in SLEEP or STANDBY mode. Use '-n standby,3' to
545 return a unique exit status in this case.
546
547 The valid arguments to this option are:
548
549 never - check the device always, but print the power mode if
550 '-i' is specified.
551
552 sleep[,STATUS] - check the device unless it is in SLEEP mode.
553
554 standby[,STATUS] - check the device unless it is in SLEEP or
555 STANDBY mode. In these modes most disks are not spinning, so if
556 you want to prevent a disk from spinning up, this is probably
557 what you want.
558
559 idle[,STATUS] - check the device unless it is in SLEEP, STANDBY
560 or IDLE mode. In the IDLE state, most disks are still spinning,
561 so this is probably not what you want.
562
563
564 SMART FEATURE ENABLE/DISABLE COMMANDS:
565
566 Note: if multiple options are used to both enable and disable a
567 feature, then both the enable and disable commands will be
568 issued. The enable command will always be issued before the
569 corresponding disable command.
570
571 -s VALUE, --smart=VALUE
572 Enables or disables SMART on device. The valid arguments to
573 this option are on and off.
574
575 [ATA] Note that the ATA commands SMART ENABLE/DISABLE OPERATIONS
576 were declared obsolete in ATA ACS-4 Revision 10 (Nov 2015).
577
578 [SCSI tape drive or changer] It is not necessary (or useful) to
579 enable SMART to see the TapeAlert messages.
580
581 -o VALUE, --offlineauto=VALUE
582 [ATA only] Enables or disables SMART automatic offline test,
583 which scans the drive every four hours for disk defects. This
584 command can be given during normal system operation. The valid
585 arguments to this option are on and off.
586
587 Note that the SMART automatic offline test command is listed as
588 "Obsolete" in every version of the ATA and ATA/ATAPI Specifica‐
589 tions. It was originally part of the SFF-8035i Revision 2.0
590 specification, but was never part of any ATA specification.
591 However it is implemented and used by many vendors. You can
592 tell if automatic offline testing is supported by seeing if this
593 command enables and disables it, as indicated by the 'Auto Off‐
594 line Data Collection' part of the SMART capabilities report
595 (displayed with '-c').
596
597 SMART provides three basic categories of testing. The first
598 category, called "online" testing, has no effect on the perfor‐
599 mance of the device. It is turned on by the '-s on' option.
600
601 The second category of testing is called "offline" testing.
602 This type of test can, in principle, degrade the device perfor‐
603 mance. The '-o on' option causes this offline testing to be
604 carried out, automatically, on a regular scheduled basis. Nor‐
605 mally, the disk will suspend offline testing while disk accesses
606 are taking place, and then automatically resume it when the disk
607 would otherwise be idle, so in practice it has little effect.
608 Note that a one-time offline test can also be carried out imme‐
609 diately upon receipt of a user command. See the '-t offline'
610 option below, which causes a one-time offline test to be carried
611 out immediately.
612
613 The choice (made by the SFF-8035i and ATA specification authors)
614 of the word testing for these first two categories is unfortu‐
615 nate, and often leads to confusion. In fact these first two
616 categories of online and offline testing could have been more
617 accurately described as online and offline data collection.
618
619 The results of this automatic or immediate offline testing (data
620 collection) are reflected in the values of the SMART Attributes.
621 Thus, if problems or errors are detected, the values of these
622 Attributes will go below their failure thresholds; some types of
623 errors may also appear in the SMART error log. These are visi‐
624 ble with the '-A' and '-l error' options respectively.
625
626 Some SMART attribute values are updated only during off-line
627 data collection activities; the rest are updated during normal
628 operation of the device or during both normal operation and off-
629 line testing. The Attribute value table produced by the '-A'
630 option indicates this in the UPDATED column. Attributes of the
631 first type are labeled "Offline" and Attributes of the second
632 type are labeled "Always".
633
634 The third category of testing (and the only category for which
635 the word 'testing' is really an appropriate choice) is "self"
636 testing. This third type of test is only performed (immedi‐
637 ately) when a command to run it is issued. The '-t' and '-X'
638 options can be used to carry out and abort such self-tests;
639 please see below for further details.
640
641 Any errors detected in the self testing will be shown in the
642 SMART self-test log, which can be examined using the '-l self‐
643 test' option.
644
645 Note: in this manual page, the word "Test" is used in connection
646 with the second category just described, e.g. for the "offline"
647 testing. The words "Self-test" are used in connection with the
648 third category.
649
650 -S VALUE, --saveauto=VALUE
651 [ATA] Enables or disables SMART autosave of device vendor-spe‐
652 cific Attributes. The valid arguments to this option are on and
653 off. Note that this feature is preserved across disk power
654 cycles, so you should only need to issue it once.
655
656 The ATA standard does not specify a method to check whether
657 SMART autosave is enabled. Unlike SCSI (below), smartctl is
658 unable to print a warning if autosave is disabled.
659
660 Note that the ATA commands SMART ENABLE/DISABLE AUTOSAVE were
661 declared obsolete in ATA ACS-4 Revision 10 (Nov 2015).
662
663 [SCSI] For SCSI devices this toggles the value of the Global
664 Logging Target Save Disabled (GLTSD) bit in the Control Mode
665 Page. Some disk manufacturers set this bit by default. This
666 prevents error counters, power-up hours and other useful data
667 from being placed in non-volatile storage, so these values may
668 be reset to zero the next time the device is power-cycled. If
669 the GLTSD bit is set then 'smartctl -a' will issue a warning.
670 Use on to clear the GLTSD bit and thus enable saving counters to
671 non-volatile storage. For extreme streaming-video type applica‐
672 tions you might consider using off to set the GLTSD bit.
673
674 -g NAME, --get=NAME, -s NAME[,VALUE], --set=NAME[,VALUE]
675 Gets/sets non-SMART device settings. Note that the '--set'
676 option shares its short option '-s' with '--smart'. Valid argu‐
677 ments are:
678
679 all - Gets all values. This is equivalent to
680 '-g aam -g apm -g lookahead -g security -g wcache -g rcache -g
681 dsn'
682
683 aam[,N|off] - [ATA only] Gets/sets the Automatic Acoustic Man‐
684 agement (AAM) feature (if supported). A value of 128 sets the
685 most quiet (slowest) mode and 254 the fastest (loudest) mode,
686 'off' disables AAM. Devices may support intermediate levels.
687 Values below 128 are defined as vendor specific (0) or retired
688 (1 to 127). Note that the AAM feature was declared obsolete in
689 ATA ACS-2 Revision 4a (Dec 2010).
690
691 apm[,N|off] - [ATA only] Gets/sets the Advanced Power Management
692 (APM) feature on device (if supported). If a value between 1
693 and 254 is provided, it will attempt to enable APM and set the
694 specified value, 'off' disables APM. Note the actual behavior
695 depends on the drive, for example some drives disable APM if
696 their value is set above 128. Values below 128 are supposed to
697 allow drive spindown, values 128 and above adjust only head-
698 parking frequency, although the actual behavior defined is also
699 vendor-specific.
700
701 lookahead[,on|off] - [ATA only] Gets/sets the read look-ahead
702 feature (if supported). Read look-ahead is usually enabled by
703 default.
704
705 security - [ATA only] Gets the status of ATA Security feature
706 (if supported). If ATA Security is enabled an ATA user password
707 is set. The drive will be locked on next reset then.
708
709 security-freeze - [ATA only] Sets ATA Security feature to frozen
710 mode. This prevents that the drive accepts any security com‐
711 mands until next reset. Note that the frozen mode may already
712 be set by BIOS or OS.
713
714 standby,[N|off] - [ATA only] Sets the standby (spindown) timer
715 and places the drive in the IDLE mode. A value of 0 or 'off'
716 disables the standby timer. Values from 1 to 240 specify time‐
717 outs from 5 seconds to 20 minutes in 5 second increments. Val‐
718 ues from 241 to 251 specify timeouts from 30 minutes to 330 min‐
719 utes in 30 minute increments. Value 252 specifies 21 minutes.
720 Value 253 specifies a vendor specific time between 8 and 12
721 hours. Value 255 specifies 21 minutes and 15 seconds. Some
722 drives may use a vendor specific interpretation for the values.
723 Note that there is no get option because ATA standards do not
724 specify a method to read the standby timer. If '-s standby,now'
725 is also specified, the drive is immediately placed in the
726 STANDBY mode without temporarily placing it in the IDLE mode.
727 Note that ATA standards do not specify a command to set the
728 standby timer without affecting the power mode.
729
730 standby,now - [ATA only] Places the drive in the STANDBY mode.
731 This usually spins down the drive. The setting of the standby
732 timer is not affected unless '-s standby,[N|off]' is also speci‐
733 fied.
734
735 wcache[,on|off] - [ATA] Gets/sets the volatile write cache fea‐
736 ture (if supported). The write cache is usually enabled by
737 default.
738
739 wcache[,on|off] - [SCSI] Gets/sets the 'Write Cache Enable'
740 (WCE) bit (if supported). The write cache is usually enabled by
741 default.
742
743 wcache-sct[,ata|on|off[,p]] - [ATA only] Gets/sets the write
744 cache feature through SCT Feature Control (if supported). The
745 state of write cache in SCT Feature Control could be "Controlled
746 by ATA", "Force Enabled", or "Force Disabled". SCT Feature con‐
747 trol overwrites the setting by ATA Set Features command
748 (wcache[,on|off] option). If SCT Feature Control sets write
749 cache as "Force Enabled" or "Force Disabled", the setting of
750 wcache[,on|off] is ignored by the drive. SCT Feature Control
751 usually sets write cache as "Controlled by ATA" by default. If
752 ',p' is specified, the setting is preserved across power cycles.
753
754 wcreorder[,on|off[,p]] - [ATA only] Gets/sets Write Cache
755 Reordering. If it is disabled (off), disk write scheduling is
756 executed on a first-in-first-out (FIFO) basis. If Write Cache
757 Reordering is enabled (on), then disk write scheduling may be
758 reordered by the drive. If write cache is disabled, the current
759 Write Cache Reordering state is remembered but has no effect on
760 non-cached writes, which are always written in the order
761 received. The state of Write Cache Reordering has no effect on
762 either NCQ or LCQ queued commands. If ',p' is specified, the
763 setting is preserved across power cycles.
764
765 rcache[,on|off] - [SCSI only] Gets/sets the 'Read Cache Disable'
766 (RCE) bit. 'Off' value disables read cache (if supported). The
767 read cache is usually enabled by default.
768
769 dsn[,on|off] - [ATA only] Gets/sets the DSN feature (if sup‐
770 ported). The dsn is usually disabled by default.
771
772
773 SMART READ AND DISPLAY DATA OPTIONS:
774
775 -H, --health
776 Prints the health status of the device or pending TapeAlert mes‐
777 sages.
778
779 If the device reports failing health status, this means either
780 that the device has already failed, or that it is predicting its
781 own failure within the next 24 hours. If this happens, use the
782 '-a' option to get more information, and get your data off the
783 disk and to someplace safe as soon as you can.
784
785 [ATA] Health status is obtained by checking the (boolean) result
786 returned by the SMART RETURN STATUS command. The return value
787 of this ATA command may be unknown due to limitations or bugs in
788 some layer (e.g. RAID controller or USB bridge firmware) between
789 disk and operating system. In this case, smartctl prints a
790 warning and checks whether any Prefailure SMART Attribute value
791 is less than or equal to its threshold (see '-A' below).
792
793 [SCSI] Health status is obtained by checking the Additional
794 Sense Code (ASC) and Additional Sense Code Qualifier (ASCQ) from
795 Informal Exceptions (IE) log page (if supported) and/or from
796 SCSI sense data.
797
798 [SCSI tape drive or changer] TapeAlert status is obtained by
799 reading the TapeAlert log page. Please note that the TapeAlert
800 log page flags are cleared for the initiator when the page is
801 read. This means that each alert condition is reported only
802 once by smartctl for each initiator for each activation of the
803 condition.
804
805 [NVMe] NVMe status is obtained by reading the "Critical Warning"
806 byte from the SMART/Health Information log.
807
808 -c, --capabilities
809 [ATA] Prints only the generic SMART capabilities. These show
810 what SMART features are implemented and how the device will
811 respond to some of the different SMART commands. For example it
812 shows if the device logs errors, if it supports offline surface
813 scanning, and so on. If the device can carry out self-tests,
814 this option also shows the estimated time required to run those
815 tests.
816
817 [NVMe] Prints various NVMe device capabilities obtained from the
818 Identify Controller and the Identify Namespace data structure.
819
820 -A, --attributes
821 [ATA] Prints only the vendor specific SMART Attributes. The
822 Attributes are numbered from 1 to 253 and have specific names
823 and ID numbers. For example Attribute 12 is "power cycle
824 count": how many times has the disk been powered up.
825
826 Each Attribute has a "Raw" value, printed under the heading
827 "RAW_VALUE", and a "Normalized" value printed under the heading
828 "VALUE". [Note: smartctl prints these values in base-10.] In
829 the example just given, the "Raw Value" for Attribute 12 would
830 be the actual number of times that the disk has been power-
831 cycled, for example 365 if the disk has been turned on once per
832 day for exactly one year. Each vendor uses their own algorithm
833 to convert this "Raw" value to a "Normalized" value in the range
834 from 1 to 254. Please keep in mind that smartctl only reports
835 the different Attribute types, values, and thresholds as read
836 from the device. It does not carry out the conversion between
837 "Raw" and "Normalized" values: this is done by the disk's
838 firmware.
839
840 The conversion from Raw value to a quantity with physical units
841 is not specified by the SMART standard. In most cases, the val‐
842 ues printed by smartctl are sensible. For example the tempera‐
843 ture Attribute generally has its raw value equal to the tempera‐
844 ture in Celsius. However in some cases vendors use unusual con‐
845 ventions. For example the Hitachi disk on my laptop reports its
846 power-on hours in minutes, not hours. Some IBM disks track
847 three temperatures rather than one, in their raw values. And so
848 on.
849
850 Each Attribute also has a Threshold value (whose range is 0 to
851 255) which is printed under the heading "THRESH". If the Nor‐
852 malized value is less than or equal to the Threshold value, then
853 the Attribute is said to have failed. If the Attribute is a
854 pre-failure Attribute, then disk failure is imminent.
855
856 Each Attribute also has a "Worst" value shown under the heading
857 "WORST". This is the smallest (closest to failure) value that
858 the disk has recorded at any time during its lifetime when SMART
859 was enabled. [Note however that some vendors firmware may actu‐
860 ally increase the "Worst" value for some "rate-type"
861 Attributes.]
862
863 The Attribute table printed out by smartctl also shows the
864 "TYPE" of the Attribute. Attributes are one of two possible
865 types: Pre-failure or Old age. Pre-failure Attributes are ones
866 which, if less than or equal to their threshold values, indicate
867 pending disk failure. Old age, or usage Attributes, are ones
868 which indicate end-of-product life from old-age or normal aging
869 and wearout, if the Attribute value is less than or equal to the
870 threshold. Please note: the fact that an Attribute is of type
871 'Pre-fail' does not mean that your disk is about to fail! It
872 only has this meaning if the Attribute's current Normalized
873 value is less than or equal to the threshold value.
874
875 If the Attribute's current Normalized value is less than or
876 equal to the threshold value, then the "WHEN_FAILED" column will
877 display "FAILING_NOW". If not, but the worst recorded value is
878 less than or equal to the threshold value, then this column will
879 display "In_the_past". If the "WHEN_FAILED" column has no entry
880 (indicated by a dash: '-') then this Attribute is OK now (not
881 failing) and has also never failed in the past.
882
883 The table column labeled "UPDATED" shows if the SMART Attribute
884 values are updated during both normal operation and off-line
885 testing, or only during offline testing. The former are labeled
886 "Always" and the latter are labeled "Offline".
887
888 So to summarize: the Raw Attribute values are the ones that
889 might have a real physical interpretation, such as "Temperature
890 Celsius", "Hours", or "Start-Stop Cycles". Each manufacturer
891 converts these, using their detailed knowledge of the disk's
892 operations and failure modes, to Normalized Attribute values in
893 the range 1–254. The current and worst (lowest measured) of
894 these Normalized Attribute values are stored on the disk, along
895 with a Threshold value that the manufacturer has determined will
896 indicate that the disk is going to fail, or that it has exceeded
897 its design age or aging limit. smartctl does not calculate any
898 of the Attribute values, thresholds, or types, it merely reports
899 them from the SMART data on the device.
900
901 Note that starting with ATA/ATAPI-4, revision 4, the meaning of
902 these Attribute fields has been made entirely vendor-specific.
903 However most newer ATA/SATA disks seem to respect their meaning,
904 so we have retained the option of printing the Attribute values.
905
906 Solid-state drives use different meanings for some of the
907 attributes. In this case the attribute name printed by smartctl
908 is incorrect unless the drive is already in the smartmontools
909 drive database.
910
911 Note that the ATA command SMART READ DATA was declared obsolete
912 in ATA ACS-4 Revision 10 (Nov 2015).
913
914 [SCSI] For SCSI devices the "attributes" are obtained from the
915 temperature and start-stop cycle counter log pages. Certain
916 vendor specific attributes are listed if recognised. The
917 attributes are output in a relatively free format (compared with
918 ATA disk attributes).
919
920 [NVMe] For NVMe devices the attributes are obtained from the
921 SMART/Health Information log.
922
923 -f FORMAT, --format=FORMAT
924 [ATA only] Selects the output format of the attributes:
925
926 old - Old smartctl format. This is the default unless the '-x'
927 option is specified.
928
929 brief - New format which fits into 80 columns (except in some
930 rare cases). This format also decodes four additional attribute
931 flags. This is the default if the '-x' option is specified.
932
933 hex,id - Print all attribute IDs as hexadecimal numbers.
934
935 hex,val - Print all normalized values as hexadecimal numbers.
936
937 hex - Same as '-f hex,id -f hex,val'.
938
939 -l TYPE, --log=TYPE
940 Prints various device logs. The valid arguments to this option
941 are:
942
943 error - [ATA] prints the Summary SMART error log. SMART disks
944 maintain a log of the most recent five non-trivial errors. For
945 each of these errors, the disk power-on lifetime at which the
946 error occurred is recorded, as is the device status (idle,
947 standby, etc) at the time of the error. For some common types
948 of errors, the Error Register (ER) and Status Register (SR) val‐
949 ues are decoded and printed as text. The meanings of these are:
950 ABRT: Command ABoRTed
951 AMNF: Address Mark Not Found
952 CCTO: Command Completion Timed Out
953 EOM: End Of Media
954 ICRC: Interface Cyclic Redundancy Code (CRC) error
955 IDNF: IDentity Not Found
956 ILI: (packet command-set specific)
957 MC: Media Changed
958 MCR: Media Change Request
959 NM: No Media
960 obs: obsolete
961 TK0NF: TracK 0 Not Found
962 UNC: UNCorrectable Error in Data
963 WP: Media is Write Protected
964 In addition, up to the last five commands that preceded the
965 error are listed, along with a timestamp measured from the start
966 of the corresponding power cycle. This is displayed in the form
967 Dd+HH:MM:SS.msec where D is the number of days, HH is hours, MM
968 is minutes, SS is seconds and msec is milliseconds. [Note: this
969 time stamp wraps after 2^32 milliseconds, or 49 days 17 hours 2
970 minutes and 47.296 seconds.] The key ATA disk registers are
971 also recorded in the log. The final column of the error log is
972 a text-string description of the ATA command defined by the Com‐
973 mand Register (CR) and Feature Register (FR) values. Commands
974 that are obsolete in the most current spec are listed like this:
975 READ LONG (w/ retry) [OBS-4], indicating that the command became
976 obsolete with or in the ATA-4 specification. Similarly, the
977 notation [RET-N] is used to indicate that a command was retired
978 in the ATA-N specification. Some commands are not defined in
979 any version of the ATA specification but are in common use none‐
980 theless; these are marked [NS], meaning non-standard.
981
982 The ATA Specification (ATA ACS-2 Revision 7, Section A.7.1)
983 says: "Error log data structures shall include, but are not lim‐
984 ited to, Uncorrectable errors, ID Not Found errors for which the
985 LBA requested was valid, servo errors, and write fault errors.
986 Error log data structures shall not include errors attributed to
987 the receipt of faulty commands." The definitions of these terms
988 are:
989 UNC (UNCorrectable): data is uncorrectable. This refers to data
990 which has been read from the disk, but for which the Error
991 Checking and Correction (ECC) codes are inconsistent. In
992 effect, this means that the data can not be read.
993 IDNF (ID Not Found): user-accessible address could not be found.
994 For READ LOG type commands, IDNF can also indicate that a device
995 data log structure checksum was incorrect.
996
997 If the command that caused the error was a READ or WRITE com‐
998 mand, then the Logical Block Address (LBA) at which the error
999 occurred will be printed in base 10 and base 16. The LBA is a
1000 linear address, which counts 512-byte sectors on the disk,
1001 starting from zero. (Because of the limitations of the SMART
1002 error log, if the LBA is greater than 0xfffffff, then either no
1003 error log entry will be made, or the error log entry will have
1004 an incorrect LBA. This may happen for drives with a capacity
1005 greater than 128 GiB or 137 GB.) On Linux systems the smartmon‐
1006 tools web page has instructions about how to convert the LBA
1007 address to the name of the disk file containing the erroneous
1008 disk sector.
1009
1010 Please note that some manufacturers ignore the ATA specifica‐
1011 tions, and make entries in the error log if the device receives
1012 a command which is not implemented or is not valid.
1013
1014 error - [SCSI] prints the error counter log pages for reads,
1015 write and verifies. The verify row is only output if it has an
1016 element other than zero.
1017
1018 error[,NUM] - [NVMe] prints the NVMe Error Information log.
1019 Only the 16 most recent log entries are printed by default.
1020 This number can be changed by the optional parameter NUM. The
1021 maximum number of log entries is vendor specific (in the range
1022 from 1 to 256 inclusive).
1023
1024 xerror[,NUM][,error] - [ATA only] prints the Extended Comprehen‐
1025 sive SMART error log (General Purpose Log address 0x03). Unlike
1026 the Summary SMART error log (see '-l error' above), it provides
1027 sufficient space to log the contents of the 48-bit LBA register
1028 set introduced with ATA-6. It also supports logs with more than
1029 one sector. Each sector holds up to 4 log entries. The actual
1030 number of log sectors is vendor specific.
1031
1032 Only the 8 most recent error log entries are printed by default.
1033 This number can be changed by the optional parameter NUM.
1034
1035 If ',error' is appended and the Extended Comprehensive SMART
1036 error log is not supported, the Summary SMART self-test log is
1037 printed.
1038
1039 Please note that recent drives may report errors only in the
1040 Extended Comprehensive SMART error log. The Summary SMART error
1041 log may be reported as supported but is always empty then.
1042
1043 selftest - [ATA] prints the SMART self-test log. The disk main‐
1044 tains a self-test log showing the results of the self tests,
1045 which can be run using the '-t' option described below. For
1046 each of the most recent twenty-one self-tests, the log shows the
1047 type of test (short or extended, off-line or captive) and the
1048 final status of the test. If the test did not complete success‐
1049 fully, then the percentage of the test remaining is shown. The
1050 time at which the test took place, measured in hours of disk
1051 lifetime, is also printed. [Note: this time stamp wraps after
1052 2^16 hours, or 2730 days and 16 hours, or about 7.5 years.] If
1053 any errors were detected, the Logical Block Address (LBA) of the
1054 first error is printed in decimal notation.
1055
1056 selftest - [SCSI] the self-test log for a SCSI device has a
1057 slightly different format than for an ATA device. For each of
1058 the most recent twenty self-tests, it shows the type of test and
1059 the status (final or in progress) of the test. SCSI standards
1060 use the terms "foreground" and "background" (rather than ATA's
1061 corresponding "captive" and "off-line") and "short" and "long"
1062 (rather than ATA's corresponding "short" and "extended") to
1063 describe the type of the test. The printed segment number is
1064 only relevant when a test fails in the third or later test seg‐
1065 ment. It identifies the test that failed and consists of either
1066 the number of the segment that failed during the test, or the
1067 number of the test that failed and the number of the segment in
1068 which the test was run, using a vendor-specific method of
1069 putting both numbers into a single byte. The Logical Block
1070 Address (LBA) of the first error is printed in hexadecimal nota‐
1071 tion. If provided, the SCSI Sense Key (SK), Additional Sense
1072 Code (ASC) and Additional Sense Code Qualifier (ASCQ) are also
1073 printed. The self tests can be run using the '-t' option
1074 described below (using the ATA test terminology).
1075
1076 xselftest[,NUM][,selftest] - [ATA only] prints the Extended
1077 SMART self-test log (General Purpose Log address 0x07). Unlike
1078 the SMART self-test log (see '-l selftest' above), it supports
1079 48-bit LBA and logs with more than one sector. Each sector
1080 holds up to 19 log entries. The actual number of log sectors is
1081 vendor specific.
1082
1083 Only the 25 most recent log entries are printed by default.
1084 This number can be changed by the optional parameter NUM.
1085
1086 If ',selftest' is appended and the Extended SMART self-test log
1087 is not supported, the old SMART self-test log is printed.
1088
1089 selective - [ATA only] Please see the '-t select' option below
1090 for a description of selective self-tests. The selective self-
1091 test log shows the start/end Logical Block Addresses (LBA) of
1092 each of the five test spans, and their current test status. If
1093 the span is being tested or the remainder of the disk is being
1094 read-scanned, the current 65536-sector block of LBAs being
1095 tested is also displayed. The selective self-test log also
1096 shows if a read-scan of the remainder of the disk will be car‐
1097 ried out after the selective self-test has completed (see '-t
1098 afterselect' option) and the time delay before restarting this
1099 read-scan if it is interrupted (see '-t pending' option).
1100
1101 directory[,gs] - [ATA only] if the device supports the General
1102 Purpose Logging feature set (ATA-6 and above) then this prints
1103 the Log Directory (the log at address 0). The Log Directory
1104 shows what logs are available and their length in sectors (512
1105 bytes). The contents of the logs at address 1 [Summary SMART
1106 error log] and at address 6 [SMART self-test log] may be printed
1107 using the previously-described error and selftest arguments to
1108 this option. If your version of smartctl supports 48-bit ATA
1109 commands, both the General Purpose Log (GPL) and SMART Log (SL)
1110 directories are printed in one combined table. The output can
1111 be restricted to the GPL directory or SL directory by '-l direc‐
1112 tory,q' or '-l directory,s' respectively.
1113
1114 background - [SCSI only] the background scan results log outputs
1115 information derived from Background Media Scans (BMS) done after
1116 power up and/or periodically (e.g. every 24 hours) on recent
1117 SCSI disks. If supported, the BMS status is output first, indi‐
1118 cating whether a background scan is currently underway (and if
1119 so a progress percentage), the amount of time the disk has been
1120 powered up and the number of scans already completed. Then
1121 there is a header and a line for each background scan "event".
1122 These will typically be either recovered or unrecoverable
1123 errors. That latter group may need some attention. There is a
1124 description of the background scan mechanism in section 4.18 of
1125 SBC-3 revision 6 (see www.t10.org ).
1126
1127 scttemp, scttempsts, scttemphist - [ATA only] prints the disk
1128 temperature information provided by the SMART Command Transport
1129 (SCT) commands. The option 'scttempsts' prints current tempera‐
1130 ture and temperature ranges returned by the SCT Status command,
1131 'scttemphist' prints temperature limits and the temperature his‐
1132 tory table returned by the SCT Data Table command, and 'scttemp'
1133 prints both. The temperature values are preserved across power
1134 cycles. The logging interval can be configured with the '-l
1135 scttempint,N[,p]' option, see below. The SCT commands were
1136 introduced in ATA8-ACS and were also supported by many ATA-7
1137 disks.
1138
1139 scttempint,N[,p] - [ATA only] clears the SCT temperature history
1140 table and sets the time interval for temperature logging to N
1141 minutes. If ',p' is specified, the setting is preserved across
1142 power cycles. Otherwise, the setting is volatile and will be
1143 reverted to the last non-volatile setting by the next hard
1144 reset. The default interval is vendor specific, typical values
1145 are 1, 2, or 5 minutes.
1146
1147 scterc[,READTIME,WRITETIME] - [ATA only] prints values and
1148 descriptions of the SCT Error Recovery Control settings. These
1149 are equivalent to TLER (as used by Western Digital), CCTL (as
1150 used by Samsung and Hitachi/HGST) and ERC (as used by Seagate).
1151 READTIME and WRITETIME arguments (deciseconds) set the specified
1152 values. Values of 0 disable the feature, other values less than
1153 65 are probably not supported. For RAID configurations, this is
1154 typically set to 70,70 deciseconds.
1155
1156 devstat[,PAGE] - [ATA only] prints values and descriptions of
1157 the ATA Device Statistics log pages (General Purpose Log address
1158 0x04). If no PAGE number is specified, entries from all sup‐
1159 ported pages are printed. If PAGE 0 is specified, the list of
1160 supported pages is printed. Device Statistics was introduced in
1161 ACS-2 and is only supported by some recent devices.
1162
1163 defects[,NUM] - [ATA only] prints LBA and hours values from the
1164 ATA Pending Defects log (General Purpose Log address 0x0c).
1165 Only the 31 entries from first log page are printed by default.
1166 This number can be changed by the optional parameter NUM. The
1167 size of the log and the order of the entries are vendor spe‐
1168 cific. The Pending Defects log was introduced in ACS-4 Revision
1169 01 (Mar 2014).
1170
1171 sataphy[,reset] - [SATA only] prints values and descriptions of
1172 the SATA Phy Event Counters (General Purpose Log address 0x11).
1173 If '-l sataphy,reset' is specified, all counters are reset after
1174 reading the values. This also works for SATA devices with
1175 Packet interface like CD/DVD drives.
1176
1177 sasphy[,reset] - [SAS (SCSI) only] prints values and descrip‐
1178 tions of the SAS (SSP) Protocol Specific log page (log page
1179 0x18). If '-l sasphy,reset' is specified, all counters are
1180 reset after reading the values.
1181
1182 gplog,ADDR[,FIRST[-LAST|+SIZE]] - [ATA only] prints a hex dump
1183 of any log accessible via General Purpose Logging (GPL) feature.
1184 The log address ADDR is the hex address listed in the log direc‐
1185 tory (see '-l directory' above). The range of log sectors
1186 (pages) can be specified by decimal values FIRST-LAST or
1187 FIRST+SIZE. FIRST defaults to 0, SIZE defaults to 1. LAST can
1188 be set to 'max' to specify the last page of the log.
1189
1190 smartlog,ADDR[,FIRST[-LAST|+SIZE]] - [ATA only] prints a hex
1191 dump of any log accessible via SMART Read Log command. See '-l
1192 gplog,...' above for parameter syntax.
1193
1194 For example, all these commands:
1195 smartctl -l gplog,0x80,10-15 /dev/sda
1196 smartctl -l gplog,0x80,10+6 /dev/sda
1197 smartctl -l smartlog,0x80,10-15 /dev/sda
1198 print pages 10–15 of log 0x80 (first host vendor specific log).
1199
1200 The hex dump format is compatible with the 'xxd -r' command.
1201 This command:
1202 smartctl -l gplog,0x11 /dev/sda | grep ^0 | xxd -r >log.bin
1203 writes a binary representation of the one sector log 0x11 (SATA
1204 Phy Event Counters) to file log.bin.
1205
1206 nvmelog,PAGE,SIZE - [NVMe only] prints a hex dump of the first
1207 SIZE bytes from the NVMe log with identifier PAGE. PAGE is a
1208 hexadecimal number in the range from 0x1 to 0xff. SIZE is a
1209 hexadecimal number in the range from 0x4 to 0x4000 (16 KiB).
1210 WARNING: Do not specify the identifier of an unknown log page.
1211 Reading a log page may have undesirable side effects.
1212
1213 ssd - [ATA] prints the Solid State Device Statistics log page.
1214 This has the same effect as '-l devstat,7', see above.
1215
1216 ssd - [SCSI] prints the Solid State Media percentage used
1217 endurance indicator. A value of 0 indicates as new condition
1218 while 100 indicates the device is at the end of its lifetime as
1219 projected by the manufacturer. The value may reach 255.
1220
1221 -v ID,FORMAT[:BYTEORDER][,NAME], --vendorattribute=ID,FORMAT...
1222 [ATA only] Sets a vendor-specific raw value print FORMAT, an
1223 optional BYTEORDER and an optional NAME for Attribute ID. This
1224 option may be used multiple times.
1225
1226 The Attribute ID can be in the range 1 to 255. If 'N' is speci‐
1227 fied as ID, the settings for all Attributes are changed.
1228
1229 The optional BYTEORDER consists of 1 to 8 characters from the
1230 set '012345rvwz'. The characters '0' to '5' select the byte 0
1231 to 5 from the 48-bit raw value, 'r' selects the reserved byte of
1232 the attribute data block, 'v' selects the normalized value, 'w'
1233 selects the worst value and 'z' inserts a zero byte. The
1234 default BYTEORDER is '543210' for all 48-bit formats, 'r543210'
1235 for the 54-bit formats, and '543210wv' for the 64-bit formats.
1236 For example, '-v 5,raw48:012345' prints the raw value of
1237 attribute 5 with big endian instead of little endian byte order‐
1238 ing.
1239
1240 The NAME is a string of letters, digits and underscore. Its
1241 length should not exceed 23 characters. The '-P showall' option
1242 reports an error if this is the case.
1243
1244 -v help - Prints (to STDOUT) a list of all valid arguments to
1245 this option, then exits.
1246
1247 Valid arguments for FORMAT are:
1248
1249 raw8 - Print the Raw value as six 8-bit unsigned base-10 inte‐
1250 gers. This may be useful for decoding the meaning of the Raw
1251 value.
1252
1253 raw16 - Print the Raw value as three 16-bit unsigned base-10
1254 integers. This may be useful for decoding the meaning of the
1255 Raw value.
1256
1257 raw48 - Print the Raw value as a 48-bit unsigned base-10 inte‐
1258 ger. This is the default for most attributes.
1259
1260 hex48 - Print the Raw value as a 12 digit hexadecimal number.
1261 This may be useful for decoding the meaning of the Raw value.
1262
1263 raw56 - Print the Raw value as a 54-bit unsigned base-10 inte‐
1264 ger. This includes the reserved byte which follows the 48-bit
1265 raw value.
1266
1267 hex56 - Print the Raw value as a 14 digit hexadecimal number.
1268 This includes the reserved byte which follows the 48-bit raw
1269 value.
1270
1271 raw64 - Print the Raw value as a 64-bit unsigned base-10 inte‐
1272 ger. This includes two bytes from the normalized and worst
1273 attribute value. This raw format is used by some SSD devices
1274 with Indilinx controller.
1275
1276 hex64 - Print the Raw value as a 16 digit hexadecimal number.
1277 This includes two bytes from the normalized and worst attribute
1278 value. This raw format is used by some SSD devices with Indil‐
1279 inx controller.
1280
1281 min2hour - Raw Attribute is power-on time in minutes. Its raw
1282 value will be displayed in the form "Xh+Ym". Here X is hours,
1283 and Y is minutes in the range 0–59 inclusive. Y is always
1284 printed with two digits, for example "06" or "31" or "00".
1285
1286 sec2hour - Raw Attribute is power-on time in seconds. Its raw
1287 value will be displayed in the form "Xh+Ym+Zs". Here X is
1288 hours, Y is minutes in the range 0–59 inclusive, and Z is sec‐
1289 onds in the range 0–59 inclusive. Y and Z are always printed
1290 with two digits, for example "06" or "31" or "00".
1291
1292 halfmin2hour - Raw Attribute is power-on time, measured in units
1293 of 30 seconds. This format is used by some Samsung disks. Its
1294 raw value will be displayed in the form "Xh+Ym". Here X is
1295 hours, and Y is minutes in the range 0–59 inclusive. Y is
1296 always printed with two digits, for example "06" or "31" or
1297 "00".
1298
1299 msec24hour32 - Raw Attribute is power-on time measured in 32-bit
1300 hours and 24-bit milliseconds since last hour update. It will
1301 be displayed in the form "Xh+Ym+Z.Ms". Here X is hours, Y is
1302 minutes, Z is seconds and M is milliseconds.
1303
1304 tempminmax - Raw Attribute is the disk temperature in Celsius.
1305 Info about Min/Max temperature is printed if available. This is
1306 the default for Attributes 190 and 194. The recording interval
1307 (lifetime, last power cycle, last soft reset) of the min/max
1308 values is device specific.
1309
1310 temp10x - Raw Attribute is ten times the disk temperature in
1311 Celsius.
1312
1313 raw16(raw16) - Print the raw attribute as a 16-bit value and two
1314 optional 16-bit values if these words are nonzero. This is the
1315 default for Attributes 5 and 196.
1316
1317 raw16(avg16) - Raw attribute is spin-up time. It is printed as
1318 a 16-bit value and an optional "Average" 16-bit value if the
1319 word is nonzero. This is the default for Attribute 3.
1320
1321 raw24(raw8) - Print the raw attribute as a 24-bit value and
1322 three optional 8-bit values if these bytes are nonzero. This is
1323 the default for Attribute 9.
1324
1325 raw24/raw24 - Raw Attribute contains two 24-bit values. The
1326 first is the number of load cycles. The second is the number of
1327 unload cycles. The difference between these two values is the
1328 number of times that the drive was unexpectedly powered off
1329 (also called an emergency unload). As a rule of thumb, the
1330 mechanical stress created by one emergency unload is equivalent
1331 to that created by one hundred normal unloads.
1332
1333 raw24/raw32 - Raw attribute is an error rate which consists of a
1334 24-bit error count and a 32-bit total count.
1335
1336 The following old arguments to '-v' are also still valid:
1337
1338 9,minutes - same as: 9,min2hour,Power_On_Minutes.
1339
1340 9,seconds - same as: 9,sec2hour,Power_On_Seconds.
1341
1342 9,halfminutes - same as: 9,halfmin2hour,Power_On_Half_Minutes.
1343
1344 9,temp - same as: 9,tempminmax,Temperature_Celsius.
1345
1346 192,emergencyretractcyclect - same as:
1347 192,raw48,Emerg_Retract_Cycle_Ct
1348
1349 193,loadunload - same as: 193,raw24/raw24.
1350
1351 194,10xCelsius - same as: 194,temp10x,Temperature_Celsius_x10.
1352
1353 194,unknown - same as: 194,raw48,Unknown_Attribute.
1354
1355 197,increasing - same as: 197,raw48,Total_Pending_Sectors. Also
1356 means that Attribute number 197 (Current Pending Sector Count)
1357 is not reset if uncorrectable sectors are reallocated (see
1358 smartd.conf(5) man page).
1359
1360 198,increasing - same as: 198,raw48,Total_Offl_Uncorrectabl.
1361 Also means that Attribute number 198 (Offline Uncorrectable Sec‐
1362 tor Count) is not reset if uncorrectable sectors are reallocated
1363 (see smartd.conf(5) man page).
1364
1365 198,offlinescanuncsectorct - same as: 198,raw48,Off‐
1366 line_Scan_UNC_SectCt.
1367
1368 200,writeerrorcount - same as: 200,raw48,Write_Error_Count.
1369
1370 201,detectedtacount - same as: 201,raw48,Detected_TA_Count.
1371
1372 220,temp - same as: 220,tempminmax,Temperature_Celsius.
1373
1374 -F TYPE, --firmwarebug=TYPE
1375 [ATA only] Modifies the behavior of smartctl to compensate for
1376 some known and understood device firmware or driver bug. This
1377 option may be used multiple times. The valid arguments are:
1378
1379 none - Assume that the device firmware obeys the ATA specifica‐
1380 tions. This is the default, unless the device has presets for
1381 '-F' in the drive database. Using this option on the command
1382 line will override any preset values.
1383
1384 nologdir - Suppresses read attempts of SMART or GP Log Direc‐
1385 tory. Support for all standard logs is assumed without an
1386 actual check. Some Intel SSDs may freeze if log address 0 is
1387 read.
1388
1389 samsung - In some Samsung disks (example: model SV4012H Firmware
1390 Version: RM100-08) some of the two- and four-byte quantities in
1391 the SMART data structures are byte-swapped (relative to the ATA
1392 specification). Enabling this option tells smartctl to evaluate
1393 these quantities in byte-reversed order. Some signs that your
1394 disk needs this option are (1) no self-test log printed, even
1395 though you have run self-tests; (2) very large numbers of ATA
1396 errors reported in the ATA error log; (3) strange and impossible
1397 values for the ATA error log timestamps.
1398
1399 samsung2 - In some Samsung disks the number of ATA errors
1400 reported is byte swapped. Enabling this option tells smartctl
1401 to evaluate this quantity in byte-reversed order. An indication
1402 that your Samsung disk needs this option is that the self-test
1403 log is printed correctly, but there are a very large number of
1404 errors in the SMART error log. This is because the error count
1405 is byte swapped. Thus a disk with five errors (0x0005) will
1406 appear to have 20480 errors (0x5000).
1407
1408 samsung3 - Some Samsung disks (at least SP2514N with Firmware
1409 VF100-37) report a self-test still in progress with 0% remaining
1410 when the test was already completed. Enabling this option modi‐
1411 fies the output of the self-test execution status (see options
1412 '-c' or '-a' above) accordingly.
1413
1414 xerrorlba - Fixes LBA byte ordering in Extended Comprehensive
1415 SMART error log. Some disks use little endian byte ordering
1416 instead of ATA register ordering to specify the LBA addresses in
1417 the log entries.
1418
1419 swapid - Fixes byte swapped ATA identify strings (device name,
1420 serial number, firmware version) returned by some buggy device
1421 drivers.
1422
1423 -P TYPE, --presets=TYPE
1424 [ATA only] Specifies whether smartctl should use any preset
1425 options that are available for this drive. By default, if the
1426 drive is recognized in the smartmontools database, then the pre‐
1427 sets are used.
1428
1429 The argument show will show any preset options for your drive
1430 and the argument showall will show all known drives in the
1431 smartmontools database, along with their preset options. If
1432 there are no presets for your drive and you think there should
1433 be (for example, a -v or -F option is needed to get smartctl to
1434 display correct values) then please contact the smartmontools
1435 developers so that this information can be added to the smart‐
1436 montools database. Contact information is at the end of this
1437 man page.
1438
1439 The valid arguments to this option are:
1440
1441 use - if a drive is recognized, then use the stored presets for
1442 it. This is the default. Note that presets will NOT override
1443 additional Attribute interpretation ('-v N,something') command-
1444 line options or explicit '-F' command-line options..
1445
1446 ignore - do not use presets.
1447
1448 show - show if the drive is recognized in the database, and if
1449 so, its presets, then exit.
1450
1451 showall - list all recognized drives, and the presets that are
1452 set for them, then exit. This also checks the drive database
1453 regular expressions and settings for syntax errors.
1454
1455 The '-P showall' option takes up to two optional arguments to
1456 match a specific drive type and firmware version. The command:
1457 smartctl -P showall
1458 lists all entries, the command:
1459 smartctl -P showall 'MODEL'
1460 lists all entries matching MODEL, and the command:
1461 smartctl -P showall 'MODEL' 'FIRMWARE'
1462 lists all entries for this MODEL and a specific FIRMWARE ver‐
1463 sion.
1464
1465 -B [+]FILE, --drivedb=[+]FILE
1466 [ATA only] Read the drive database from FILE. The new database
1467 replaces the built in database by default. If '+' is specified,
1468 then the new entries prepend the built in entries.
1469
1470 Optional entries are read from the file /etc/smartmon‐
1471 tools/smart_drivedb.h if this option is not specified.
1472
1473 If /usr/share/smartmontools/drivedb.h is present, the contents
1474 of this file is used instead of the built in table.
1475
1476 Run /usr/sbin/update-smart-drivedb to update this file from the
1477 smartmontools SVN repository.
1478
1479 The database files use the same C/C++ syntax that is used to
1480 initialize the built in database array. C/C++ style comments
1481 are allowed. Example:
1482
1483 /* Full entry: */
1484 {
1485 "Model family", // Info about model family/series.
1486 "MODEL1.*REGEX", // Regular expression to match model of device.
1487 "VERSION.*REGEX", // Regular expression to match firmware version(s).
1488 "Some warning", // Warning message.
1489 "-v 9,minutes" // String of preset -v and -F options.
1490 },
1491 /* Minimal entry: */
1492 {
1493 "", // No model family/series info.
1494 "MODEL2.*REGEX", // Regular expression to match model of device.
1495 "", // All firmware versions.
1496 "", // No warning.
1497 "" // No options preset.
1498 },
1499 /* USB ID entry: */
1500 {
1501 "USB: Device; Bridge", // Info about USB device and bridge name.
1502 "0x1234:0xabcd", // Regular expression to match vendor:product ID.
1503 "0x0101", // Regular expression to match bcdDevice.
1504 "", // Not used.
1505 "-d sat" // String with device type option.
1506 },
1507 /* ... */
1508
1509
1510 SMART RUN/ABORT OFFLINE TEST AND self-test OPTIONS:
1511
1512 -t TEST, --test=TEST
1513 Executes TEST immediately. The '-C' option can be used in con‐
1514 junction with this option to run the short or long (and also for
1515 ATA devices, selective or conveyance) self-tests in captive mode
1516 (known as "foreground mode" for SCSI devices). Note that only
1517 one test type can be run at a time, so only one test type should
1518 be specified per command line. Note also that if a computer is
1519 shutdown or power cycled during a self-test, no harm should
1520 result. The self-test will either be aborted or will resume
1521 automatically.
1522
1523 All '-t TEST' commands can be given during normal system opera‐
1524 tion unless captive mode ('-C' option) is used. A running self-
1525 test can, however, degrade performance of the drive. Frequent
1526 I/O requests from the operating system increase the duration of
1527 a test. These impacts may vary from device to device.
1528
1529 If a test failure occurs then the device may discontinue the
1530 testing and report the result immediately.
1531
1532 [ATA] Note that the ATA command SMART EXECUTE OFF-LINE IMMEDIATE
1533 (the command to start a test) was declared obsolete in ATA ACS-4
1534 Revision 10 (Nov 2015).
1535
1536 The valid arguments to this option are:
1537
1538 offline - [ATA] runs SMART Immediate Offline Test. This immedi‐
1539 ately starts the test described above. This command can be
1540 given during normal system operation. The effects of this test
1541 are visible only in that it updates the SMART Attribute values,
1542 and if errors are found they will appear in the SMART error log,
1543 visible with the '-l error' option.
1544
1545 If the '-c' option to smartctl shows that the device has the
1546 "Suspend Offline collection upon new command" capability then
1547 you can track the progress of the Immediate Offline test using
1548 the '-c' option to smartctl. If the '-c' option show that the
1549 device has the "Abort Offline collection upon new command" capa‐
1550 bility then most commands will abort the Immediate Offline Test,
1551 so you should not try to track the progress of the test with
1552 '-c', as it will abort the test.
1553
1554 offline - [SCSI] runs the default self test in foreground. No
1555 entry is placed in the self test log.
1556
1557 short - [ATA] runs SMART Short Self Test (usually under ten min‐
1558 utes). This command can be given during normal system operation
1559 (unless run in captive mode - see the '-C' option below). This
1560 is a test in a different category than the immediate or auto‐
1561 matic offline tests. The "Self" tests check the electrical and
1562 mechanical performance as well as the read performance of the
1563 disk. Their results are reported in the Self Test Error Log,
1564 readable with the '-l selftest' option. Note that on some disks
1565 the progress of the self-test can be monitored by watching this
1566 log during the self-test; with other disks use the '-c' option
1567 to monitor progress.
1568
1569 short - [SCSI] runs the "Background short" self-test.
1570
1571 long - [ATA] runs SMART Extended Self Test (tens of minutes to
1572 several hours). This is a longer and more thorough version of
1573 the Short Self Test described above. Note that this command can
1574 be given during normal system operation (unless run in captive
1575 mode - see the '-C' option below).
1576
1577 long - [SCSI] runs the "Background long" self-test.
1578
1579 conveyance - [ATA only] runs a SMART Conveyance Self Test (min‐
1580 utes). This self-test routine is intended to identify damage
1581 incurred during transporting of the device. This self-test rou‐
1582 tine should take on the order of minutes to complete. Note that
1583 this command can be given during normal system operation (unless
1584 run in captive mode - see the '-C' option below).
1585
1586 select,N-M, select,N+SIZE - [ATA only] runs a SMART Selective
1587 Self Test, to test a range of disk Logical Block Addresses
1588 (LBAs), rather than the entire disk. Each range of LBAs that is
1589 checked is called a "span" and is specified by a starting LBA
1590 (N) and an ending LBA (M) with N less than or equal to M. The
1591 range can also be specified as N+SIZE. A span at the end of a
1592 disk can be specified by N-max.
1593
1594 For example the commands:
1595 smartctl -t select,10-20 /dev/sda
1596 smartctl -t select,10+11 /dev/sda
1597 both runs a self test on one span consisting of LBAs ten to
1598 twenty (inclusive). The command:
1599 smartctl -t select,100000000-max /dev/sda
1600 run a self test from LBA 100000000 up to the end of the disk.
1601 The '-t' option can be given up to five times, to test up to
1602 five spans. For example the command:
1603 smartctl -t select,0-100 -t select,1000-2000 /dev/sda
1604 runs a self test on two spans. The first span consists of 101
1605 LBAs and the second span consists of 1001 LBAs. Note that the
1606 spans can overlap partially or completely, for example:
1607 smartctl -t select,0-10 -t select,5-15 -t select,10-20 /dev/sda
1608 The results of the selective self-test can be obtained (both
1609 during and after the test) by printing the SMART self-test log,
1610 using the '-l selftest' option to smartctl.
1611
1612 Selective self tests are particularly useful as disk capacities
1613 increase: an extended self test (smartctl -t long) can take sev‐
1614 eral hours. Selective self-tests are helpful if (based on SYS‐
1615 LOG error messages, previous failed self-tests, or SMART error
1616 log entries) you suspect that a disk is having problems at a
1617 particular range of Logical Block Addresses (LBAs).
1618
1619 Selective self-tests can be run during normal system operation
1620 (unless done in captive mode - see the '-C' option below).
1621
1622 The following variants of the selective self-test command use
1623 spans based on the ranges from past tests already stored on the
1624 disk:
1625
1626 select,redo[+SIZE] - [ATA only] redo the last SMART Selective
1627 Self Test using the same LBA range. The starting LBA is identi‐
1628 cal to the LBA used by last test, same for ending LBA unless a
1629 new span size is specified by optional +SIZE argument.
1630
1631 For example the commands:
1632 smartctl -t select,10-20 /dev/sda
1633 smartctl -t select,redo /dev/sda
1634 smartctl -t select,redo+20 /dev/sda
1635 have the same effect as:
1636 smartctl -t select,10-20 /dev/sda
1637 smartctl -t select,10-20 /dev/sda
1638 smartctl -t select,10-29 /dev/sda
1639
1640 select,next[+SIZE] - [ATA only] runs a SMART Selective Self Test
1641 on the LBA range which follows the range of the last test. The
1642 starting LBA is set to (ending LBA +1) of the last test. A new
1643 span size may be specified by the optional +SIZE argument.
1644
1645 For example the commands:
1646 smartctl -t select,0-999 /dev/sda
1647 smartctl -t select,next /dev/sda
1648 smartctl -t select,next+2000 /dev/sda
1649 have the same effect as:
1650 smartctl -t select,0-999 /dev/sda
1651 smartctl -t select,1000-1999 /dev/sda
1652 smartctl -t select,2000-3999 /dev/sda
1653
1654 If the last test ended at the last LBA of the disk, the new
1655 range starts at LBA 0. The span size of the last span of a disk
1656 is adjusted such that the total number of spans to check the
1657 full disk will not be changed by future uses of '-t
1658 select,next'.
1659
1660 select,cont[+SIZE] - [ATA only] performs a 'redo' (above) if the
1661 self test status reports that the last test was aborted by the
1662 host. Otherwise it run the 'next' (above) test.
1663
1664 afterselect,on - [ATA only] perform an offline read scan after a
1665 Selective self-test has completed. This option must be used
1666 together with one or more of the select,N-M options above. If
1667 the LBAs that have been specified in the Selective self-test
1668 pass the test with no errors found, then read scan the remainder
1669 of the disk. If the device is powered-cycled while this read
1670 scan is in progress, the read scan will be automatically resumed
1671 after a time specified by the pending timer (see below). The
1672 value of this option is preserved between selective self-tests.
1673
1674 afterselect,off - [ATA only] do not read scan the remainder of
1675 the disk after a Selective self-test has completed. This option
1676 must be use together with one or more of the select,N-M options
1677 above. The value of this option is preserved between selective
1678 self-tests.
1679
1680 pending,N - [ATA only] set the pending offline read scan timer
1681 to N minutes. Here N is an integer in the range from 0 to 65535
1682 inclusive. If the device is powered off during a read scan
1683 after a Selective self-test, then resume the test automatically
1684 N minutes after power-up. This option must be use together with
1685 one or more of the select,N-M options above. The value of this
1686 option is preserved between selective self-tests.
1687
1688 vendor,N - [ATA only] issues the ATA command SMART EXECUTE OFF-
1689 LINE IMMEDIATE with subcommand N in LBA LOW register. The sub‐
1690 command is specified as a hex value in the range 0x00 to 0xff.
1691 Subcommands 0x40–0x7e and 0x90–0xff are reserved for vendor spe‐
1692 cific use, see table 61 of T13/1699-D Revision 6a (ATA8-ACS).
1693 Note that the subcommands 0x00–0x04, 0x7f, 0x81–0x84 are sup‐
1694 ported by other smartctl options (e.g. 0x01: '-t short', 0x7f:
1695 '-X', 0x82: '-C -t long').
1696
1697 WARNING: Only run subcommands documented by the vendor of the
1698 device.
1699
1700 Example for some Intel SSDs only: The subcommand 0x40 ('-t ven‐
1701 dor,0x40') clears the timed workload related SMART attributes
1702 (226, 227, 228). Note that the raw values of these attributes
1703 are held at 65535 (0xffff) until the workload timer reaches 60
1704 minutes.
1705
1706 force - start new self-test even if another test is already run‐
1707 ning. By default a running self-test will not be interrupted to
1708 begin another test.
1709
1710 -C, --captive
1711 [ATA] Runs self-tests in captive mode. This has no effect with
1712 '-t offline' or if the '-t' option is not used.
1713
1714 WARNING: Tests run in captive mode may busy out the drive for
1715 the length of the test. Only run captive tests on drives with‐
1716 out any mounted partitions!
1717
1718 [SCSI] Runs the self-test in "Foreground" mode.
1719
1720 -X, --abort
1721 Aborts non-captive SMART Self Tests. Note that this command
1722 will abort the Offline Immediate Test routine only if your disk
1723 has the "Abort Offline collection upon new command" capability.
1724
1725
1727 In the past there has been a clear distinction between storage devices
1728 that used the ATA and SCSI command sets. This distinction was often
1729 reflected in their device naming and hardware. Now various SCSI trans‐
1730 ports (e.g. SAS, FC and iSCSI) can interconnect to both SCSI disks
1731 (e.g. FC and SAS) and ATA disks (especially SATA). USB and IEEE 1394
1732 storage devices use the SCSI command set externally but almost always
1733 contain ATA or SATA disks (or flash). The storage subsystems in some
1734 operating systems have started to remove the distinction between ATA
1735 and SCSI in their device naming policies.
1736
1737 99% of operations that an OS performs on a disk involve the SCSI
1738 INQUIRY, READ CAPACITY, READ and WRITE commands, or their ATA equiva‐
1739 lents. Since the SCSI commands are slightly more general than their
1740 ATA equivalents, many OSes are generating SCSI commands (mainly READ
1741 and WRITE) and letting a lower level translate them to their ATA equiv‐
1742 alents as the need arises. An important note here is that "lower
1743 level" may be in external equipment and hence outside the control of an
1744 OS.
1745
1746 SCSI to ATA Translation (SAT) is a standard (ANSI INCITS 431-2007) that
1747 specifies how this translation is done. For the other 1% of operations
1748 that an OS performs on a disk, SAT provides two options. First is an
1749 optional ATA PASS-THROUGH SCSI command (there are two variants). The
1750 second is a translation from the closest SCSI command. Most current
1751 interest is in the "pass-through" option.
1752
1753 The relevance to smartmontools (and hence smartctl) is that its inter‐
1754 actions with disks fall solidly into the "1%" category. So even if the
1755 OS can happily treat (and name) a disk as "SCSI", smartmontools needs
1756 to detect the native command set and act accordingly. As more storage
1757 manufacturers (including external SATA drives) comply with SAT, smart‐
1758 montools is able to automatically distinguish the native command set of
1759 the device. In some cases the '-d sat' option is needed on the command
1760 line.
1761
1762 There are also virtual disks which typically have no useful information
1763 to convey to smartmontools, but could conceivably in the future. An
1764 example of a virtual disk is the OS's view of a RAID 1 box. There are
1765 most likely two SATA disks inside a RAID 1 box. Addressing those SATA
1766 disks from a distant OS is a challenge for smartmontools. Another
1767 approach is running a tool like smartmontools inside the RAID 1 box
1768 (e.g. a Network Attached Storage (NAS) box) and fetching the logs via
1769 a browser.
1770
1771
1773 smartctl -a /dev/sda
1774 Print a large amount of SMART information for drive /dev/sda.
1775
1776 smartctl -s off /dev/sdd
1777 Disable SMART monitoring and data log collection on drive /dev/sdd.
1778
1779 smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda
1780 Enable SMART on drive /dev/sda, enable automatic offline testing every
1781 four hours, and enable autosaving of SMART Attributes. This is a good
1782 start-up line for your system's init files. You can issue this command
1783 on a running system.
1784
1785 smartctl -t long /dev/sdc
1786 Begin an extended self-test of drive /dev/sdc. You can issue this com‐
1787 mand on a running system. The results can be seen in the self-test log
1788 visible with the '-l selftest' option after it has completed.
1789
1790 smartctl -s on -t offline /dev/sda
1791 Enable SMART on the disk, and begin an immediate offline test of drive
1792 /dev/sda. You can issue this command on a running system. The results
1793 are only used to update the SMART Attributes, visible with the '-A'
1794 option. If any device errors occur, they are logged to the SMART error
1795 log, which can be seen with the '-l error' option.
1796
1797 smartctl -A -v 9,minutes /dev/sda
1798 Shows the vendor Attributes, when the disk stores its power-on time
1799 internally in minutes rather than hours.
1800
1801 smartctl -q errorsonly -H -l selftest /dev/sda
1802 Produces output only if the device returns failing SMART status, or if
1803 some of the logged self-tests ended with errors.
1804
1805 smartctl -q silent -a /dev/sda
1806 Examine all SMART data for device /dev/sda, but produce no printed out‐
1807 put. You must use the exit status (the $? shell variable) to learn if
1808 any Attributes are out of bound, if the SMART status is failing, if
1809 there are errors recorded in the self-test log, or if there are errors
1810 recorded in the disk error log.
1811
1812 smartctl -a -d 3ware,0 /dev/twl0
1813 Examine all SMART data for the first SATA (not SAS) disk connected to a
1814 3ware RAID 9750 controller card.
1815
1816 smartctl -t long -d areca,4 /dev/sg2
1817 Start a long self-test on the fourth SATA disk connected to an Areca
1818 RAID controller addressed by /dev/sg2.
1819
1820 smartctl -a -d hpt,1/3 /dev/sda (under Linux)
1821 smartctl -a -d hpt,1/3 /dev/hptrr (under FreeBSD)
1822 Examine all SMART data for the (S)ATA disk directly connected to the
1823 third channel of the first HighPoint RocketRAID controller card.
1824
1825 smartctl -t short -d hpt,1/1/2 /dev/sda (under Linux)
1826 smartctl -t short -d hpt,1/1/2 /dev/hptrr (under FreeBSD)
1827 Start a short self-test on the (S)ATA disk connected to second pmport
1828 on the first channel of the first HighPoint RocketRAID controller card.
1829
1830 smartctl -t select,10-100 -t select,30-300 -t afterselect,on -t pend‐
1831 ing,45 /dev/sda
1832 Run a selective self-test on LBAs 10 to 100 and 30 to 300. After the
1833 these LBAs have been tested, read-scan the remainder of the disk. If
1834 the disk is power-cycled during the read-scan, resume the scan 45 min‐
1835 utes after power to the device is restored.
1836
1837 smartctl -a -d cciss,0 /dev/cciss/c0d0
1838 Examine all SMART data for the first SCSI disk connected to a cciss
1839 RAID controller card.
1840
1841
1843 The exit statuses of smartctl are defined by a bitmask. If all is well
1844 with the disk, the exit status (return value) of smartctl is 0 (all
1845 bits turned off). If a problem occurs, or an error, potential error,
1846 or fault is detected, then a non-zero status is returned. In this
1847 case, the eight different bits in the exit status have the following
1848 meanings for ATA disks; some of these values may also be returned for
1849 SCSI disks.
1850
1851 Bit 0: Command line did not parse.
1852
1853 Bit 1: Device open failed, device did not return an IDENTIFY DEVICE
1854 structure, or device is in a low-power mode (see '-n' option
1855 above).
1856
1857 Bit 2: Some SMART or other ATA command to the disk failed, or there was
1858 a checksum error in a SMART data structure (see '-b' option
1859 above).
1860
1861 Bit 3: SMART status check returned "DISK FAILING".
1862
1863 Bit 4: We found prefail Attributes <= threshold.
1864
1865 Bit 5: SMART status check returned "DISK OK" but we found that some
1866 (usage or prefail) Attributes have been <= threshold at some
1867 time in the past.
1868
1869 Bit 6: The device error log contains records of errors.
1870
1871 Bit 7: The device self-test log contains records of errors. [ATA only]
1872 Failed self-tests outdated by a newer successful extended self-
1873 test are ignored.
1874
1875 To test within the shell for whether or not the different bits are
1876 turned on or off, you can use the following type of construction (which
1877 should work with any POSIX compatible shell):
1878 smartstat=$(($? & 8))
1879 This looks at only at bit 3 of the exit status $? (since 8=2^3). The
1880 shell variable $smartstat will be nonzero if SMART status check
1881 returned "disk failing" and zero otherwise.
1882
1883 This shell script prints all status bits:
1884 val=$?; mask=1
1885 for i in 0 1 2 3 4 5 6 7; do
1886 echo "Bit $i: $(((val & mask) && 1))"
1887 mask=$((mask << 1))
1888 done
1889
1890
1892 /usr/sbin/smartctl
1893 full path of this executable.
1894
1895 /usr/share/smartmontools/drivedb.h
1896 drive database (see '-B' option).
1897
1898 /etc/smartmontools/smart_drivedb.h
1899 optional local drive database (see '-B' option).
1900
1901
1903 Bruce Allen (project initiator),
1904 Christian Franke (project manager, Windows port and all sort of
1905 things),
1906 Douglas Gilbert (SCSI subsystem),
1907 Volker Kuhlmann (moderator of support and database mailing list),
1908 Gabriele Pohl (wiki & development team support),
1909 Alex Samorukov (FreeBSD port and more, new Trac wiki).
1910
1911 Many other individuals have made contributions and corrections, see
1912 AUTHORS, ChangeLog and repository files.
1913
1914 The first smartmontools code was derived from the smartsuite package,
1915 written by Michael Cornwell and Andre Hedrick.
1916
1917
1919 To submit a bug report, create a ticket in smartmontools wiki:
1920 <https://www.smartmontools.org/>.
1921 Alternatively send the info to the smartmontools support mailing list:
1922 <https://listi.jpberlin.de/mailman/listinfo/smartmontools-support>.
1923
1924
1926 smartd(8).
1927 update-smart-drivedb(8).
1928
1929
1931 Please see the following web site for more info: <https://www.smartmon‐
1932 tools.org/>
1933
1934 An introductory article about smartmontools is Monitoring Hard Disks
1935 with SMART, by Bruce Allen, Linux Journal, January 2004, pages 74–77.
1936 See <https://www.linuxjournal.com/article/6983>.
1937
1938 If you would like to understand better how SMART works, and what it
1939 does, a good place to start is with Sections 4.8 and 6.54 of the first
1940 volume of the 'AT Attachment with Packet Interface-7' (ATA/ATAPI-7)
1941 specification Revision 4b. This documents the SMART functionality
1942 which the smartmontools utilities provide access to.
1943
1944 The functioning of SMART was originally defined by the SFF-8035i revi‐
1945 sion 2 and the SFF-8055i revision 1.4 specifications. These are publi‐
1946 cations of the Small Form Factors (SFF) Committee.
1947
1948 Links to these and other documents may be found on the Links page of
1949 the smartmontools Wiki at <https://www.smartmontools.org/wiki/Links>.
1950
1951
1953 smartmontools-7.1 2019-12-30 r5022
1954 $Id: smartctl.8.in 5018 2019-12-29 13:37:25Z chrfranke $
1955
1956
1957
1958smartmontools-7.1 2019-12-30 SMARTCTL(8)