I just noticed that an earlier post on this thread, references one of my old blog posts, so I thought I would add my feedback.
In the example above, counter '197 Current_Pending_Sector' is showing a count of 3. This is bad. I've seen this a few times now on various hard drives, and I suspect its due to the mains power failing while the drive is in the middle of a write.
The first thing to do is to run an long selftest with:
Code:
# smartctl -t long /dev/sda
The command will respond with an estimate of how long it thinks the test will take to complete.
(But this assumes that no errors will be found!)
To check progress use:
Code:
# smartctl -A /dev/sda | grep remaining
...but don't check too often, as with some drives, it can abort the test.
After the test completes examine the reported status with:
Code:
# smartctl -l selftest /dev/hda
You will see something like this:
Code:
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed: read failure 20% 1596 44724966
So take that 'LBA' of 44724966 and multiply by (512/4096) which is the equivalent of 'divide by 8'
Code:
44724966 / 8 = 5590620.75
Round this down to 5590620 and use as follows to 'zero-out' the sector:
Code:
# dd if=/dev/zero of=/dev/sda conv=sync bs=4096 count=1 seek=5590620
1+0 records in
1+0 records out
# sync
Now retry the selftest & see if the errors are now all cleared. If not, then repeat the above.
Of course, if that sector was in the middle of a file, this will corrupted the file. See my blog post "Smartmontools and fixing Unreadable Disk Sectors" for how to try to check for this.
Once the 'Current_Pending_Sector' are "fixed" the drive will probably be fine, in my experience. As long as 'Reallocated_Sector_Ct' is zero, you should be fine. Even a few reallocated sectors seems ok, but if that count starts to increment frequently, then that is a danger sign! But of course you need to regularly keep a close eye on the counters. Use 'smartd' to schedule daily tests.