SMARTCTL(8)
๐ SMARTCTL(8) โ SMART Monitoring Tools ๐
okay bestie, welcome to the smartctl glow-up tour ๐ซถ this is the Linux edition, and we're about to make your disks tell you everything.
โจ NAME โจ
smartctl โ the Control and Monitor Utility for SMART Disks ๐
โจ SYNOPSIS โจ
smartctl [options] device
โจ DESCRIPTION โจ
heads up: this man page is generated for the Linux version of smartmontools. It does not contain info specific to other platforms. k thx.
So. smartctl controls the Self-Monitoring, Analysis and Reporting Technology (SMART) system that's built into basically most ATA/SATA and SCSI/SAS hard drives and solid-state drives. What's SMART for? It monitors the reliability of the hard drive and predicts drive failures, and it also runs different types of drive self-tests. Iconic behaviour, honestly. ๐
smartctl also supports some features that are not related to SMART, because it's versatile like that. This version of smartctl is compatible with ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards (see REFERENCES below, bestie, it's coming).
smartctl also provides support for SCSI tape drives and changers (see TAPE DRIVES below).
The user must specify the device to be controlled or interrogated as the final argument to smartctl. The command set used by the device is often derived from the device path, but sometimes it needs a lil help from the -d option (for more info see the section on "ATA, SCSI command sets and SAT" below). Device paths go like this:
- LINUX: Use the forms
/dev/sd[a-z]for ATA/SATA and SCSI/SAS devices. For SCSI Tape Drives and Changers use the devices/dev/nst*and/dev/sg*. For disks behind 3ware controllers you may need/dev/sd[a-z]or/dev/twe[0-9],/dev/twa[0-9]or/dev/twl[0-9]: see details below. For disks behind HighPoint RocketRAID controllers you may need/dev/sd[a-z]. For disks behind Areca SATA RAID controllers, you need/dev/sg[2-9](note that smartmontools interacts with the Areca controllers via a SCSI generic device which is different than the SCSI device used for reading and writing data)! For HP Smart Array RAID controllers, there are three currently supported drivers: cciss, hpsa, and hpahcisr. For disks accessed via the cciss driver the device nodes are of the form/dev/cciss/c[0-9]d0. For disks accessed via the hpahcisr and hpsa drivers, the device nodes you need are/dev/sg[0-9]*. (lsscsi -gis helpful in determining which scsi generic device node corresponds to which device.) Use the nodes corresponding to the RAID controllers, not the nodes corresponding to logical drives. See the-doption below, as well. Use the forms/dev/nvme[0-9](broadcast namespace) or/dev/nvme[0-9]n[1-9](specific namespace 1-9) for NVMe devices. ๐ฆ
If '-' is specified as the device path, smartctl reads and interprets it's own debug output from standard input. See '-r ataioctl' below for details. (yes, it reads its own debug output. main character energy tbh.)
smartctl guesses the device type if possible. If necessary, the '-d' option can be used to override this guess. ๐
ngl, note this: the printed output ofsmartctldisplays most numerical values in base 10 (decimal), but some values are displayed in base 16 (hexadecimal). To distinguish them, the base 16 values are always displayed with a leading"0x", for example:"0xff". This man page follows the same convention. โจ
โจ OPTIONS โจ
The options are grouped below into several categories. smartctl will execute the corresponding commands in the order: INFORMATION, ENABLE/DISABLE, DISPLAY DATA, RUN/ABORT TESTS.
๐ธ SHOW INFORMATION OPTIONS ๐ธ
-h,--help,--usageโ Prints a usage message to STDOUT and exits. bye bestie, but helpfully ๐-V,--version,--copyright,--licenseโ Prints version, copyright, license, home page and SVN revision information for your copy ofsmartctlto STDOUT and then exits. it's giving receipts ๐งพ-i,--infoโ Prints the device model number, serial number, firmware version, and ATA Standard version/revision information. Says if the device supports SMART, and if so, whether SMART support is currently enabled or disabled. If the device supports Logical Block Address mode (LBA mode) print current user drive capacity in bytes. (If drive has a user protected area reserved, or is "clipped", this may be smaller than the potential maximum drive capacity.) Indicates if the drive is in the smartmontools database (see'-v'options below). If so, the drive model family may also be printed. If'-n'(see below) is specified, the power mode of the drive is printed. ๐ซ
[NVMe] For NVMe devices the information is obtained from the Identify Controller and the Identify Namespace data structure.
--identify[=[w][nvb]]โ [ATA only] Prints an annotated table of the IDENTIFY DEVICE data. By default, only valid words (words not equal to0x0000or0xffff) and nonzero bits and bit fields are printed. This can be changed by the optional argument which consists of one or two characters from the set'wnvb'. The character'w'enables printing of all 256 words. The character'n'suppresses printing of bits,'v'enables printing of all bits from valid words,'b'enables printing of all bits. For example'--identify=n'(valid words, no bits) produces the shortest output and'--identify=wb'(all words, all bits) produces the longest output. choose your fighter ๐-a,--allโ Prints all SMART information about the device.
For ATA, this is equivalent to '-H -i -c -A -l error -l selftest -l selective'. This option is no longer recommended for ATA disks because it does not enable the SMART options which require support for 48-bit ATA commands (see '-x' below). ๐
For SCSI, this is equivalent to '-H -i -A -l error -l selftest'.
For NVMe, this is equivalent to '-H -i -c -A -l error -l selftest'.
-x,--xallโ Prints all SMART and non-SMART information about the device. the overachiever option ๐
For ATA, this is equivalent to '-H -i -g all -c -A -f brief -l xerror,error -l xselftest,selftest -l selective -l directory -l scttemp -l scterc -l devstat -l defects -l sataphy'. If '-a' is also specified, add '-l error -l selftest'. [NEW EXPERIMENTAL SMARTCTL 7.5 FIX] '-g wcreorder' is no longer included because it is not possible to check whether this feature is supported by the drive.
For SCSI disks, this is equivalent to '-H -i -g all -A -l error -l selftest -l background -l sasphy -l defects -l envrep -l genstats -l ssd -l zdevstat' and for SCSI tape drives and changers, add '-l tapedevstat'.
For NVMe, this is equivalent to '-H -i -c -A -l error -l selftest'.
--scanโ Scans for devices and prints each device name, device type and protocol ([ATA]or[SCSI]) info. May be used in conjunction with'-d TYPE'to restrict the scan to a specific TYPE. See also info about platform specific device scan and the DEVICESCAN directive onsmartd(8)man page. ๐ต๏ธโ๏ธ--scan-openโ Same as--scan, but also tries to open each device before printing device info. The device open may change the device type due to autodetection (see also'-d test').
This option can be used to create a draft smartd.conf file. All options after '--' are appended to each output line. For example:
smartctl --scan-open -- -a -W 4,45,50 -m admin@work > smartd.conf
Multiple '-d TYPE' options may be specified with '--scan[-open]' to combine the scan results of more than one TYPE. ๐ฅ
-g NAME,--get=NAMEโ Get non-SMART device settings. See'-s, --set'below for further info.
๐ RUN-TIME BEHAVIOR OPTIONS ๐
-j,--json[=cgiosuvy]โ Enables JSON or YAML output mode. the data girlies ate with this one โจ
The output could be modified or enhanced by the optional argument which consists of one or more characters from the set 'cgiosuvy':
'c': Outputs compact format without extra spaces and newlines. By default, output is pretty-printed. If used with YAML format, the indentation of arrays is reduced.'g': Outputs JSON structure as single assignments to allow the usage ofgrep. Each assignment reflects the absolute path of a value. The syntax is compatible with gron:'json.KEY1[INDEX2].KEY3 = VALUE;'.'o': Includes the full original plaintext output ofsmartctlas a JSON array'smartctl.output[]'.'s': Outputs JSON object elements sorted by key. By default, object elements are ordered as generated internally.'v': Enables verbose output of possible unsafe integers. If specified, values which may exceed JSON safe integer (53-bit) range are always output as a number (with some'KEY') and a string ('KEY_s'), regardless of the actual value. Values which may exceed 64-bit range are also output as a little endian byte array ('KEY_le'). By default, the additional elements are only output if the value actually exceeds the range.'y': Outputs in YAML format.
The following two arguments are primarily intended for development:
'i': Includes lines from the plaintext output which print info already implemented for JSON output. The lines appear as strings with key'smartctl_NNNN_i'.'u': Includes lines from the plaintext output which print info still unimplemented for JSON output. The lines appear as strings with key'smartctl_NNNN_u'.
-q TYPE,--quietmode=TYPEโ Specifies thatsmartctlshould run in one of the quiet modes described here. The valid arguments to this option are:errorsonlyโ only print: For the'-l error'option, if nonzero, the number of errors recorded in the SMART error log and the power-on time when they occurred; For the'-l selftest'option, errors recorded in the device self-test log; For the'-H'option, SMART "disk failing" status or device Attributes (pre-failure or usage) which failed either now or in the past; For the'-A'option, device Attributes (pre-failure or usage) which failed either now or in the past.silentโ print no output. The only way to learn about what was found is to use the exit status ofsmartctl(see EXIT STATUS below). ๐คซ
okay that's part 1 bestie, and there's so much more coming ๐ don't go anywhere ๐
Do not print the serial number of the device. This also suppresses the LU WWN Device Id (ATA) and the SAS addresses (SCSI). The related fields are also invalidated in the ATA and NVMe debug outputs.
Note: This is not the case in SCSI debug output. ๐
[NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE] The Namespace IEEE EUI-64 (NVMe) is also suppressed. โจ
[NEW EXPERIMENTAL SMARTCTL 7.5 FEATURE] The Serial Number and World Wide Name from the FARM log (see -l farm below) are also suppressed, except for the debug output. ๐ซถ
-d TYPE,--device=TYPEโ tells smartctl exactly what kind of device it's looking at, bestie. No guessing games. The valid arguments to this option are:autoโ try to guess the device type from the device name, or from controller type info the OS hands over, or from a matching USB ID entry in the drive database. This is the default, and honestly? It's giving main character energy. ๐testโ prints the guessed TYPE, then opens the device and prints the (possibly changed) TYPE name, then exits without doing anything else. Literally just a vibe check on the device type, no cap. ๐งataโ the device type is ATA. This stops smartctl from throwing SCSI commands at an ATA device. periodt. ๐scsiโ the device type is SCSI. This stops smartctl from throwing ATA commands at a SCSI device. slay. ๐ธnvme[,NSID]โ the device type is NVM Express (NVMe). The optional parameter NSID specifies the namespace id (in hex) passed to the driver. Use0xfffffffffor the broadcast namespace id. The default for NSID is the namespace id addressed by the device name. โจsat[,auto][,N]โ the device type is SCSI to ATA Translation (SAT). This one's for ATA disks that have a SCSI to ATA Translation Layer (SATL) sitting between the disk and the OS. SAT defines two ATA PASS THROUGH SCSI commands โ one 12 bytes long and the other 16 bytes long. The default is the 16 byte variant, and you can override that with either-d sat,12or-d sat,16. ๐
If -d sat,auto is specified, device type SAT (for ATA/SATA disks) is only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA "). Otherwise device type SCSI (for SCSI/SAS disks) is used. iykyk. ๐ฅ
usbasm1352r,PORTโ [NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE] this device type is for one or two SATA disks that are behind an ASMedia ASM1352R USB to SATA (RAID) bridge. The parameter PORT (0or1) selects the disk to monitor.
Note: This USB bridge also supports -d sat. That monitors either the first disk, or the second disk if no disk is connected to the first port. ๐
usbcypressโ this device type is for ATA disks that are behind a Cypress USB to PATA bridge. This will use the ATACB proprietary scsi pass through command. The default SCSI operation code is0x24, but although it can be overridden with-d usbcypress,0xN, where N is the scsi operation code, you're running the risk of damage to the device or filesystems on it. โ ๏ธ bestie pls be careful.usbjmicron[,p][,x][,PORT]โ this device type is for SATA disks that are behind a JMicron USB to PATA/SATA bridge. The 48-bit ATA commands (required e.g. for-l xerror, see below) do not work with all of these bridges and are therefore disabled by default. These commands can be enabled by-d usbjmicron,x. If two disks are connected to a bridge with two ports, an error message is printed if no PORT (0or1) is specified.
The PORT parameter is not necessary if the device uses a port multiplier to connect multiple disks to one port. The disks appear under separate /dev/ice names then.
CAUTION: Specifying ,x for a device which does not support it results in I/O errors and may disconnect the drive. The same applies if the specified PORT does not exist or is not connected to a disk. ๐
The Prolific PL2507/3507 USB bridges with older firmware support a pass-through command similar to JMicron and work with -d usbjmicron,0. Newer Prolific firmware requires a modified command which can be selected by -d usbjmicron,p. Note that this does not yet support the SMART status command. ๐ญ
usbprolificโ this device type is for SATA disks that are behind a Prolific PL2571/2771/2773/2775 USB to SATA bridge. โจusbsunplusโ this device type is for SATA disks that are behind a SunplusIT USB to SATA bridge. ๐ฆsntasmedia[/sat]โ this device type is for NVMe disks that are behind an ASMedia USB to NVMe bridge.
[NEW EXPERIMENTAL SMARTCTL 7.5 FEATURE] If the /sat suffix is specified and the NVMe Identify Controller command fails, the device type is changed to -d sat. This is useful for USB M.2 adapters which support NVMe and SATA devices. ๐
sntjmicron[,NSID][/sat]โ this device type is for NVMe disks that are behind a JMicron USB to NVMe bridge. The optional parameter NSID specifies the namespace id (in hex) passed to the driver. The default namespace id is the broadcast namespace id (0xffffffff). See also-d sntasmediafor the/satsuffix. ๐sntrealtek[/sat]โ this device type is for NVMe disks that are behind a Realtek USB to NVMe bridge. See also-d sntasmediafor the/satsuffix. โญmarvellโ [Linux only] (deprecated and subject to remove). ๐ชฆ it's giving legacy.megaraid,Nโ [FreeBSD and Linux only] the device consists of one or more SCSI/SAS disks connected to a MegaRAID controller. The non-negative integer N (in the range of0to127inclusive) denotes which disk on the controller is monitored. This interface will also work for Dell PERC controllers. Use syntax such as:
smartctl -a -d megaraid,2 /dev/sda
smartctl -a -d megaraid,0 /dev/sdb
smartctl -a -d megaraid,0 /dev/bus/0
It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus number.
The following entry in /proc/devices must exist: For PERC2/3/4 controllers: megadevN For PERC5/6 controllers: megaraid_sas_ioctlN
aacraid,H,L,IDโ [Linux, Windows and Cygwin only] the device consists of one or more SCSI/SAS or SATA disks connected to an AacRaid controller. The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk on the controller is monitored. Use syntax such as:
smartctl -a -d aacraid,0,0,2 /dev/sda
smartctl -a -d aacraid,1,0,4 /dev/sdb
Option -d sat,auto+... is implicitly enabled to detect SATA disks. Use -d scsi+aacraid,H,L,ID to disable it.
On Linux, the following entry in /proc/devices must exist: aac. Character device nodes /dev/aacH (H=Host number) are created if required. ๐ฅ
3ware,Nโ [FreeBSD and Linux only] the device consists of one or more ATA disks connected to a 3ware RAID controller. The non-negative integer N (in the range from0to127inclusive) denotes which disk on the controller is monitored. Use syntax such as:
smartctl -a -d 3ware,2 /dev/sda [Linux only]
smartctl -a -d 3ware,0 /dev/twe0
smartctl -a -d 3ware,1 /dev/twa0
smartctl -a -d 3ware,1 /dev/twl0 [Linux only]
smartctl -a -d 3ware,1 /dev/tws0 [FreeBSD only]
The first two forms, which refer to devices /dev/sda-z (deprecated) and /dev/twe0-15, may be used with 3ware series 6000, 7000, and 8000 series controllers that use the 3x-xxxx driver. The devices /dev/twa0-15 must be used with 3ware 9000 series controllers, which use the 3w-9xxx driver. The devices /dev/twl0-15 [Linux] or /dev/tws0-15 [FreeBSD] must be used with the 3ware/LSI 9750 series controllers which use the 3w-sas driver. ๐ซถ
Note that if the special character device nodes /dev/tw[ls]?, /dev/twa? and /dev/twe? do not exist, or exist with the incorrect major or minor numbers, smartctl will recreate them on the fly. iconic behaviour honestly. โจ
areca,Nโ [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or more SATA disks connected to an Areca SATA RAID controller. The positive integer N (in the range from1to24inclusive) denotes which disk on the controller is monitored. On Linux use syntax such as:
smartctl -a -d areca,2 /dev/sg2
smartctl -a -d areca,3 /dev/sg3
The first line above addresses the second disk on the first Areca RAID controller. The second line addresses the third disk on the second Areca RAID controller. To help identify the correct device on Linux, use the command:
cat /proc/scsi/sg/device_hdr /proc/scsi/sg/devices
to show the SCSI generic devices (one per line, starting with /dev/sg0). The correct SCSI generic devices to address for smartmontools are the ones with the type field equal to 3. If the incorrect device is addressed, please read the warning/error messages carefully. They should provide hints about what devices to use. ๐
Important: the Areca controller must have firmware version 1.46 or later. Lower-numbered firmware versions will give (harmless) SCSI error messages and no SMART information. ๐ญ
areca,N/Eโ [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or more SATA or SAS disks connected to an Areca SAS RAID controller. The integer N (range1to128) denotes the channel (slot) and E (range1to8) denotes the enclosure.
Important: This requires Areca SAS controller firmware version 1.51 or later. ๐
cciss,Nโ [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or SATA disks connected to a cciss RAID controller. The non-negative integer N (in the range from0to127inclusive) denotes which disk on the controller is monitored.
Option -d sat,auto+... is implicitly enabled to detect SATA disks. Use -d scsi+cciss,N to disable it.
To look at disks behind HP Smart Array controllers, use syntax such as:
smartctl -a -d cciss,0 /dev/cciss/c0d0 (cciss driver under Linux)
smartctl -a -d cciss,0 /dev/sg2 (hpsa or hpahcisr drivers under Linux)
hpt,L/M/Nโ [FreeBSD and Linux only] this device is likeโฆ a whole squad of ATA disks all connected to one HighPoint RocketRAID controller. ๐ซ The integerLis the controller id,Mis the channel number, andNis the PMPort number (if it's available). Allowed values:Lgoes from1to4inclusive,Mfrom1to128inclusive, andNfrom1to4if PMPort is available. Oh and also โ these ranges get limited by whatever model of HighPoint RocketRAID controller you've got, bestie. Use syntax like:
smartctl -a -d hpt,1/3 /dev/sda (under Linux)
smartctl -a -d hpt,1/2/3 /dev/sda (under Linux)
Heads up: the /dev/sda-z form should be the device node that stands for the disks derived from the HighPoint RocketRAID controllers under Linux, and under FreeBSD it's the character device which the driver registered (eg, /dev/hptrr, /dev/hptmv6). ๐ฆ
sssraid,E,Sโ [Linux only: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE] the device consists of one or more SCSI/SAS or SATA disks connected to a SSSRAID controller. The non-negative integerE(in the range of0to8) denotes the enclosure, andS(range0to128) denotes the slot. Use syntax like:
smartctl -a -d sssraid,0,1 /dev/bsg/sssraid0
It's possible to set RAID device name as /dev/bsg/sssraidN, where N is a SCSI bus number. ๐
intelliprop,N[+TYPE]โ (deprecated and subject to remove). ๐jmb39x[-q[2]],N[,sLBA][,force][+TYPE]โ the device consists of multiple SATA disks connected to a JMicron JMB39x RAID port multiplier. The suffix-qselects a slightly different command variant used by QNAP TR-004 NAS devices. The integerNis the port number from0to4.
[NEW EXPERIMENTAL SMARTCTL 7.5 FEATURE] The suffix -q2 selects another command variant used by QNAP TR-002 NAS devices.
WARNING: The ATA pass-through commands are issued via READ/WRITE commands to a LBA of the RAID volume. Using this option with other devices may overwrite this sector. ๐ญ
The default LBA is 33. The LBA could be selected in the range from 1 to 255 inclusive.
If a GPT partition table is used, LBA 33 contains the last 4 (of 128) entries of the partition table. These entries are zero filled in most cases. If a MBR partition table is used, LBA 33 may be zero filled or may contain code from a boot loader.
By default, access to the device is refused if the selected sector is not zero filled. The force flag disables this check.
WARNING: Original sector data is not written back if smartctl is aborted with a signal. ๐ซถ
jms56x,N[,sLBA][,force][+TYPE]โ the device consists of multiple SATA disks connected to a JMicron JMS56x USB to SATA RAID bridge. Seejmb39x...above for valid arguments. โจ
โจ -T TYPE, --tolerance=TYPE โจ
[ATA only] Specifies how tolerant smartctl should be of ATA and SMART command failures.
The behavior of smartctl depends upon whether the command is "optional" or "mandatory". Here "mandatory" means "required by the ATA Specification if the device implements the SMART command set" and "optional" means "not required by the ATA Specification even if the device implements the SMART command set." The "mandatory" ATA and SMART commands are:
- ATA IDENTIFY DEVICE
- SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE
- SMART ENABLE/DISABLE
- SMART RETURN STATUS
The valid arguments to this option are:
normalโ exit on failure of any mandatory SMART command, and ignore all failures of optional SMART commands. This is the default. Ngl, on some devices, issuing unimplemented optional SMART commands doesn't cause an error. This can result in misleading smartctl messages like "Feature X not implemented", followed shortly by "Feature X: enabled". In most such cases, contrary to the final message, Feature X is not enabled. ๐conservativeโ exit on failure of any optional SMART command.permissiveโ ignore failure(s) of mandatory SMART commands. This option may be given more than once. Each additional use of this option will cause one more additional failure to be ignored. Note that the use of this option can lead to messages like "Feature X not supported", followed shortly by "Feature X enable failed". In a few such cases, contrary to the final message, Feature X is enabled. ๐verypermissiveโ equivalent to giving a large number of-T permissiveoptions: ignore failures of any number of mandatory SMART commands. Please see the note above. โจ
โจ -b TYPE, --badsum=TYPE โจ
[ATA only] Specifies the action smartctl should take if a checksum error is detected in the:
- Device Identity Structure
- SMART Self-Test Log Structure
- SMART Attribute Value Structure
- SMART Attribute Threshold Structure
- ATA Error Log Structure
The valid arguments to this option are:
warnโ report the incorrect checksum but carry on in spite of it. This is the default. ๐ธexitโ exit smartctl. ๐ญignoreโ continue silently without issuing a warning. ๐คซ
โจ -r TYPE, --report=TYPE โจ
Intended primarily to help smartmontools developers understand the behavior of smartmontools on non-conforming or poorly conforming hardware. This option reports details of smartctl transactions with the device. The option can be used multiple times. When used just once, it shows a record of the ioctl() transactions with the device. When used more than once, the detail of these ioctl() transactions are reported in greater detail. The valid arguments to this option are:
ioctlโ report allioctl()transactions. ๐ataioctlโ report onlyioctl()transactions with ATA devices.scsiioctlโ report onlyioctl()transactions with SCSI devices. Invoking this once shows the SCSI commands in hex and the corresponding status. Invoking it a second time adds a hex listing of the first 64 bytes of data send to, or received from the device. ๐ฅnvmeioctlโ report onlyioctl()transactions with NVMe devices.
Any argument may include a positive integer to specify the level of detail that should be reported. The argument should be followed by a comma then the integer with no spaces. For example, ataioctl,2 The default level is 1, so -r ataioctl,1 and -r ataioctl are equivalent.
For testing purposes, the output of -r ataioctl,2 can later be parsed by smartctl itself if - is used as device path argument. The ATA command input parameters, sector data and return values are reconstructed from the debug report read from stdin. Then smartctl internally simulates an ATA device with the same behaviour. This is does not work for SCSI devices yet. โญ
โจ -n POWERMODE[,STATUS[,STATUS2]], --nocheck=POWERMODE[,STATUS[,STATUS2]] โจ
[ATA, SCSI] Specifies if smartctl should exit before performing any checks when the device is in a low-power mode. It may be used to prevent a disk from being spun-up by smartctl. The power mode is ignored by default.
Note: If this option is used it may also be necessary to specify the device type with the -d option. Otherwise the device may spin up due to commands issued during device type autodetection. ๐
By default, exit status 2 is returned if the device is in one of the specified low-power modes. This status is also returned if the device open or identification failed (see EXIT STATUS below). The optional STATUS parameter allows one to override this default. STATUS is an integer in the range from 0 to 255 inclusive. For example use -n standby,0 to return success if a device is in SLEEP or STANDBY mode. Use -n standby,3 to return a unique exit status in this case. ๐
The valid arguments to this option are:
neverโ check the device always, but print the power mode if-iis specified.sleep[,STATUS[,STATUS2]]โ check the device unless it is in SLEEP mode.standby[,STATUS[,STATUS2]]โ check the device unless it is in SLEEP or STANDBY mode. In these modes most disks are not spinning, so if you want to prevent a disk from spinning up, this is probably what you want. ๐idle[,STATUS[,STATUS2]]โ check the device unless it is in SLEEP, STANDBY or IDLE mode. In the IDLE state, most disks are still spinning, so this is probably not what you want. ๐
The -n option is ignored if the power mode check is not supported or returns an unknown value.
[ATA only] If the optional STATUS2 parameter is specified, smartctl exits immediately with STATUS2 in this case. For example use -n standby,3,5 to return unique exit statuses in the STANDBY and UNSUPPORTED cases. โจ
๐ SMART FEATURE ENABLE/DISABLE COMMANDS: ๐
Note: if multiple options are used to both enable and disable a feature, then both the enable and disable commands will be issued. The enable command will always be issued before the corresponding disable command. ๐
โจ -s VALUE, --smart=VALUE โจ
Enables or disables SMART on device. The valid arguments to this option are on and off.
[ATA] Note that the ATA commands SMART ENABLE/DISABLE OPERATIONS were declared obsolete in ATA ACS-4 Revision 10 (Nov 2015). ๐
[SCSI tape drive or changer] It is not necessary (or useful) to enable SMART to see the TapeAlert messages. ๐ฆ
โจ -o VALUE, --offlineauto=VALUE โจ
[ATA only] Enables or disables SMART automatic offline test, which scans the drive every four hours for disk defects. This command can be given during normal system operation. The valid arguments to this option are on and off. โจ
ok so important lore drop: the SMART automatic offline test command is listed as "Obsolete" in every version of the ATA and ATA/ATAPI Specifications ๐. It was originally part of the SFF-8035i Revision 2.0 specification, but it was never part of any ATA specification. That said, vendors implemented it anyway and use it a lot. The way you can tell if automatic offline testing is supported is by seeing whether this command enables and disables it โ that shows up in the 'Auto Offline Data Collection' part of the SMART capabilities report (the one you get with -c). ๐ซถ
SMART gives you three basic categories of testing, bestie. Sit with me for a sec:
The first category is called "online" testing, and it literally has no effect on the performance of the device. It gets turned on with the -s on option. Slay. โจ
The second category is "offline" testing. This one can, in principle, degrade the device performance ๐ญ. The -o on option makes this offline testing happen automatically on a regular scheduled basis. Normally though, the disk suspends offline testing while disk accesses are going on, then auto-resumes it when the disk would otherwise just be sitting there idle โ so in practice it barely does anything. Also, a one-time offline test can be carried out immediately upon receipt of a user command. See the -t offline option below, which does exactly that: one-time offline test, right now, immediately. ๐
The choice of the word testing for these first two categories (made by the SFF-8035i and ATA specification authors, not me) is genuinely unfortunate and leads to so much confusion. Real talk, those first two categories โ online and offline testing โ could have been more accurately described as online and offline data collection. ๐ธ
The results of this automatic or immediate offline testing (data collection) are reflected in the values of the SMART Attributes. So if problems or errors get detected, those Attribute values will drop below their failure thresholds; some types of errors may also show up in the SMART error log. You can see those with the -A and -l error options respectively. ๐
Some SMART attribute values only get updated during off-line data collection activities; the rest get updated during normal operation of the device, or during both normal operation and off-line testing. The Attribute value table produced by the -A option tells you which is which in the UPDATED column. Attributes of the first type are labeled "Offline" and attributes of the second type are labeled "Always".
The third category of testing โ and the only category where the word 'testing' is really an appropriate choice โ is "self" testing. This third type of test is only performed (immediately) when a command to run it is issued. The -t and -X options can be used to carry out and abort such self-tests; more on that below, keep reading. ๐ฆ
Any errors detected in the self testing will show up in the SMART self-test log, which you can examine using the -l selftest option.
Note: in this manual page, the word "Test" is used in connection with that second category we just described, e.g. for the "offline" testing. The words "Self-test" are used in connection with the third category. iykyk ๐
-S VALUE,--saveauto=VALUEโ [ATA] Enables or disables SMART autosave of device vendor-specific Attributes. The valid arguments to this option areonandoff. Heads up: this feature is preserved across disk power cycles, so you should only need to issue it once. ๐
The ATA standard does not specify a method to check whether SMART autosave is enabled. Unlike SCSI (below), smartctl is unable to print a warning if autosave is disabled. ๐
Note that the ATA commandsSMART ENABLE/DISABLE AUTOSAVEwere declared obsolete inATA ACS-4 Revision 10(Nov 2015). ๐
[SCSI] For SCSI devices this toggles the value of the Global Logging Target Save Disabled (GLTSD) bit in the Control Mode Page. Some disk manufacturers set this bit by default. This prevents error counters, power-up hours and other useful data from being placed in non-volatile storage, so these values may be reset to zero the next time the device is power-cycled ๐ญ. If the GLTSD bit is set then smartctl -a will issue a warning. Use on to clear the GLTSD bit and thus enable saving counters to non-volatile storage. For extreme streaming-video type applications you might consider using off to set the GLTSD bit. ๐
-g NAME,--get=NAME,-s NAME[,VALUE],--set=NAME[,VALUE]โ Gets/sets non-SMART device settings. Note that the--setoption shares its short option-swith--smart. The valid arguments are, and I'm listing them all because you deserve the full tea: ๐ซallโ Gets all values. This is equivalent to
-g aam -g apm -g lookahead -g security -g wcache -g rcache -g dsn
aam[,N|off]โ [ATA only] Gets/sets the Automatic Acoustic Management (AAM) feature (if supported). A value of128sets the most quiet (slowest) mode and254the fastest (loudest) mode,offdisables AAM. Devices may support intermediate levels. Values below128are defined as vendor specific (0) or retired (1to127). Note that the AAM feature was declared obsolete inATA ACS-2 Revision 4a(Dec 2010). ๐apm[,N|off]โ [ATA only] Gets/sets the Advanced Power Management (APM) feature on device (if supported). If a value between1and254is provided, it will attempt to enable APM and set the specified value,offdisables APM. Note the actual behavior depends on the drive โ for example some drives disable APM if their value is set above128. Values below128are supposed to allow drive spindown, values128and above adjust only head-parking frequency, although the actual behavior defined is also vendor-specific. ๐lookahead[,on|off]โ [ATA only] Gets/sets the read look-ahead feature (if supported). Read look-ahead is usually enabled by default.securityโ [ATA only] Gets the status of ATA Security feature (if supported). If ATA Security is enabled an ATA user password is set. The drive will be locked on next reset then. ๐security-freezeโ [ATA only] Sets ATA Security feature to frozen mode. This prevents the drive from accepting any security commands until next reset. Note that the frozen mode may already be set by BIOS or OS.standby,[N|off]โ [ATA] Sets the standby (spindown) timer and places the drive in the IDLE mode. A value of0oroffdisables the standby timer. Values from1to240specify timeouts from 5 seconds to 20 minutes in 5 second increments. Values from241to251specify timeouts from 30 minutes to 330 minutes in 30 minute increments. Value252specifies 21 minutes. Value253specifies a vendor specific time between 8 and 12 hours. Value255specifies 21 minutes and 15 seconds. Some drives may use a vendor specific interpretation for the values. Note that there is no get option because ATA standards do not specify a method to read the standby timer. If-s standby,nowis also specified, the drive is immediately placed in the STANDBY mode without temporarily placing it in the IDLE mode. Note that ATA standards do not specify a command to set the standby timer without affecting the power mode. ๐ฎโ๐จ [SCSI] Only the set option withstandby,offorstandby,0is accepted and will place the SCSI disk into"ACTIVE"power condition.standby,nowโ [ATA] Places the drive in the STANDBY mode. This usually spins down the drive. The setting of the standby timer is not affected unless-s standby,[N|off]is also specified. [SCSI] Only the set option is accepted and will place the SCSI disk into"STANDBY_Z"power condition.wcache[,on|off]โ [ATA] Gets/sets the volatile write cache feature (if supported). The write cache is usually enabled by default.wcache[,on|off]โ [SCSI] Gets/sets the'Write Cache Enable'(WCE) bit (if supported). The write cache is usually enabled by default.wcache-sct[,ata|on|off[,p]]โ [ATA only] Gets/sets the write cache feature through SCT Feature Control (if supported). The state of write cache in SCT Feature Control could be"Controlled by ATA","Force Enabled", or"Force Disabled". SCT Feature control overwrites the setting by ATA Set Features command (wcache[,on|off]option). If SCT Feature Control sets write cache as"Force Enabled"or"Force Disabled", the setting ofwcache[,on|off]is ignored by the drive. SCT Feature Control usually sets write cache as"Controlled by ATA"by default. If,pis specified, the setting is preserved across power cycles. ๐ฅwcreorder[,on|off[,p]]โ [ATA only] Gets/sets Write Cache Reordering. If it is disabled (off), disk write scheduling is executed on a first-in-first-out (FIFO) basis. If Write Cache Reordering is enabled (on), then disk write scheduling may be reordered by the drive. If write cache is disabled, the current Write Cache Reordering state is remembered but has no effect on non-cached writes, which are always written in the order received. The state of Write Cache Reordering has no effect on either NCQ or LCQ queued commands. If,pis specified, the setting is preserved across power cycles.rcache[,on|off]โ [SCSI only] Gets/sets the'Read Cache Disable'(RCE) bit.'Off'value disables read cache (if supported). The read cache is usually enabled by default.dsn[,on|off]โ [ATA only] Gets/sets the DSN feature (if supported). The dsn is usually disabled by default.
โจ SMART READ AND DISPLAY DATA OPTIONS โจ
-H,--healthโ Prints the health status of the device. ๐
If the device reports failing health status, that means either the device has already failed, or it's predicting its own failure within the next 24 hours ๐ญ. If that happens, use the -x option to get more information, and get your data off the disk and to someplace safe as soon as you can. Like, immediately. fr fr. ๐โโ๏ธ๐จ
[ATA] Health status comes from checking the (boolean) result that the SMART RETURN STATUS command hands back. But lowkey, that return value can be โจmysteriousโจ because of limitations or bugs in some layer sitting between your disk and your OS (think RAID controller or USB bridge firmware ๐). When that happens, smartctl prints a warning and then checks whether any Prefailure SMART Attribute value is less than or equal to its threshold (peep the '-A' below ๐).
[SCSI] Health status comes from checking the Additional Sense Code (ASC) and Additional Sense Code Qualifier (ASCQ) from the Informal Exceptions (IE) log page โ if it's supported โ and/or from SCSI sense data.
[SCSI tape drive or changer] The TapeAlert status comes from reading the TapeAlert log page, but only if you give this option twice (the TAPE DRIVES section explains why, iykyk).
[NVMe] NVMe status comes from reading the "Critical Warning" byte out of the SMART/Health Information log.
-c,--capabilitiesโ [ATA] Prints only the generic SMART capabilities. These show what SMART features are implemented and how your device will respond to some of the different SMART commands. Like, it shows if the device logs errors, if it supports offline surface scanning, and so on bestie. If the device can run self-tests, this option also shows the estimated time required to run those tests โฑ๏ธ.
[NVMe] Prints various NVMe device capabilities obtained from the Identify Controller and the Identify Namespace data structure.
-A,--attributesโ [ATA] Prints only the vendor specific SMART Attributes. The Attributes are numbered from 1 to 253 and have specific names and ID numbers. For example Attribute 12 is"power cycle count": how many times has the disk been powered up ๐ .
Each Attribute has a "Raw" value, printed under the heading "RAW_VALUE", and a "Normalized" value printed under the heading "VALUE". [Note: smartctl prints these values in base-10.] In the example just given, the "Raw Value" for Attribute 12 would be the actual number of times that the disk has been power-cycled โ for example 365 if the disk has been turned on once per day for exactly one year ๐. Each vendor uses their own algorithm to convert this "Raw" value to a "Normalized" value in the range from 1 to 254. Please keep in mind that smartctl only reports the different Attribute types, values, and thresholds as read from the device. It does not carry out the conversion between "Raw" and "Normalized" values: that's the disk's firmware doing its thing, not us ๐
โโ๏ธ.
The conversion from Raw value to a quantity with physical units is not specified by the SMART standard. In most cases, the values printed by smartctl are sensible. For example the temperature Attribute generally has its raw value equal to the temperature in Celsius ๐ก๏ธ. However in some cases vendors use unusual conventions. For example the Hitachi disk on my laptop reports its power-on hours in minutes, not hours ๐ญ. Some IBM disks track three temperatures rather than one, in their raw values. And so on.
Each Attribute also has a Threshold value (whose range is 0 to 255) which is printed under the heading "THRESH". If the Normalized value is less than or equal to the Threshold value, then the Attribute is said to have failed. If the Attribute is a pre-failure Attribute, then disk failure is imminent ๐.
Each Attribute also has a "Worst" value shown under the heading "WORST". This is the smallest (closest to failure) value that the disk has recorded at any time during its lifetime when SMART was enabled. [Note however that some vendors firmware may actually increase the "Worst" value for some "rate-type" Attributes.]
The Attribute table printed out by smartctl also shows the "TYPE" of the Attribute. Attributes are one of two possible types: Pre-failure or Old age. Pre-failure Attributes are ones which, if less than or equal to their threshold values, indicate pending disk failure. Old age, or usage Attributes, are ones which indicate end-of-product life from old-age or normal aging and wearout, if the Attribute value is less than or equal to the threshold. Please note: the fact that an Attribute is of type 'Pre-fail' does not mean that your disk is about to fail! It only has this meaning if the Attribute's current Normalized value is less than or equal to the threshold value. Periodt.
If the Attribute's current Normalized value is less than or equal to the threshold value, then the "WHEN_FAILED" column will display "FAILING_NOW". If not, but the worst recorded value is less than or equal to the threshold value, then this column will display "In_the_past". If the "WHEN_FAILED" column has no entry (indicated by a dash: '-') then this Attribute is OK now (not failing) and has also never failed in the past ๐ซถ.
The table column labeled "UPDATED" shows if the SMART Attribute values are updated during both normal operation and off-line testing, or only during offline testing. The former are labeled "Always" and the latter are labeled "Offline".
So to summarize โจ: the Raw Attribute values are the ones that might have a real physical interpretation, such as "Temperature Celsius", "Hours", or "Start-Stop Cycles". Each manufacturer converts these, using their detailed knowledge of the disk's operations and failure modes, to Normalized Attribute values in the range 1โ254. The current and worst (lowest measured) of these Normalized Attribute values are stored on the disk, along with a Threshold value that the manufacturer has determined will indicate that the disk is going to fail, or that it has exceeded its design age or aging limit. smartctl does not calculate any of the Attribute values, thresholds, or types โ it merely reports them from the SMART data on the device. We're just the messenger ๐
.
Note that starting with ATA/ATAPI-4, revision 4, the meaning of these Attribute fields has been made entirely vendor-specific. However most newer ATA/SATA disks seem to respect their meaning, so we have retained the option of printing the Attribute values.
Solid-state drives use different meanings for some of the attributes. In this case the attribute name printed by smartctl is incorrect unless the drive is already in the smartmontools drive database ๐.
Note that the ATA command SMART READ DATA was declared obsolete in ATA ACS-4 Revision 10 (Nov 2015).
[SCSI] For SCSI devices the "attributes" are obtained from the temperature and start-stop cycle counter log pages. Certain vendor specific attributes are listed if recognised. The attributes are output in a relatively free format (compared with ATA disk attributes).
[NVMe] For NVMe devices the attributes are obtained from the SMART/Health Information log. [NEW EXPERIMENTAL SMARTCTL 7.5 FEATURE] If the device indicates support for SMART/Health Information per namespace, the id of the namespace addressed by the device name is used, otherwise the id of the broadcast namespace.
-f FORMAT,--format=FORMATโ [ATA only] Selects the output format of the attributes:oldโ Oldsmartctlformat. This is the default unless the'-x'option is specified.briefโ New format which fits into 80 columns (except in some rare cases). This format also decodes four additional attribute flags. This is the default if the'-x'option is specified.hex,idโ Print all attribute IDs as hexadecimal numbers.hex,valโ Print all normalized values as hexadecimal numbers.hexโ Same as'-f hex,id -f hex,val'.
-l TYPE,--log=TYPEโ Prints various device logs ๐. The valid arguments to this option are:errorโ [ATA] prints the Summary SMART error log. SMART disks maintain a log of the most recent five non-trivial errors. For each of these errors, the disk power-on lifetime at which the error occurred is recorded, as is the device status (idle, standby, etc) at the time of the error. For some common types of errors, the Error Register (ER) and Status Register (SR) values are decoded and printed as text. The meanings of these are:
ABRT: Command ABoRTed
AMNF: Address Mark Not Found
CCTO: Command Completion Timed Out
EOM: End Of Media
ICRC: Interface Cyclic Redundancy Code (CRC) error
IDNF: IDentity Not Found
ILI: (packet command-set specific)
MC: Media Changed
MCR: Media Change Request
NM: No Media
obs: obsolete
TK0NF: TracK 0 Not Found
UNC: UNCorrectable Error in Data
WP: Media is Write Protected
In addition, up to the last five commands that preceded the error are listed, along with a timestamp measured from the start of the corresponding power cycle. This is displayed in the form Dd+HH:MM:SS.msec where D is the number of days, HH is hours, MM is minutes, SS is seconds and msec is milliseconds. [Note: this time stamp wraps after 2^32 milliseconds, or 49 days 17 hours 2 minutes and 47.296 seconds.] The key ATA disk registers are also recorded in the log. The final column of the error log is a text-string description of the ATA command defined by the Command Register (CR) and Feature Register (FR) values. Commands that are obsolete in the most current spec are listed like this: READ LONG (w/ retry) [OBS-4], indicating that the command became obsolete with or in the ATA-4 specification. Similarly, the notation [RET-N] is used to indicate that a command was retired in the ATA-N specification. Some commands are not defined in any version of the ATA specification but are in common use nonetheless; these are marked [NS], meaning non-standard.
errorโ [SCSI] prints the error counter log pages for reads, write and verifies. The verify row only shows up if it's got an element that isn't zero, bestie. no empty rows here ๐error[,NUM]โ [NVMe] prints the NVMe Error Information log. By default you only get the 16 most recent log entries โ that's it, that's the default. Wanna change it? Toss in the optionalNUMparameter. The max number of log entries is vendor specific (in the range from 1 to 256 inclusive).
ok so real talk โ the contents of this log are not preserved across power cycles or controller resets. But the value of 'Error Information Log Entries' from the SMART/Health Information log is. so there's that ๐ซถ
xerror[,NUM][,error]โ [ATA only] prints the Extended Comprehensive SMART error log (General Purpose Log address0x03). And no, it's not the same as the Summary SMART error log (that's-l errorup above ๐) โ this one has enough room to log the contents of the48-bitLBA register set introduced with ATA-6. It also supports logs with more than one sector, and each sector holds up to 4 log entries. The actual number of log sectors is vendor specific.
Only the 8 most recent error log entries get printed by default. Change that with the optional parameter NUM.
If ,error is appended and the Extended Comprehensive SMART error log is not supported, the Summary SMART self-test log is printed instead.
heads up bestie: recent drives may report errors only in the Extended Comprehensive SMART error log. The Summary SMART error log might claim it's supported but then be always empty. it's giving fake support fr ๐
selftestโ [ATA] prints the SMART self-test log. Your disk keeps a little diary of self-test results, and those tests get run with the-toption described below. For each of the most recent twenty-one self-tests, the log shows the type of test (short or extended, off-line or captive) and the final status of the test. If the test didn't complete successfully, you get the percentage of the test remaining. The time the test took place โ measured in hours of disk lifetime โ is also printed.
[Note: this time stamp wraps after2^16hours, or2730days and16hours, or about7.5years.] girl the clock literally resets. iconic behavior ๐ญ
If any errors were detected, the Logical Block Address (LBA) of the first error is printed in decimal notation.
selftestโ [SCSI] the self-test log for a SCSI device has a slightly different format than for an ATA device. For each of the most recent twenty self-tests, it shows the type of test and the status (final or in progress) of the test. SCSI standards use the terms "foreground" and "background" (rather than ATA's corresponding "captive" and "off-line") and "short" and "long" (rather than ATA's corresponding "short" and "extended") to describe the type of the test. The printed segment number is only relevant when a test fails in the third or later test segment โ it identifies the test that failed and consists of either the number of the segment that failed during the test, or the number of the test that failed and the number of the segment in which the test was run, using a vendor-specific method of putting both numbers into a single byte. The Logical Block Address (LBA) of the first error is printed in hexadecimal notation. If provided, the SCSI Sense Key (SK), Additional Sense Code (ASC) and Additional Sense Code Qualifier (ASCQ) are also printed. The self tests can be run using the-toption described below (using the ATA test terminology).selftestโ [NVMe: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE] prints the NVMe self-test log.
[NEW EXPERIMENTAL SMARTCTL 7.5 FIX] This always uses the broadcast namespace. Self-test results from individual namespaces appear in this single log. so like, they all show up in one place, slay ๐
xselftest[,NUM][,selftest]โ [ATA only] prints the Extended SMART self-test log (General Purpose Log address0x07). Unlike the SMART self-test log (see-l selftestabove), it supports48-bitLBA and logs with more than one sector. Each sector holds up to 19 log entries. The actual number of log sectors is vendor specific.
Only the 25 most recent log entries are printed by default. Change that with the optional parameter NUM.
If ,selftest is appended and the Extended SMART self-test log is not supported, the old SMART self-test log is printed.
selectiveโ [ATA only] peep the-t selectoption below for a full description of selective self-tests. The selective self-test log shows the start/end Logical Block Addresses (LBA) of each of the five test spans, plus their current test status. If the span is being tested or the remainder of the disk is being read-scanned, the current 65536-sector block of LBAs being tested is also displayed. It also shows whether a read-scan of the remainder of the disk will be carried out after the selective self-test has completed (see the-t afterselectoption) and the time delay before restarting this read-scan if it gets interrupted (see the-t pendingoption).directory[,gs]โ [ATA only] if the device supports the General Purpose Logging feature set (ATA-6 and above) then this prints the Log Directory (the log at address0). The Log Directory shows what logs are available and their length in sectors (512bytes). The contents of the logs at address1[Summary SMART error log] and at address6[SMART self-test log] may be printed using the previously-describederrorandselftestarguments to this option. If your version of smartctl supports48-bitATA commands, both the General Purpose Log (GPL) and SMART Log (SL) directories are printed in one combined table. The output can be restricted to the GPL directory or SL directory by-l directory,gor-l directory,srespectively. pick your fighter ๐backgroundโ [SCSI only] the background scan results log outputs information derived from Background Media Scans (BMS) done after power up and/or periodically (e.g. every 24 hours) on recent SCSI disks. If supported, the BMS status is output first, indicating whether a background scan is currently underway (and if so a progress percentage), the amount of time the disk has been powered up and the number of scans already completed. Then there's a header and a line for each background scan "event". These will typically be either recovered or unrecoverable errors. That latter group may need some attention, bestie โ like actually look at it. There's a description of the background scan mechanism in section4.18of SBC-3 revision 6 (seewww.t10.org).scttemp,scttempsts,scttemphistโ [ATA only] prints the disk temperature information provided by the SMART Command Transport (SCT) commands. The optionscttempstsprints current temperature and temperature ranges returned by the SCT Status command,scttemphistprints temperature limits and the temperature history table returned by the SCT Data Table command, andscttempprints both. The temperature values are preserved across power cycles. The logging interval can be configured with the-l scttempint,N[,p]option, see below. The SCT commands were introduced in ATA8-ACS and were also supported by many ATA-7 disks. ๐ก๏ธโจscttempint,N[,p]โ [ATA only] clears the SCT temperature history table and sets the time interval for temperature logging to N minutes. If,pis specified, the setting is preserved across power cycles. Otherwise, the setting is volatile and will be reverted to the last non-volatile setting by the next hard reset. The default interval is vendor specific โ typical values are 1, 2, or 5 minutes.scterc[,READTIME,WRITETIME][,p|reset]โ [ATA only]</p> shows you the values and their descriptions for the SCT Error Recovery Control settings. bestie these are literally the same thing as TLER (that's the Western Digital name for it), CCTL (Samsung and Hitachi/HGST call it that) and ERC (Seagate's name) ๐ . drop in theREADTIMEandWRITETIMEarguments (they're in deciseconds) and you're setting those values. a value of0turns the whole feature off, and any value under65is probably not supported. for RAID setups you'd typically run it at70,70deciseconds. sayscterc,READTIME,WRITETIME,pand those times stay persistent across a power-on reset. sayscterc,pand it prints the values that survive power-on. sayscterc,resetand every SCT timer setting goes back to the manufacturer's default value. heads up: the,pand,resetoptions need the device to support ATA ACS-4 or higher.devstat[,PAGE]โ [ATA only]</p> prints the values and descriptions from the ATA Device Statistics log pages (General Purpose Log address0x04). leavePAGEoff and you get entries from every supported page ๐. give itPAGE 0and it prints the list of supported pages instead. Device Statistics showed up in ACS-2 and only some recent devices have it, ngl.defects[,NUM]โ [ATA]</p> prints the LBA and hours values out of the ATA Pending Defects log (General Purpose Log address0x0c). by default you only get the 31 entries from the first log page. the optionalNUMparameter changes that number. the size of the log and the order of the entries? vendor specific, no cap ๐ญ. the Pending Defects log arrived in ACS-4 Revision 01 (Mar 2014).defectsโ [SCSI]</p> prints the LBAs that the background scan couldn't read (aka a defect ๐). if there are any entries, they show the defective LBA plus the value of the power-on hours (since manufacture) when the background scan found the defect. note that these pending defects can pop up before any application even tries to read the defective LBA.envrepโ [SCSI only]</p> prints the values and descriptions of the SCSI Environmental reporting log page. it's giving one or more temperatures and may include relative humidities too ๐ก๏ธ. lifetime maximums and minimums get reported as well.genstatsโ [SCSI only: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE]</p> prints the values and descriptions of the SCSI General statistics and performance log page โจ.sataphy[,reset]โ [SATA only]</p> prints the values and descriptions of the SATA Phy Event Counters (General Purpose Log address0x11). pass-l sataphy,resetand every counter gets reset right after the values are read ๐ฅ. this works for SATA devices with a Packet interface too, like CD/DVD drives.sasphy[,reset]โ [SAS (SCSI) only]</p> prints the values and descriptions of the SAS (SSP) Protocol Specific log page (log page0x18). pass-l sasphy,resetand all counters are reset after reading the values ๐ .tapealertโ [SCSI tape drives and changers]</p> prints the values and descriptions of the (SSC) Tape Alert log page. peep TAPE DRIVES below for the issue that comes with printing this log page ๐.tapedevstatโ [SCSI tape drives and changers]</p> prints the values and descriptions of the (SSC) Device Statistics log page.zdevstatโ [SCSI zoned disks]</p> prints the values and descriptions of the Zoned Block Device Statistics log page (ZBC-2).gplog,ADDR[,FIRST[-LAST|+SIZE]]โ [ATA only]</p> prints a hex dump of literally any log you can reach through the General Purpose Logging (GPL) feature ๐ซถ. the log addressADDRis the hex address listed in the log directory (that's the-l directoryfrom above, iykyk). you can set the range of log sectors (pages) with decimal valuesFIRST-LASTorFIRST+SIZE.FIRSTdefaults to0,SIZEdefaults to1. andLASTcan be set tomaxto grab the last page of the log.smartlog,ADDR[,FIRST[-LAST|+SIZE]]โ [ATA only]</p> prints a hex dump of any log you can reach via the SMART Read Log command. same parameter syntax as-l gplog,...above, periodt.
okay so for example, all of these commands:
smartctl -l gplog,0x80,10-15 /dev/sda
smartctl -l gplog,0x80,10+6 /dev/sda
smartctl -l smartlog,0x80,10-15 /dev/sda
print pages 10โ15 of log 0x80 (first host vendor specific log) ๐.
the hex dump format is compatible with the xxd -r command. so this command:
smartctl -l gplog,0x11 /dev/sda | grep ^0 | xxd -r >log.bin
writes a binary representation of the one sector log 0x11 (SATA Phy Event Counters) to file log.bin ๐ธ.
nvmelog,PAGE,SIZEโ [NVMe only]</p> prints a hex dump of the firstSIZEbytes from the NVMe log with identifierPAGE.PAGEis a hexadecimal number in the range from0x1to0xff.SIZEis a hexadecimal number in the range from0x4to0x4000(16 KiB).
โ ๏ธ WARNING: Do not specify the identifier of an unknown log page. Reading a log page may have undesirable side effects. like. do not. ๐
ssdโ [ATA]</p> prints the Solid State Device Statistics log page. this hits exactly the same as-l devstat,7, see above ๐ssdโ [SCSI]</p> prints the Solid State Media percentage used endurance indicator. a value of0means it's as new condition, while100means the device is at the end of its lifetime as projected by the manufacturer. and bestie, the value may reach255๐ญ.farmโ [Seagate ATA or SAS (SCSI) only: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE]</p> prints predictive drive health metrics and values from Seagate's vendor-specific Field Access Reliability Metrics (FARM) log when you use it on a drive that supports FARM. the ATA and SAS logs differ slightly. > WARNING: Some Seagate drives do not support FARM.
๐ OPTIONS (still going, we're so back)
-v ID,FORMAT[:BYTEORDER][,NAME],--vendorattribute=ID,FORMAT...โ [ATA only]</p> sets a vendor-specific raw value printFORMAT, an optionalBYTEORDERand an optionalNAMEfor AttributeID. you can use this option multiple times, no cap ๐ซถ.
the Attribute ID can be in the range 1 to 255. and if you pass N as the ID, the settings for all Attributes get changed. iconic.
the optional BYTEORDER is made of 1 to 8 characters from the set 012345rvwz. here's the tea: 0 to 5 select byte 0 to 5 from the 48-bit raw value, r selects the reserved byte of the attribute data block, v selects the normalized value, w selects the worst value, and z inserts a zero byte. the default BYTEORDER is 543210 for all 48-bit formats, r543210 for the 54-bit formats, and 543210wv for the 64-bit formats. so like, -v 5,raw48:012345 prints the raw value of attribute 5 with big endian instead of little endian byte ordering โจ.
the NAME is a string of letters, digits and underscore. its length should not exceed 23 characters. and the -P showall option reports an error if that's the case, so behave ๐
.
-v help โ prints (to STDOUT) a list of all valid arguments to this option, then exits. chef's kiss, use it.
valid arguments for FORMAT are:
raw8โ prints the Raw value as six 8-bit unsigned base-10 integers. this may be useful for decoding the meaning of the Raw value ๐.raw16โ prints the Raw value as three 16-bit unsigned base-10 integers. also may be useful for decoding the meaning of the Raw value.raw48โ prints the Raw value as a 48-bit unsigned base-10 integer. this is the default for most attributes ๐.hex48โ prints the Raw value as a 12 digit hexadecimal number. may be useful for decoding the meaning of the Raw value.raw56โ prints the Raw value as a 54-bit unsigned base-10 integer. this includes the reserved byte which follows the 48-bit raw value.hex56โ prints the Raw value as a 14 digit hexadecimal number. this includes the reserved byte which follows the 48-bit raw value.raw64โ prints the Raw value as a 64-bit unsigned base-10 integer. this includes two bytes from the normalized and worst attribute value. some SSD devices with an Indilinx controller use this raw format.hex64โ prints the Raw value as a 16 digit hexadecimal number. this includes two bytes from the normalized and worst attribute value. again, some SSD devices with an Indilinx controller use this raw format.min2hourโ Raw Attribute is power-on time in minutes. its raw value gets displayed in the form"Xh+Ym". hereXis hours, andYis minutes in the range 0โ59 inclusive.Yis always printed with two digits, for example"06"or"31"or"00"โฐ.sec2hourโ Raw Attribute is power-on time in seconds. its raw value gets displayed in the form"Xh+Ym+Zs". hereXis hours,Yis minutes in the range 0โ59 inclusive, andZis seconds in the range 0โ59 inclusive.YandZare always printed with two digits, for example"06"or"31"or"00".halfmin2hourโ Raw Attribute is power-on time, measured in units of 30 seconds. some Samsung disks use this format. its raw value gets displayed in the form"Xh+Ym". hereXis hours, andYis minutes in the range 0โ59 inclusive.Yis always printed with two digits, for example"06"or"31"or"00".msec24hour32โ Raw Attribute is power-on time measured in 32-bit hours and 24-bit milliseconds since last hour update. it gets displayed in the form"Xh+Ym+Z.Ms". hereXis hours,Yis minutes,Zis seconds andMis milliseconds.tempminmaxโ Raw Attribute is the disk temperature in Celsius. info about Min/Max temperature gets printed if it's available. this is the default for Attributes190and194. the recording interval (lifetime, last power cycle, last soft reset) of the min/max values is device specific ๐ก๏ธ.temp10xโ Raw Attribute is ten times the disk temperature in Celsius.raw16(raw16)โ prints the raw attribute as a 16-bit value and two optional 16-bit values if these words are nonzero. this is the default for Attributes5and196.raw16(avg16)โ Raw attribute is spin-up time. it gets printed as a 16-bit value and an optional"Average"16-bit value if the word is nonzero. this is the default for Attribute3.
raw24(raw8)โ prints that raw attribute as a 24-bit value, plus up to three optional 8-bit values if those bytes aren't zero. This is the default vibe for Attribute 9. ๐raw24/raw24โ the Raw Attribute is packing two 24-bit values. First one = number of load cycles. Second one = number of unload cycles. Subtract them and you get the number of times the drive got powered off when it was NOT expecting it (aka an emergency unload). Rule of thumb bestie: the mechanical stress from one emergency unload โ one hundred normal unloads. ๐ญraw24/raw32โ raw attribute is an error rate made of a 24-bit error count and a 32-bit total count.
And the following old arguments to -v are still valid too, no cap:
9,minutesโ same as:9,min2hour,Power_On_Minutes.9,secondsโ same as:9,sec2hour,Power_On_Seconds.9,halfminutesโ same as:9,halfmin2hour,Power_On_Half_Minutes.9,tempโ same as:9,tempminmax,Temperature_Celsius.192,emergencyretractcyclectโ same as:192,raw48,Emerg_Retract_Cycle_Ct193,loadunloadโ same as:193,raw24/raw24.194,10xCelsiusโ same as:194,temp10x,Temperature_Celsius_x10.194,unknownโ same as:194,raw48,Unknown_Attribute.197,increasingโ same as:197,raw48,Total_Pending_Sectors. Also means Attribute number 197 (Current Pending Sector Count) is not reset if uncorrectable sectors get reallocated (go peek at thesmartd.conf(5)man page).198,increasingโ same as:198,raw48,Total_Offl_Uncorrectabl. Also means Attribute number 198 (Offline Uncorrectable Sector Count) is not reset if uncorrectable sectors get reallocated (again, seesmartd.conf(5)).198,offlinescanuncsectorctโ same as:198,raw48,Offline_Scan_UNC_SectCt.200,writeerrorcountโ same as:200,raw48,Write_Error_Count.201,detectedtacountโ same as:201,raw48,Detected_TA_Count.220,tempโ same as:220,tempminmax,Temperature_Celsius.
๐ OPTIONS ๐ (still going, she's got range)
-F TYPE, --firmwarebug=TYPE
[ATA only] This one tweaks how smartctl behaves so it can compensate for some known and understood device firmware or driver bugs. You can use this option multiple times. The valid arguments are:
noneโ assume the device firmware actually obeys the ATA specifications. This is the default, unless the device has presets for-Fin the drive database. Using this option on the command line will override any preset values. ๐โโ๏ธnologdirโ suppresses read attempts of SMART or GP Log Directory. Support for all standard logs is just assumed without an actual check. Some Intel SSDs may freeze if log address 0 is read. ๐ฅถsamsungโ in some Samsung disks (example: modelSV4012HFirmware Version:RM100-08) some of the two- and four-byte quantities in the SMART data structures are byte-swapped (relative to the ATA specification). Enabling this option tells smartctl to evaluate these quantities in byte-reversed order. Some signs that your disk needs this option are (1) no self-test log printed, even though you have run self-tests; (2) very large numbers of ATA errors reported in the ATA error log; (3) strange and impossible values for the ATA error log timestamps.samsung2โ in some Samsung disks the number of ATA errors reported is byte swapped. Enabling this option tells smartctl to evaluate this quantity in byte-reversed order. An indication that your Samsung disk needs this option is that the self-test log is printed correctly, but there are a very large number of errors in the SMART error log. This is because the error count is byte swapped. So a disk with five errors (0x0005) will appear to have 20480 errors (0x5000). ๐ณsamsung3โ some Samsung disks (at leastSP2514Nwith FirmwareVF100-37) report a self-test still in progress with 0% remaining when the test was already completed. Enabling this option modifies the output of the self-test execution status (see options-cor-aabove) accordingly.xerrorlbaโ fixes LBA byte ordering in Extended Comprehensive SMART error log. Some disks use little endian byte ordering instead of ATA register ordering to specify the LBA addresses in the log entries.swapidโ fixes byte swapped ATA identify strings (device name, serial number, firmware version) returned by some buggy device drivers. ๐
-P TYPE, --presets=TYPE
[ATA only] Specifies whether smartctl should use any preset options that are available for this drive. By default, if the drive is recognized in the smartmontools database, then the presets are used. โจ
The argument show will show any preset options for your drive and the argument showall will show all known drives in the smartmontools database, along with their preset options. If there are no presets for your drive and you think there should be (for example, a -v or -F option is needed to get smartctl to display correct values) then please contact the smartmontools developers so that this information can be added to the smartmontools database. Contact information is at the end of this man page. ๐ซถ
The valid arguments to this option are:
useโ if a drive is recognized, then use the stored presets for it. This is the default. Note that presets will NOT override additional Attribute interpretation (-v N,something) command-line options or explicit-Fcommand-line options..ignoreโ do not use presets.showโ show if the drive is recognized in the database, and if so, its presets, then exit.showallโ list all recognized drives, and the presets that are set for them, then exit. This also checks the drive database regular expressions and settings for syntax errors. ๐
The -P showall option takes up to two optional arguments to match a specific drive type and firmware version. The command:
smartctl -P showall
lists all entries, the command:
smartctl -P showall 'MODEL'
lists all entries matching MODEL, and the command:
smartctl -P showall 'MODEL' 'FIRMWARE'
lists all entries for this MODEL and a specific FIRMWARE version.
-B [+]FILE, --drivedb=[+]FILE
[ATA only] Read the drive database from FILE. The new database replaces the built in database by default. If + is specified, then the new entries prepend the built in entries. ๐ฆ
Optional entries are read from the file /etc/smartmontools/smart_drivedb.h if this option is not specified.
If /usr/share/smartmontools/drivedb.h is present, the contents of this file is used instead of the built in table.
Run /usr/bin/update-smart-drivedb to update this file from the smartmontools SVN repository.
The database files use the same C/C++ syntax that is used to initialize the built in database array. C/C++ style comments are allowed. Example:
/* Full entry: */
{
"Model family", // Info about model family/series.
"MODEL1.*REGEX", // Regular expression to match model of device.
"VERSION.*REGEX", // Regular expression to match firmware version(s).
"Some warning", // Warning message.
"-v 9,minutes" // String of preset -v and -F options.
},
/* Minimal entry: */
{
"", // No model family/series info.
"MODEL2.*REGEX", // Regular expression to match model of device.
"", // All firmware versions.
"", // No warning.
"" // No options preset.
},
/* USB ID entry: */
{
"USB: Device; Bridge", // Info about USB device and bridge name.
"0x1234:0xabcd", // Regular expression to match vendor:product ID.
"0x0101", // Regular expression to match bcdDevice.
"", // Not used.
"-d sat" // String with device type option.
},
/* ... */
๐ SMART RUN/ABORT OFFLINE TEST AND self-test OPTIONS: ๐
-t TEST, --test=TEST
Executes TEST immediately. The -C option can be used in conjunction with this option to run the short or long (and also for ATA devices, selective or conveyance) self-tests in captive mode (known as "foreground mode" for SCSI devices). Note that only one test type can be run at a time, so only one test type should be specified per command line. Note also that if a computer is shutdown or power cycled during a self-test, no harm should result. The self-test will either be aborted or will resume automatically. ๐ซ
All -t TEST commands can be given during normal system operation unless captive mode (-C option) is used. A running self-test can, however, degrade performance of the drive. Frequent I/O requests from the operating system increase the duration of a test. These impacts may vary from device to device.
If a test failure occurs then the device may discontinue the testing and report the result immediately.
[ATA] Note that the ATA command SMART EXECUTE OFF-LINE IMMEDIATE (the command to start a test) was declared obsolete in ATA ACS-4 Revision 10 (Nov 2015).
The valid arguments to this option are:
offlineโ [ATA] runs SMART Immediate Offline Test. This immediately starts the test described above. This command can be given during normal system operation. The effects of this test are visible only in that it updates the SMART Attribute values, and if errors are found they will appear in the SMART error log, visible with the-l erroroption.
okay so if the -c option to smartctl shows that the device has the "Suspend Offline collection upon new command" capability then you can track the progress of the Immediate Offline test using the -c option to smartctl. If the -c option show that the device has the "Abort Offline collection upon new command" capability then most commands will abort the Immediate Offline Test, so you should not try to track the progress of the test with -c, as it will abort the test. ๐ญ
offlineโ [SCSI] runs the default self test in foreground. No entry is placed in the self test log. ๐ซถshortโ [ATA] runs SMART Short Self Test (usually under ten minutes). This command can be given during normal system operation (unless run in captive mode - see the-Coption below). This is a test in a different category than the immediate or automatic offline tests. The "Self" tests check the electrical and mechanical performance as well as the read performance of the disk. Their results are reported in the Self Test Error Log, readable with the-l selftestoption. Note that on some disks the progress of the self-test can be monitored by watching this log during the self-test; with other disks use the-coption to monitor progress. ๐shortโ [SCSI] runs the "Background short" self-test. โจshortโ [NVMe: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE] runs the "Short" self-test for current namespace. ๐ฆlongโ [ATA] runs SMART Extended Self Test (tens of minutes to several hours). This is a longer and more thorough version of the Short Self Test described above. Note that this command can be given during normal system operation (unless run in captive mode - see the-Coption below). ๐ฅlongโ [SCSI] runs the "Background long" self-test. ๐longโ [NVMe: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE] runs the "Extended" self-test for current namespace. ๐conveyanceโ [ATA only] runs a SMART Conveyance Self Test (minutes). This self-test routine is intended to identify damage incurred during transporting of the device. This self-test routine should take on the order of minutes to complete. Note that this command can be given during normal system operation (unless run in captive mode - see the-Coption below). ๐select,N-M,select,N+SIZEโ [ATA only] runs a SMART Selective Self Test, to test a range of disk Logical Block Addresses (LBAs), rather than the entire disk. Each range of LBAs that is checked is called a "span" and is specified by a starting LBA (N) and an ending LBA (M) with N less than or equal to M. The range can also be specified as N+SIZE. A span at the end of a disk can be specified by N-max. ๐ง
For example the commands:
smartctl -t select,10-20 /dev/sda
smartctl -t select,10+11 /dev/sda
both runs a self test on one span consisting of LBAs ten to twenty (inclusive). The command:
smartctl -t select,100000000-max /dev/sda
run a self test from LBA 100000000 up to the end of the disk. The -t option can be given up to five times, to test up to five spans. For example the command:
smartctl -t select,0-100 -t select,1000-2000 /dev/sda
runs a self test on two spans. The first span consists of 101 LBAs and the second span consists of 1001 LBAs. Note that the spans can overlap partially or completely, for example:
smartctl -t select,0-10 -t select,5-15 -t select,10-20 /dev/sda
The results of the selective self-test can be obtained (both during and after the test) by printing the SMART self-test log, using the -l selftest option to smartctl. ๐
Selective self tests are particularly useful as disk capacities increase: an extended self test (smartctl -t long) can take several hours. Selective self-tests are helpful if (based on SYSLOG error messages, previous failed self-tests, or SMART error log entries) you suspect that a disk is having problems at a particular range of Logical Block Addresses (LBAs). ๐ธ
Selective self-tests can be run during normal system operation (unless done in captive mode - see the -C option below). โญ
The following variants of the selective self-test command use spans based on the ranges from past tests already stored on the disk:
select,redo[+SIZE]โ [ATA only] redo the last SMART Selective Self Test using the same LBA range. The starting LBA is identical to the LBA used by last test, same for ending LBA unless a new span size is specified by optional+SIZEargument. ๐
For example the commands:
smartctl -t select,10-20 /dev/sda
smartctl -t select,redo /dev/sda
smartctl -t select,redo+20 /dev/sda
have the same effect as:
smartctl -t select,10-20 /dev/sda
smartctl -t select,10-20 /dev/sda
smartctl -t select,10-29 /dev/sda
select,next[+SIZE]โ [ATA only] runs a SMART Selective Self Test on the LBA range which follows the range of the last test. The starting LBA is set to (ending LBA +1) of the last test. A new span size may be specified by the optional+SIZEargument. โจ
For example the commands:
smartctl -t select,0-999 /dev/sda
smartctl -t select,next /dev/sda
smartctl -t select,next+2000 /dev/sda
have the same effect as:
smartctl -t select,0-999 /dev/sda
smartctl -t select,1000-1999 /dev/sda
smartctl -t select,2000-3999 /dev/sda
If the last test ended at the last LBA of the disk, the new range starts at LBA 0. The span size of the last span of a disk is adjusted such that the total number of spans to check the full disk will not be changed by future uses of -t select,next. ๐
select,cont[+SIZE]โ [ATA only] performs a 'redo' (above) if the self test status reports that the last test was aborted by the host. Otherwise it run the 'next' (above) test. ๐ฆafterselect,onโ [ATA only] perform an offline read scan after a Selective self-test has completed. This option must be used together with one or more of theselect,N-Moptions above. If the LBAs that have been specified in the Selective self-test pass the test with no errors found, then read scan the remainder of the disk. If the device is powered-cycled while this read scan is in progress, the read scan will be automatically resumed after a time specified by the pending timer (see below). The value of this option is preserved between selective self-tests. ๐ฅafterselect,offโ [ATA only] do not read scan the remainder of the disk after a Selective self-test has completed. This option must be use together with one or more of theselect,N-Moptions above. The value of this option is preserved between selective self-tests. ๐ซถpending,Nโ [ATA only] set the pending offline read scan timer to N minutes. Here N is an integer in the range from 0 to 65535 inclusive. If the device is powered off during a read scan after a Selective self-test, then resume the test automatically N minutes after power-up. This option must be use together with one or more of theselect,N-Moptions above. The value of this option is preserved between selective self-tests. ๐vendor,Nโ [ATA only] issues the ATA commandSMART EXECUTE OFF-LINE IMMEDIATEwith subcommand N in LBA LOW register. The subcommand is specified as a hex value in the range0x00to0xff. Subcommands0x40โ0x7eand0x90โ0xffare reserved for vendor specific use, see table 61 of T13/1699-D Revision 6a (ATA8-ACS). Note that the subcommands0x00โ0x04,0x7f,0x81โ0x84are supported by other smartctl options (e.g.0x01:-t short,0x7f:-X,0x82:-C -t long). ๐
WARNING: Only run subcommands documented by the vendor of the device. ๐
Example for some Intel SSDs only: The subcommand 0x40 (-t vendor,0x40) clears the timed workload related SMART attributes (226, 227, 228). Note that the raw values of these attributes are held at 65535 (0xffff) until the workload timer reaches 60 minutes. ๐ฅ
forceโ start new self-test even if another test is already running. By default a running self-test will not be interrupted to begin another test. โจ-C,--captiveโ [ATA] Runs self-tests in captive mode. This has no effect with-t offlineor if the-toption is not used.
WARNING: Tests run in captive mode may busy out the drive for the length of the test. Only run captive tests on drives without any mounted partitions! ๐ญ
[SCSI] Runs the self-test in "Foreground" mode. ๐
-X,--abortโ Aborts non-captive SMART Self Tests. Note that this command will abort the Offline Immediate Test routine only if your disk has the "Abort Offline collection upon new command" capability. โญ
๐ ATA, SCSI command sets and SAT ๐
Okay so bestie, back in the day there was a whole clear split between storage devices that used ATA and SCSI command sets. That split was often visible in device naming and hardware. Now various SCSI transports (like SAS, FC and iSCSI) can connect to both SCSI disks (like FC and SAS) and ATA disks (especially SATA). USB and IEEE 1394 storage devices use the SCSI command set on the outside but almost always have ATA or SATA disks (or flash) inside. Some OS storage subsystems have started removing the ATA-vs-SCSI distinction in device naming policies.
99% of operations an OS does on a disk are the SCSI INQUIRY, READ CAPACITY, READ and WRITE commands, or their ATA equivalents. SCSI commands are a little more general than ATA equivalents, so many OSes generate SCSI commands (mainly READ and WRITE) and let a lower level translate them to ATA equivalents when needed. Important note: that "lower level" may live in external equipment, so it can be outside the OS's control.
SCSI to ATA Translation (SAT) is a standard (ANSI INCITS 431-2007) that says how this translation is done. For the other 1% of operations that an OS performs on a disk, SAT gives two options. First is an optional ATA PASS-THROUGH SCSI command (there are two variants). Second is a translation from the closest SCSI command. Most current interest is in the "pass-through" option.
Why does this matter to smartmontools (and therefore smartctl)? Because its interactions with disks fall solidly into that "1%" category. So even if the OS can happily treat (and name) a disk as "SCSI", smartmontools needs to detect the native command set and act accordingly. As more storage manufacturers (including external SATA drives) comply with SAT, smartmontools can automatically distinguish the native command set of the device. In some cases the -d sat option is needed on the command line.
There are also virtual disks. They typically have no useful information to convey to smartmontools, but could conceivably in the future. One example is the OS's view of a RAID 1 box. There are most likely two SATA disks inside a RAID 1 box. Addressing those SATA disks from a distant OS is a challenge for smartmontools. Another approach is running a tool like smartmontools inside the RAID 1 box (e.g. a Network Attached Storage (NAS) box) and fetching the logs via a browser.
๐ผ TAPE DRIVES ๐ผ
Commands for SCSI Tape drives are defined in the SSC-4 standard (ANSI INCITS 516-2013). SSC stands for "SCSI Streaming Commands". Draft standards can be found at https://www.t10.org/.
Many SMART related features of SCSI disks are shared by SCSI tape drives. One important tape-specific log page is called "TapeAlert", and it reports abnormal conditions. Unlike most other log pages, the TapeAlert log page clears pending alerts after that page is fetched (i.e. read from the tape drive). To be more precise, the TapeAlert log page is cleared for the I_T nexus (initiator-target pair) that sent the (SCSI LOG SENSE) command; so another initiator (e.g. a HBA on another machine) will still have pending alerts reported. [This clearing action can be controlled by the TAPLSD bit is the [SSC] Device Configuration Extension mode page but the original and default action remains: clear any pending TapeAlerts. The sdparm utility can be used to access and change TAPLSD.]
Previous versions of smartctl have supported polling the TapeAlert log page when the --health option is given. This clearing of pending alerts has created problems for other tape-specific tools. This version of smartctl will only fetch the TapeAlert log page if the --health option is given twice in the command line invocation (or the --log=tapealert option is given).
There are other tape-specific log pages such as --log=tapedevstat that behave normally (i.e. they don't change any state information in the tape drive).
โจ EXAMPLES โจ
smartctl -a /dev/sda
Print a large amount of SMART information for drive /dev/sda.
smartctl -s off /dev/sdd
Disable SMART monitoring and data log collection on drive /dev/sdd.
smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda
Enable SMART on drive /dev/sda, enable automatic offline testing every four hours, and enable autosaving of SMART Attributes. This is a good start-up line for your system's init files. You can issue this command on a running system.
smartctl -t long /dev/sdc
Begin an extended self-test of drive /dev/sdc. You can issue this command on a running system. The results can be seen in the self-test log visible with the -l selftest option after it has completed.
smartctl -s on -t offline /dev/sda
Enable SMART on the disk, and begin an immediate offline test of drive /dev/sda. You can issue this command on a running system. The results are only used to update the SMART Attributes, visible with the -A option. If any device errors occur, they are logged to the SMART error log, which can be seen with the -l error option.
smartctl -A -v 9,minutes /dev/sda
Shows the vendor Attributes, when the disk stores its power-on time internally in minutes rather than hours.
smartctl -q errorsonly -H -l selftest /dev/sda
Produces output only if the device returns failing SMART status, or if some of the logged self-tests ended with errors.
smartctl -q silent -a /dev/sda
Examine all SMART data for device /dev/sda, but produce no printed output. You must use the exit status (the $? shell variable) to learn if any Attributes are out of bound, if the SMART status is failing, if there are errors recorded in the self-test log, or if there are errors recorded in the disk error log.
smartctl -a -d 3ware,0 /dev/twl0
Examine all SMART data for the first SATA (not SAS) disk connected to a 3ware RAID 9750 controller card.
smartctl -t long -d areca,4 /dev/sg2
Start a long self-test on the fourth SATA disk connected to an Areca RAID controller addressed by /dev/sg2.
smartctl -a -d hpt,1/3 /dev/sda (under Linux)
smartctl -a -d hpt,1/3 /dev/hptrr (under FreeBSD)
Examine all SMART data for the (S)ATA disk directly connected to the third channel of the first HighPoint RocketRAID controller card.
smartctl -t short -d hpt,1/1/2 /dev/sda (under Linux)
smartctl -t short -d hpt,1/1/2 /dev/hptrr (under FreeBSD)
Start a short self-test on the (S)ATA disk connected to second pmport on the first channel of the first HighPoint RocketRAID controller card.
smartctl -t select,10-100 -t select,30-300 -t afterselect,on -t
pending,45 /dev/sda
Run a selective self-test on LBAs 10 to 100 and 30 to 300. After the these LBAs have been tested, read-scan the remainder of the disk. If the disk is power-cycled during the read-scan, resume the scan 45 minutes after power to the device is restored.
smartctl -a -d cciss,0 /dev/cciss/c0d0
Examine all SMART data for the first SCSI disk connected to a cciss RAID controller card.
๐ฆ EXIT STATUS ๐ฆ
The exit statuses of smartctl are defined by a bitmask. If all is well with the disk, the exit status (return value) of smartctl is 0 (all bits turned off). If a problem occurs, or an error, potential error, or fault is detected, then a non-zero status is returned. In this case, the eight different bits in the exit status have the following meanings for ATA disks; some of these values may also be returned for SCSI disks.
- Bit 0: Command line did not parse.
- Bit 1: Device open failed, device did not return an
IDENTIFY DEVICEstructure, or device is in a low-power mode (see-noption above). - Bit 2: Some SMART or other ATA command to the disk failed, or there was a checksum error in a SMART data structure (see
-boption above). - Bit 3: SMART status check returned "DISK FAILING".
- Bit 4: We found prefail Attributes <= threshold.
- Bit 5: SMART status check returned "DISK OK" but we found that some (usage or prefail) Attributes have been <= threshold at some time in the past.
- Bit 6: The device error log contains records of errors.
- Bit 7: The device self-test log contains records of errors. [ATA only] Failed self-tests outdated by a newer successful extended self-test are ignored.
To test within the shell for whether or not the different bits are turned on or off, you can use the following type of construction (which should work with any POSIX compatible shell):
smartstat=$(($? & 8))
This looks at only at bit 3 of the exit status $? (since 8=2^3). The shell variable $smartstat will be nonzero if SMART status check returned "disk failing" and zero otherwise.
This shell script prints all status bits:
val=$?; mask=1
for i in 0 1 2 3 4 5 6 7; do
echo "Bit $i: $(((val & mask) && 1))"
mask=$((mask << 1))
done
๐ FILES ๐
/usr/bin/smartctlโ full path of this executable./usr/share/smartmontools/drivedb.hโ drive database (see-Boption)./etc/smartmontools/smart_drivedb.hโ optional local drive database (see-Boption).
๐ AUTHORS ๐
- Bruce Allen (project initiator),
- Christian Franke (project manager, Windows port and all sort of things),
- Douglas Gilbert (SCSI subsystem),
- Volker Kuhlmann (moderator of support and database mailing list),
- Gabriele Pohl (wiki & development team support),
- Alex Samorukov (FreeBSD port and more, new Trac wiki).
Many other individuals have made contributions and corrections, see AUTHORS, ChangeLog and repository files.
The first smartmontools code was derived from the smartsuite package, written by Michael Cornwell and Andre Hedrick.
๐ REPORTING BUGS ๐
To submit a bug report, create a ticket in smartmontools wiki: https://www.smartmontools.org/.
Alternatively send the info to the smartmontools support mailing list: https://listi.jpberlin.de/mailman/listinfo/smartmontools-support.
๐ SEE ALSO ๐
๐ REFERENCES ๐
okay bestie, if you wanna go deeper than this manpage (and honestly, respect), here's where to look ๐
Please see the following web site for more info: <https://www.smartmontools.org/>
There's an intro article about smartmontools called Monitoring Hard Disks with SMART, written by Bruce Allen, published in Linux Journal, January 2004, pages 74โ77. See <https://www.linuxjournal.com/article/6983>. like, an actual paper, in an actual magazine, iconic behavior fr fr ๐โจ
If you'd genuinely like to understand better how SMART works, and what it does, a good place to start is with Sections 4.8 and 6.54 of the first volume of the 'AT Attachment with Packet Interface-7' (ATA/ATAPI-7) specification Revision 4b. This documents the SMART functionality which the smartmontools utilities provide access to. no cap, that's the source material right there ๐
And listen, the functioning of SMART was originally defined by the SFF-8035i revision 2 and the SFF-8055i revision 1.4 specifications. These are publications of the Small Form Factors (SFF) Committee. history, bestie ๐ฆ
Links to these and other documents may be found on the Links page of the smartmontools Wiki at <https://www.smartmontools.org/wiki/Links>. go click around, it's giving research era ๐ฅ
๐ PACKAGE VERSION ๐
smartmontools-7.5 2025-04-30 r5714
$Id: smartctl.8.in 5692 2025-04-21 15:21:15Z chrfranke $
and that's the whole entire page, bestie!! you made it to the very end ๐ซถ this version of the page is smartmontools-7.5, dated 2025-04-30, and it's filed under SMARTCTL(8) in your friendly neighborhood manual section 8 ๐
now go run smartctl -a /dev/sda and tell your drives you love them. periodt. ๐๐โจ
๐ฆ where this page comes from
- fedora 43: smartmontools 1:7.5-10.fc43
- fedora 43: smartmontools 1:7.5-11.fc43 ยท GPL-2.0-or-later
- fedora 43: smartmontools 1:7.5-4.fc43 ยท GPL-2.0-or-later
- fedora 44: smartmontools 1:7.5-10.fc44
- fedora 44: smartmontools 1:7.5-11.fc44 ยท GPL-2.0-or-later
- fedora 44: smartmontools 1:7.5-6.fc44 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms