SMART Devices

Listing 9: Long Test Output

# smartctl -l selftest /dev/sda
smartctl 7.2 2020-07-11 r5076 [x86_64-linux-5.4.0-42-generic] (CircleCI)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%     12441         -
# 2  Short offline       Completed without error       00%     12441         -
# 3  Short offline       Completed without error       00%     12441         -

The output of the extended test is reported in the Extended offline line. It, too, was completed without error. If you run

smartctl -l selftest

and do not see any Extended offline output, the long test has not completed. Just wait a little longer and try the command again until you see the output.

In addition to self-tests, you can also search the SMART logs for errors with the simple command shown in Listing 10.

Listing 10: Self-Test Logs

# smartctl -l error -d sat /dev/sda
smartctl 7.2 2020-07-11 r5076 [x86_64-linux-5.4.0-42-generic] (CircleCI)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged

This command is helpful if you run self-tests at periodic intervals. In this case, errors are found on the drive.

Once you know that a drive is good (no errors and all self-tests are passed), you can start to probe the drive a little further. Earlier, I used the -c option to list the reporting capabilities of the drive. You can also use the -a option (Listing 11) to list the vendor-specific SMART attributes. Although the output is rather long, it contains a great deal of information.