大网数据广告活动
服务器运维问答

Tests with smartctl vs smartd

· 52CE 我爱测

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 a…

问题原文

原帖链接 · Nuno · CC BY-SA 4.0

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?

已采纳解答

原帖链接 · shodanshok · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-12-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。