• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How does bad sector reallocation work?

Thomas B

Junior Member
Hello,

I would like to know briefly how the process of reallocating bad sectors works.

Does an hard drive identify (and reallocate) bad sectors directly during write operations, or is a previous read operation required to determine that the sector is bad?

Does it happen like this:
Read operation > if the sector is bad it is marked as "pending" (in SMART) > the next time the pending sector is written, it gets reallocated.

I was curious to know what happens when data is written to unused space: if a sector is bad, should data get reallocated at once, or will the hard drive not recognize the bad sector, and thus the written data will be corrupt?

Thanks.
 
When it detects a bad sector on read, it will mark those as 'bad', and if it gets the command to write to those sectors, it will instead map them out.
Any unreadable data is lost, unless you take it to a pro, then, it is possible that they can get access to those sectors with different tools to salvage it.
It can also detect the bad sector on write, in that case, it should just map it on the fly, with no data loss.

If it is a head crash.. well... it will do more damage the longer it is run, and nothing you can do can save it.
 
I don't believe that it re-maps sectors on a fresh write, normally. I think it requires a failed read to be put into pending.

I did once have a Maxtor IDE HDD, that did a verify read after the first write to a particular sector. You could even see that in a HDTach graph.
 
Pretty sure it is possible to detect errors on writes.
What I don't recall is if this is only available on enterprise level drives, or if they are on consumer drives as well.
 
I don't think drives commonly verify writes - they are just assumed to succeed; possibly there is an option on SAN customised drives or enterprise drives, but that is outside of my experience.

Typically, a sector will be added to the "pending" list, when a read from that sector fails. It will stay on the pending list until it is written to, at which point it will be reallocated and the write will be redirected.

Drives with SMART functions frequently have the capability of performing background surface scans during idle time. On such drives, sectors may be added to the pending list, if the background scan is unable to read the sector.
 
The actual process does vary a bit depending on the brand and even model of HDD. Though a lot of dives typically don't verify writes, which is why you can clone another HDD to them and then discover bad sector after when you go to access the data.

(unfortunately happens here in the data recovery lab sometimes, nothing worse than having to recover data from a clone of recovered data)
 
Back
Top