[smartmontools-support] disk not reallocating bad sectors

Bruce Allen bruce.allen at aei.mpg.de
Tue Oct 26 12:24:31 CEST 2021

Hi Jürgen,

> I follwed the "BadBlockHowto" and found out that there are 8 sectors not readable, starting
> with the one mentioned above. For this I used the command
> # hdparm --read-sector 16087592 /dev/sda
> with blocks 16087591 - 16087600. Sectors 16087592 - 16087599 gave a read error, while
> 16087591 and 16087600 could read.
> Using debugfs I found out that these sectors are not in use, which is good news.
> Therefore I unmounted the device and used the following command to overwrite
> sectors 16087592 till 16087599:
> # hdparm --write-sector 16087592 --yes-i-know-what-i-am-doing /dev/sda
> After that I was able to read them agein (as expected filled with zeros) and
> in smartctl Current_Pending_Sectors went to zero. This was exactly what
> I wanted to achieve.
> However, next day I again got message for exactly the same pending sector. I did
> the hole procedure again with exactly the same result. At first it looked good
> but on the next day the error is there again.
> Seems to me that the drive does not reallocate. Instead it makes a new try to
> override and thinks the sector is healed now.

It looks like you are doing all of the correct steps.  My first 
suspicion would be that hdparm is not actually issuing the write 
command, meaning that somehow the OS intercepts the command and "caches" 
it.  But since Current_Pending_Sectors went to zero, that can't be the 
case.  So the disk is trying to reuse the sector instead of forcing a 

As far as I know the ATA standard does not include a command that will 
force sector reallocation.   The only thing I can think of is to write 
to Western Digital, or perhaps to try one of their "SMART drive health" 
programs.  Alternatively, use the "write long" command to write 
inconsistent checksum data to those sectors (ie, keep on corrupting 
those sectors) until eventually the disk steps trying to reuse them.

How frustrating!


Prof. Dr. Bruce Allen, Director
Max Planck Institute for Gravitational Physics (Albert Einstein Institute)
Callinstrasse 38
D-30167 Hannover,  Germany
Tel +49-511-762-17145
Fax +49-511-762-17182
Email: bruce.allen at aei.mpg.de

More information about the Smartmontools-support mailing list