SMART: Difference between revisions
No edit summary |
mNo edit summary |
||
| Line 4: | Line 4: | ||
On Linux, most distros package SMART as the <code>smartmontools</code> package. Two utilities come with this package: | On Linux, most distros package SMART as the <code>smartmontools</code> package. Two utilities come with this package: | ||
* <code>smartctl</code>, which can be used to perform SMART related tasks such as starting tests and printing health status reports | *<code>smartctl</code>, which can be used to perform SMART related tasks such as starting tests and printing health status reports | ||
* <code>smartd</code>, which monitors SMART and performs self-tests periodically. This may be configured to alert you when issues are detected. | *<code>smartd</code>, which monitors SMART and performs self-tests periodically. This may be configured to alert you when issues are detected. | ||
===Show Disk Information=== | ===Show Disk Information=== | ||
| Line 16: | Line 16: | ||
Use the <code>--test=long</code> or the <code>--test=short</code> options to begin a self-test on the device. To abort a test, use the {{code|-X}} or {{code|--abort}} option. Test results will be listed under the self-test section in <code>smartctl -a</code> or <code>smartctl -l selftest</code>. | Use the <code>--test=long</code> or the <code>--test=short</code> options to begin a self-test on the device. To abort a test, use the {{code|-X}} or {{code|--abort}} option. Test results will be listed under the self-test section in <code>smartctl -a</code> or <code>smartctl -l selftest</code>. | ||
If a test failed on a bad sector, you may try to [[Hdparm|force a reallocation of that sector]]. | If a test failed on a bad sector, you may try to [[Hdparm#Fix a damaged sector by forcing reallocation|force a reallocation of that sector]]. | ||
It isn't a bad idea to schedule long self tests periodically (like once a month?). | It isn't a bad idea to schedule long self tests periodically (like once a month?). | ||
Revision as of 04:46, 3 April 2021
SMART (Self-Monitoring, Analysis and Reporting Technology) is a monitoring system included in all computer hard drives and solid state drives.
Usage
On Linux, most distros package SMART as the smartmontools package. Two utilities come with this package:
smartctl, which can be used to perform SMART related tasks such as starting tests and printing health status reportssmartd, which monitors SMART and performs self-tests periodically. This may be configured to alert you when issues are detected.
Show Disk Information
To show all capabilities, monitored attributes, errors, etc. of a particular disk, run:
# smartctl -a /dev/sda
Run Self-Test
Use the --test=long or the --test=short options to begin a self-test on the device. To abort a test, use the -X or --abort option. Test results will be listed under the self-test section in smartctl -a or smartctl -l selftest.
If a test failed on a bad sector, you may try to force a reallocation of that sector.
It isn't a bad idea to schedule long self tests periodically (like once a month?).
Troubleshooting
USB Support
When working with hard drives connected via USB, you need to disable USB Attached SCSI (UAS). Otherwise, smartctl will report:
# smartctl -a /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.6.14-300.fc32.x86_64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
Read Device Identity failed: scsi error unsupported field in scsi command
Use one of three methods described in the Disable UAS page. Once UAS is disabled, smartctl should be able to report the SMART parameters. For some devices, you may need to also pass in a -d option to smartctl. Check the supported devices page. https://www.smartmontools.org/wiki/Supported_USB-Devices for more information.
Attributes
Some attributes of note.
- Reallocated_Sector_Ct
- Disks automatically remap bad sectors to a pool of reserved sectors. This attribute is the number of sectors that have been reallocated. You should be wary of disks with a non-zero value.
- Current_Pending_Sector
- The number of sectors that the disk had issues reading. The sector will be reallocated when either: 1. the sector can be read properly or 2. the sector is written over which may force a reallocation.