Linux – How to Change a SMART Attribute Value

linuxsmartsmartctl

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?

Best Answer

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.