1

I have a drive which has signaled a SMART error (Current_Pending_Sector is 1) and I've run a "long offline test" against the drive which reported zero errors.

This was after running a "short offline test", identifying an unreadable sector, forcing its relocation and re-building a software RAID device with this drive as one of the members. I'm fairly sure the drive is clean at this point.

Is there a way I can clear-out that 1 value for Current_Pending_Sector? The manual page for smartctl doesn't seem to mention how to change attribute values. Is this possible, or is SMART essentially read-only?

Christopher Schultz
  • 1,056
  • 1
  • 11
  • 20

3 Answers3

2

SMART is essentially read-only.

You would change the value by fixing the underlying issue and allowing the drive to self-resolve it (if it can!)

From a similar question, "How should I understand 'Current Pending Sector Count'

Later, when some of these sectors are read successfully, the value is decreased.

Note the two things that need to happen:

  1. The sector must be read
  2. The read must succeed

If the hard drive sector has sustained permanent damage that number will never drop back to zero. I like to replace hard drives when that happens and let the redundancy from their RAID array or mirroring setup resolve that issue.

Steve Bonds
  • 874
  • 2
  • 10
  • 19
  • 1
    I've run two "long tests" with no errors (at least, the test-log says "no errors") and yet the sector still counts as "pending". Any suggestions for how to perform a more thorough test to either get the test to fail (and reveal the identity of the sector) or have it pass in such a way that the "pending" count is cleared? – Christopher Schultz Dec 06 '18 at 19:54
  • It may require an external read attempt from the operating system rather than an internal read from a self-test in order to trigger the ECC attempt. Try using an old school disk media test that reads every sector. Chances are that the read will pause/hang at some point and that will be the bad sector. – Steve Bonds Dec 07 '18 at 18:58
  • 1
    Good suggestion. I can just `dd` the whole disk to `/dev/null` without too much trouble. – Christopher Schultz Dec 07 '18 at 23:01
  • "dd" may just silently hang, so either use "kill -USR1" (on Linux) or an appropriate platform-specific substitute to watch the progress. – Steve Bonds Dec 08 '18 at 14:09
  • 1
    Soo... I `dd`'d the whole disk with `conv=noerror` and I got no errors. I'm running another "long SMART test" to see if I can trip the sector. At this point, I think replacing the drive will be a better plan than trying to get this error cleared. This server was built in 2013, so this disk doesn't owe me anything. – Christopher Schultz Dec 10 '18 at 15:13
  • 1
    The "long test" completed without error, and the SMART stats still show a "Current Pending Sector" count of 1. Without re-writing the entire drive, I don't think I'll be able to clear this error at this point. – Christopher Schultz Dec 10 '18 at 18:02
  • Keep in mind the "conv=noerror" tells dd to keep going after a read error, so you could have a permanent read error in that location which would not have been shown by your test. Whether you get to see the dd process hang or not, the end result is the same: replace the drive. :-) – Steve Bonds Dec 11 '18 at 16:46
  • 1
    I intentionally used `conv=noerror` so that `dd` would hit the whole drive. I assumed that if `dd` encountered an error, (a) the drive would notice the error (because it returned an error to the OS/`dd`) and (b) `dd` would continue and scan the whole drive, making sure to hit more than one potentially bad sector. – Christopher Schultz Dec 12 '18 at 03:18
1

The accepted answer is incorrect - pending sector count will drop to 0 once the pending sector is resolved, and resolution is guaranteed to happen eventually. (It is called 'pending' for a reason!) This can happen either via a subsequent successful read (unlikely), or when the sector is written to. When it is written to, either the write will succeed, or it will fail harmlessly and the sector will be reallocated. In any case, it will no longer be a pending sector.

To accelerate this process, you can manually overwrite the sector. The safest way to do so is to identify the file containing the bad sector (filesystem dependent process), and then overwrite the file (non-CoW filesystem) or zerofill all free space (CoW filesystem). If you are feeling particularly brave or don't care about the filesystem, you can overwrite the sector directly with hdparm. There is a good explanation of how to do so here: How to use hdparm to fix a pending sector?

Dark
  • 232
  • 1
  • 10
1

SMART values are read-only, unless you have the access to the tools specific for the vendor your particular drive.

Also take a look at this question answer.

drookie
  • 8,051
  • 1
  • 17
  • 27