SMART Devices

Listing 7: Short 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  Short offline       Completed without error       00%     12441         -
# 2  Short offline       Completed without error       00%     12441         -

In this case, the output reports Completed without error. Also notice from the additional entry in the output that the test has been run previously.

Listings 8 and 9 show running the long, or extended, offline test and viewing its output. Remember, the command just kicks off the test; the long test might take several minutes to complete. To check whether the test has completed, use the same -l selftest option as before.

Listing 8: Long Self-Test

# smartctl -t long /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 OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 30 minutes for test to complete.
Test will complete after Sun Aug  9 09:50:56 2020 EDT
Use smartctl -X to abort test.