When does an HDD replace bad sectors?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I understand that a modern HDD has many spare sectors which it automatically
substitues for bad sectors until it runs out of spares, and that a bad
sector showing up in the OS is a sign that the drive has aged too much to be

But when does the substitution take place? I expect that, for one, it
happens during a full format. Does it also happen quietly in the background
on the fly during normal use under an OS?

Re: When does an HDD replace bad sectors?

pimpom wrote:
Quoted text here. Click to load it

A write to the sector, sounds like an excellent time to handle
suspect sectors.

SMART has a couple statistics



A reallocated sector, is one that has been replaced. There are only
so many spares in a given locality to a bad sector, so eventually
a sector may not be repairable. For example, it wouldn't make
sense for sector 0, to be used as a replacement for sector 10000000.

The "Current_Pending", suggests that during a read attempt, a sector
got marked as being dodgy. The drive can't do anything about it,
until a write is attempted. On the write, the controller knows
what the new data is supposed to be, so it is in a better
situation to do a potential reallocation. The Current_Pending
value gets decremented by one, and maybe the Reallocated
gets incremented by one. If the sector tested as OK, it
might not get reallocated.

I tried looking for a description with more algorithmic details,
but couldn't find anything worth repeating.

You could look at PDF page 22 here. It is purposefully vague,
because being a spec handed to customers, they don't want to
commit to anything.

http://www.hitachigst.com/tech/techlib.nsf/techdocs/1AFE1C40F435EEB0862572F10049BAFD /$file/5K250_spec.pdf


Re: When does an HDD replace bad sectors?


Quoted text here. Click to load it

To fix errors in an HDD you need to run utilities like CHKDSK, short
for "Check Disk".

There are other softwares useful, like SpinRite. Anyway, you can't
save a physically broken HDD.

http://ManuelMarino.com (Arts, Music)
http://NewOnlineShopping.net (Clothing, Gifts)
http://TechGamesBlog.com (Technology, Games)

Re: When does an HDD replace bad sectors?

Quoted text here. Click to load it

That will check filesystem integrity and/or help to deal with bad
sectors in software.  However, most hard drives have the ability to
remap bad sectors, and will do so whenever there is a repeated write
failure on a given sector.

Site Timeline