Get info

$ devPath=/dev/sdX

S.M.A.R.T only info

$ sudo smartctl -a $devPath

All available info

$ sudo smartctl --xall $devPath

Lifetime/age

Useful information to determine lifetime/age in section SMART Attributes Data Structure revision number: X, atribute with id 9 and name Power_On_Hours. Value is stored in field RAW_VALUE usually in units hours. Simple way to test the units is of course to keep the disk rotating (no read/writes needed) and check for changes in the attribute 9:

$ sudo smartctl --all $devPath | grep Power_On

Also, perform a short test with

$ sudo smartctl -t short $devPath

When done, output all info again and look for section that report overall test results, it starts with string SMART Extended Self-test Log Version:. The field LifeTime(hours) will report the lifetime of the disk when the test was performed.

Another way is to output all info again, and look for temperature history info. Section starts with string SCT Temperature History Version. It shows a timestamped log of temperature of disk.

Test

Start long test

$ sudo smartctl -t long $devPath

Monitor progress

$ status_str='self-test execution status'
$ sudo smartctl -a $devPath  | grep -i "$status_str" -A 1

Read from disk every n seconds to keep it from going to standby

$ n=15
$ watch --interval $n sudo dd if=$devPath of=/dev/null count=1

After test is done view results via either

$ sudo smartctl -a $devPath
$ sudo smartctl -l selftest $devPath

Misc

  • Fedora packages: smartmontools & gsmartcontrol.

  • Systemctl service unit: smartd.service

  • Not all USB devices supported, see Smartmontools USB Device Support.

  • If the partition is NTFS the problem might be with partition itself not with the disk. Check the disk on Windows with chkdsk, see references for links. You may see a message like ths on Linux:

    ntfs_attr_pread_i: ntfs_pread failed: Input/output error
    Failed to read NTFS $Bitmap: Input/output error
    NTFS is either inconsistent, or there is a hardware fault, or it's a
    SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
    then reboot into Windows twice. The usage of the /f parameter is very
    important! If the device is a SoftRAID/FakeRAID then first activate
    it and mount a different device under the /dev/mapper/ directory, (e.g.
    /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
    for more details.
    
  • It looks like S.M.A.R.T. diagnostic data is not as useful as initially thought, the following is quoted from Failure Trends in a Large Disk Drive Population

    …we find that failure prediction models based on SMART parameters alone are likely to be severely limited in their prediction accuracy, given that a large fraction of our failed drives have shown no SMART error signals whatsoever. This result suggests that SMART models are more useful in predicting trends for large aggregate populations than for individual components. It also suggests that powerful predictive models need to make use of signals beyond those provided by SMART.

References