Ren*_*nan 11 external-hdd smart smartctl
我有一个外部硬盘驱动器,它没有正确报告 SMART 信息(它给出了无意义的结果)。
因此,smartd
守护程序( 的一部分smartmontools
)不断发出有关设备可能出现故障的错误警报。
在/etc/smartmontools/smartd.conf
(我在这里使用默认值)中,我看到了一堆选项,但没有一个与我的需要相关(忽略特定硬盘驱动器的警报 - 我希望能够通过 USB ID 等引用它,因为/dev
如果我连接了更多设备,则输入会有所不同)。
我可以编辑/usr/libexec/smartmontools/smartdnotify
(smartd
事件发生时调用的脚本)并手动强制它关闭该特定设备,但我想知道是否有一种不那么丑陋的方法来做到这一点。
如何smartd
不报告特定硬盘的任何警告?我不喜欢禁用该守护程序; 我希望它不关心这个特定的硬盘。
The*_*nix 10
-d ignore
是一个新指令,它允许忽略来自 DEVICESCAN 的设备。
~$ cat /etc/smartd.conf
#/dev/disk/by-id/scsi-SATA_KingSpec_KDM-44VVS14413121 -d ignore
# frustratingly specifying disk by-id doesn't work so fall-back to ignoring sdb
/dev/sdb -d ignore
DEVICESCAN -a -o on -S on -n standby,q -s (S/../.././02|L/../../6/03) -W 4,40,45 -m root
Run Code Online (Sandbox Code Playgroud)
您需要注释掉该DEVICESCAN
行,并为各个设备添加行。例如,我的看起来像这样:
/dev/sda -d removable -n standby,8 -S on -o on -a \
-m root -M exec /usr/share/smartmontools/smartd-runner \
-r 194 -R 5 -R 183 -R 187 -s L/../../6/01
/dev/sdb -d removable -n standby,8 -S on -o on -a \
-m root -M exec /usr/share/smartmontools/smartd-runner \
-r 194 -R 5 -R 183 -R 187 -s L/../../6/06
/dev/sdc -d removable -n standby,8 -S on -o on -a \
-m root -M exec /usr/share/smartmontools/smartd-runner \
-r 194 -R 5 -R 183 -R 187 -s L/../../7/01
/dev/sdd -d removable -n standby,8 -S on -o on -a \
-m root -M exec /usr/share/smartmontools/smartd-runner \
-r 194 -R 5 -R 183 -R 187 -s L/../../7/06
/dev/sde -d removable -n standby,8 -S on -o on -a \
-m root -M exec /usr/share/smartmontools/smartd-runner \
-r 194 -R 5 -R 183 -R 187 -s L/../../6/01
Run Code Online (Sandbox Code Playgroud)
您可以以任何方便的方式引用单个设备;例如,代替/dev/sda
I can use /dev/disk/by-id/wwn-0x5000c5001fc90b93
,无论它如何连接,它都会跟踪同一个磁盘。