如何让 smartd 关闭某个特定的离线不可纠正扇区?

Chr*_*ian 21 hard-drive smart hardware-failure bad-blocks

我在两盘软件 RAID-1 中有一个磁盘,最近在 SMART 状态下出现了“离线不可纠正扇区”。

198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       1
Run Code Online (Sandbox Code Playgroud)

如果它越来越频繁地发生,这显然只是磁盘即将发生故障的迹象(并且由于驱动器是镜像的,因此实际数据丢失的风险也不大)。当时,自检在某些时候也失败了,并向smartd我发送了一封电子邮件以通知我这当然应该这样做。

但是,写入损坏的扇区通常会导致磁盘使用其备用扇区之一,而这显然是因为自从我检查dd了磁盘后,所有自检都运行得很好。而且badblocks还发现没有理由抱怨。

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
[...]
# 5  Extended offline    Completed without error       00%      5559         -
# 6  Short offline       Completed without error       00%      5540         -
# 7  Short offline       Completed: read failure       90%      5524         63273368
Run Code Online (Sandbox Code Playgroud)

故障扇区的数量并没有减少,但实际上不应该减少,因为损坏的扇区仍然存在,尽管未使用。然而,smartd每天晚上继续给我发电子邮件:

The following warning/error was logged by the smartd daemon:

Device: /dev/sda [SAT], 1 Offline uncorrectable sectors
Run Code Online (Sandbox Code Playgroud)

这显然非常烦人,并且麻木了我对smartd邮件的健康恐慌反射。

盘是西部数据WD20EARS,smartd版本是5.41 2011-06-09 r3365。

sou*_*edi 26

在某些磁盘上,您可能不得不求助于-U 198+(或-U +?)在配置文件中。

请小心。如果您不是最初的提问者,请仔细阅读整个问题。如果您在不需要它的磁盘上使用它,它将抑制完全有效的警告。

如果指定了“+”,则仅在秒数?自上次检查周期以来,tors 已增加。重新分配坏扇区时,某些磁盘不会重置此属性。另请参阅下面的“-v 198,increasing”。

smartd.conf (5)

例如,假设您在smartd.conf. 在这种情况下,文件中有很多注释,但唯一的非注释行在这里:

# The word DEVICESCAN will cause any remaining lines in this
# configuration file to be ignored: it tells smartd to scan for all
# ATA and SCSI devices.  DEVICESCAN may be followed by any of the
# Directives listed below, which will be applied to all devices that
# are found.  Most users should comment out DEVICESCAN and explicitly
# list the devices that they wish to monitor.
DEVICESCAN
Run Code Online (Sandbox Code Playgroud)

将选项添加到行尾:

DEVICESCAN -U 198+
Run Code Online (Sandbox Code Playgroud)