2

I am looking into setting up smartmontools.

I'd like to control when the tests run. I was thinking of running:

/usr/sbin/smartctl --test=short /dev/sdX (every week)
/usr/sbin/smartctl --test=long /dev/sdX (every month)

And send an email/alert if an error is found.

1) Am I right to say that if I have the above set up in a cron, I don't need to have "smartd" daemon running in background?

2) Is there any advantage in enabling Offline Data Collection, if I run the tests above and have "smartd" disabled?

3) And the last thing that's been bugging me is that I see in the documentation that the commands for enabling/disabling --smart, --offlineauto and --saveauto are listed as Obsolete in ATA specifications. Does this mean that all these features are obsolete/useless on ATA devices?

Nuno
  • 553
  • 2
  • 8
  • 26

1 Answers1

3

As smartd works quite well, I would not rely on custom scripts. But let reply to each question:

  • Q: Am I right to say that if I have the above set up in a cron, I don't need to have "smartd" daemon running in background? R: While technically correct, you have to discover the presence of an error: smartctl, by itself, immediately return with exit code 0. You then had to parse the output of smartctl --all and examine the exit status of the previos test run;

  • Q: Is there any advantage in enabling Offline Data Collection, if I run the tests above and have "smartd" disabled? R: Probably not. However, Offline Data Collection by itself will not cause any (noticeable) performance hit.

  • Q: And the last thing that's been bugging me is that I see in the documentation that the commands for enabling/disabling --smart, --offlineauto and --saveauto are listed as Obsolete in ATA specifications. Does this mean that all these features are obsolete/useless on ATA devices? R: while marked as "obsolete", each single HDD I have supports them. That said, each disk seems to implement them in a different (and inconsitent) manner, especially regarding SMART attributes update.

shodanshok
  • 47,711
  • 7
  • 111
  • 180
  • Thank you very much for your advice. Regarding Offline Data Collection, I was based on documentation saying "This type of test can, in principle, degrade the device performance.". – Nuno Dec 15 '18 at 14:56
  • *In principle* this is true, but any modern disk runs offline tests with no noticeable performance impact (at least in my experience). – shodanshok Dec 15 '18 at 15:48