0

My 8TB Western Digital HDD is showing errors in SMART id 197: Current Pending Sector Count. (Value=416, normalized=100). How can I reduce this?

(The SMART fields are readable in e.g. Ubuntu live CDs as well as openmediavault's web UI)

edit: After searching SE and finding nothing, my 5th Google led here, which could be useful: How to force a remap of sectors reported in S.M.A.R.T C5 (Current Pending Sector Count)?

1
  • 3
    Pending sectors are sectors that have been flagged as producing an error but have not been fixed, so pending sectors become reallocated sectors (or uncorrectable sectors) when you run chkdsk /f /r in windows or fsck/e2fsck in linux. after running them the pending sector count should drop to zero, and (hopefully) the reallocated sector count will go up. Note however that if your reallocated sector count is more than a few, and grows at more than a trickle, you should probably stop trusting the disk. Bad sectors tend to grow exponentially to time, and are a critical indicator of disk health. Commented May 23 at 5:38

2 Answers 2

2

Easiest is to use a tool was designed for this purpose, for example Victoria for Windows:

enter image description here

Note that you should consider replacing the drive in case of a significant amount of pending / reallocated sectors. I personally advise doing so even before the normalized SMART thresholds are reached. At a minimum you want to run a regular surface scan and keep a close eye on relevant SMART attributes.

1
  • 1
    This actually worked. Test and repair, scan, remap, then press scan again. Make sure the log at the bottom shows FULL and w. REMAP. The first pass went from around 400 pending sectors to 10. I ran a second full pass and now it's at 0. The linux based e2fsck tools and the like never worked for some reason. Your warning about the drive failing still applies. Commented Jun 16 at 21:54
1

As reported by other sources, the drive needs to try to write to that area of the disk.

NB: This could be a warning sign of a drive failure (it's classified by Ubuntu and others as "old-age" and not "pre-fail", however).

0. Backup and remove important files from the disk

I'm using this in a NAS drive as part of my primary backup strategy, so I wanted to be absolutely sure that this drive is reliable. I backed up needed files and emptied out the drive for further testing (in case it failed the tests and files became unrecoverable).

0.5. Document SMART errors

You're fixing SMART errors, so take a photo etc. of what the SMART status is. In my case, I have errors in 0x197 and 0x198. My goal is to see 0x197 go down (to zero?) by writing every byte of the disk, thus triggering the drive to mark each sector as good or bad.

1. fsck

I used ubuntu live 24.04. I started the gui Disks app to determine the /dev/sdX/ location of the drive.

sudo fsck -yfv /dev/sdX1

y: for some filesystem-specific checkers, the -y option will cause the fs-specific fsck to always attempt to fix any detected filesystem corruption automatically. Sometimes an expert may be able to do better driving the fsck manually. Note that not all filesystem-specific checkers implement this option. In particular fsck.minix(8) and fsck.cramfs(8) do not support the -y option as of this writing.

f: Force checking even if the file system seems clean.

v: Verbose mode.

I got:

Inode 18 extent tree (at level 2) could be narrower. Optimize? yes [from -y]
[snip]
/lost+found not found. Create? yes

2. Write empty files to disk

Mount the drive (I used Ubuntu Disks).

# cding to the path makes the dd command simpler
cd /path/to/drive
dd if=/dev/zero bs=8M count=$((1*1024*1024)) | dd of=emptyfile.bin bs=8M

dd = copy a file
dev/zero = empty bytes
bs = block size (allegedly fastest, per SE; but this is drive and phase of moon specific, feel free to do your own tests)
count = 1 TB
of = filename
bs = block size

I monitored that the transfer was working through System Monitor and listening to HDD sounds of the computer. You could probably use iotop on the terminal. I got 80+ MBps which is only a bit below the 100-150 I might see on a good day. It's fast enough for me to not try to fix it.

3. Confirm SMART fix

This is theoretical for me so far. After filling the disk (7.9 TB total, 7.5 TB used, 0 bytes free) I see the same results.

At some point, I got 0x05 Reallocated Sector Count up to 1 from 0. Ubuntu Disks shows 417 bad sectors but the pending sector count is 416.

I've tried a SMART self test (quick) but haven't noticed any changes.

Notes

I originally filled 7 of the 8 terabytes without fsck. But I kept getting no space left on device. Fsck allowed me to continue. This drive was pulled from an OpenMediaVault 5.x install and it's possible that the extant tree error started there.

https://serverfault.com/questions/786648/when-is-fsck-dangerous

Difference between S.M.A.R.T. error 0x05 (Reallocated sector) and 0xC6 (Uncorrectable sector)

https://superuser.com/a/882216

2
  • 1
    Your use of "empty" is bizarre. Zero may represent a null value, but that value is significant and has similar storage requirements as other values. Your procedure of writing an "empty file" does not achieve your stated goal of "writing every byte of the disk". You would only consume/write the remaining free space of the filesystem.
    – sawdust
    Commented May 23 at 7:51
  • The drive does not mark blocks good or bad. The blocks or sectors are in LBA space or not. A bad sector is swapped for a spare sector, IOW the bad sector is removed from LBA space, the spare sector is 'moved' to LBA space. Marking of sectors happens at file system level, there's nothing more we can do at file system level. Commented Jun 4 at 15:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .