How to make smartd shut up about one particular offline uncorrectable sector?

19

6

I have a disk in a two-disk software RAID-1 for which recently an "offline uncorrectable sector" appeared in the SMART status.

198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       1

This apparently is only a sign of imminent disk failure if it occurs increasingly frequently (and since the drive is mirrored, there is no great risk of real data loss either). At the time, a self test also failed at some point and smartd sent me an email to notify me of this as it of course should do.

However, writing to the damaged sector usually causes the disk to use one of its spare sectors instead which it apparently did because since I dded over the disk, all self-tests ran through just fine. And badblocks also found no reason to complain.

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

The number of faulty sectors didn't decrease though which it shouldn't, really, since the broken sector's still there, albeit unused. However, smartd continues to send me emails every night:

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

Device: /dev/sda [SAT], 1 Offline uncorrectable sectors

This is extremely annoying obviously and numbs my healthy panic reflex to smartd mails.

The disk is a Western Digital WD20EARS and the smartd version is 5.41 2011-06-09 r3365.

Christian

Posted 2013-01-10T01:08:03.967

Reputation: 310

Answers

24

On a some disks, you might have to resort to -U 198+ (or -U + ?) in the config file.

Please be careful. If you are not the original asker, read through the whole question carefully. If you use this on a disk which does not need it, it will suppress entirely valid warnings.

If ´+´ is specified, a report is only printed if the number of sec‐ tors has increased since the last check cycle. Some disks do not reset this attribute when a bad sector is reallocated. See also ´-v 198,increasing´ below.

smartd.conf (5)

For example, suppose you are using the default configuration in smartd.conf. In that case, there are many comments in the file, but the only non-comment line is here:

# 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

Add the option to the end of the line:

DEVICESCAN -U 198+

sourcejedi

Posted 2013-01-10T01:08:03.967

Reputation: 2 292

any examles for this? – JIV – 2019-07-19T06:03:24.120

1@JIV edited. I also added a warning. Please take all due care with your data :-). – sourcejedi – 2019-07-19T09:57:07.067

1-U 198+ should do it. Nice find! – Michael Hampton – 2013-01-20T17:14:05.530

0

there are two possibilities where these mails come from. smartd is able to send mails by itself, but it's most likely not configured this way so I assume that these mails are sent by logcheck. If this assumption is wrong you don't have to read any further.

logcheck scans log files and sends mails if it thinks that you should worry about anything that happened to/on your system.

You have the option to write a logcheck ignore rule which tells logcheck to not send messages that match a specific pattern.

You could (under Debian based systems) create a file called "/etc/logcheck/ignore.d.server/smartd_own" with the following content:

^\w{3} [ :0-9]{11} [._[:alnum:]-]+ smartd\[[0-9]+\]: Device: /dev/sda \[SAT\], 1 Offline uncorrectable sectors$

This should filter out the annoying mails but write you again if the uncorrectable sectors counter increases.

hennr

Posted 2013-01-10T01:08:03.967

Reputation: 334

smartd sends the messages directly, unfortunately. It's apparently always an option to change this though. I'll consider this if there should be no other way, so thanks! – Christian – 2013-01-17T09:28:19.010

Oh darn, anyway you have a workaround now. – hennr – 2013-01-17T09:37:36.983