2

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?

3 Answers 3

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.

8
  • 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? Commented Dec 6, 2018 at 19:54
  • 1
    Good suggestion. I can just dd the whole disk to /dev/null without too much trouble. Commented Dec 7, 2018 at 23:01
  • 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. Commented Dec 10, 2018 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. Commented Dec 10, 2018 at 18:02
  • 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. Commented Dec 12, 2018 at 3:18
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.

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?

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.