Hacker News new | ask | show | jobs
by fignews 701 days ago
How do you generally know when the long test is over? Is there a way to get a notification of completion? Is it ok to begin using the drives while testing? I personally run my new drives through a few rounds of badblocks
2 comments

You start a long test with something like:

  smartctl --smart=on --device=sat /dev/***
  smartctl --test=long --device=sat /dev/***
(--device=sat is for the normal SATA or USB devices of Linux, such as "/dev/sda", which use SCSI commands; --device=nvme would be for NVME SSDs; other cases are described in the man page)

Then you can read from time to time the test log:

  smartctl --log=xselftest --device=sat /dev/***
When the test has finished, a line announcing that will appear in the log, saying that the test has passed or failed. If there are errors, they will appear in the log while the test progresses.

In theory you can make a script that runs periodically smartctl, e.g. once every 5 minutes, and which parses the smartctl output and signals the end of a test.

However, because I run such tests only seldom, when buying a new disk, I did not write such a script.

You can use the HDD during the test, unless the test had been started with:

  smartctl --captive --test=long --device=sat /dev/*** 
In the case of a "captive" test, attempting to use the drive for another purpose will abort the test.

While you can use the drive during a test, that will increase the duration of the test.

Thank you
You can use GSmartControl to run SMART self-tests and track their progress. It shows a progress bar for the current test.

Screenshot: https://gsmartcontrol.shaduri.dev/screenshots#a-test-in-prog....

That just displays in a nicer form the same logs that can be read with smartctl.

The progress displayed is somewhat illusory, because the estimated time until finish that is provided by the HDDs is unreliable. It is frequently wrong for the long test by even 20% to 50%, which means a difference of several hours.