Re: how to control how often smartd-runner fires.

mathog <[email protected]> Thu, 19 Jan 2017 09:51:40 -0800
Newsgroups gmane.linux.utilities.smartmontools
Message-ID <[email protected]>
On 18-Jan-2017 18:43, Nathan Stratton Treadway wrote:
> On Wed, Jan 18, 2017 at 15:27:36 -0800, Ray Andrews wrote:
>> On 18/01/17 02:00 PM, Carlos E. R. wrote:
>> >On 2017-01-18 18:22, Ray Andrews wrote:
>> >>  Also, I get the same message over and over again about my 77 pending
>> >>sectors, but it's been 77 pending sectors for years, and I'd really
>> >>rather not seeany further notifications about it untilsomethingelse goes
>> >>wrong.
>> >Maybe you should try to "repair" them.
>> How?  I've presumed that bad sectors are bad sectors forever.
> 
> It hasn't been updated in a while, but you may find some useful
> discussion at:
> 
>   https://www.smartmontools.org/browser/trunk/www/badblockhowto.xml

For some disks the only way to clear these is to use "badblocks" in the 
nondestructive read then write mode.  One must boot the machine with a 
rescue CD, USB drive, or over the network, because the disk in question 
cannot be in use at the time.  This will not tell you where those blocks 
are (unless an error occurs, which it probably will not) but it will 
clear the pending sectors count.

It is dumb, dumb, dumb that one must scan an entire disk to do this when 
the disk already knows exactly where those blocks are - it just will not 
divulge the information!  The result is that it takes a very long time 
and is very inconvenient to fix this issue when it should take about 100 
milliseconds and be straightforward.

If the disk in question is part of a RAID set, well, good luck.  I have 
not had to deal with that yet, but suspect the easiest path might in 
that case be to remove the disk from the machine and plug it into a 
nonRAID machine for the repair.  smartctl can talk "through" a RAID 
controller to operate on the disks behind it, as with:

    /usr/sbin/smartctl -t long /dev/sda -d sat+megaraid,5

but I don't think that badblocks has that ability.  Nor does smartctl 
have a nondestructive read then write mode.  Somebody please correct me 
if I'm wrong on that point. On the other hand, if you see pending 
sectors on a RAID disk, you're probably going to want to replace it 
right away in any case.

Regards,

David Mathog
[email protected]
Manager, Sequence Analysis Facility, Biology Division, Caltech

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot