Keep SMART tests from failing from idle timeout

!
Warning: This post is over 365 days old. The information may be out of date.

If you have a hard drive with a large capacity, extended SMART tests will take a long time to complete. If the operating system parks the head of the hard drive because of inactivity, then the SMART test will get interrupted.

If the SMART test is interrupted, smartctl will often report that the test is still running, preventing you from running another test. However, smartctl -a will not show that the test is running.

To get out of this borked state, you can issue a smartctl -X, followed by another smartctl -t long (with the drive mapping, of course) to run an extended SMART test.

And this time, to prevent the SMART test from being interrupted by the idle timeout, run a separate terminal instance (through something like screen or tmux) and issue the following command:

watch -n 10 smartctl -a /dev/sda

Remember to replace /dev/sda with your drive mapping!

This should poll the hard drive every ten seconds and keep it from going into an idle state.

Thanks to u/SI100km’s comment for the watch command.

comments