SMART
SMART (Self-Monitoring, Analysis and Reporting Technology) is a monitoring system included in all computer hard drives and solid state drives.
Usage
On Linux, install the smartmon-tools package. Use the smartctl utility.
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 short option to begin a self-test on the device. To abort a test, use the -X or --abort option.
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.
- 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.