0

Since a sector is composed of some (512 or 4096) byets, it looks natural to consider the term 'bad bit' rather than 'bad sector'. But the term is not used. There are plenty of HDD error checking software that reports a sector 'bad sector', but no software that reports a bit 'bad bit'. Why is it so ?

1
  • Just because you know the data in a sector is incorrect doesn’t mean you know where it is incorrect.
    – Daniel B
    Commented Jun 10, 2020 at 9:37

2 Answers 2

4

Disks - be it HDDs or SSDs - can't manipulate single bits or even bytes. A sector is the smallest storage unit a disk can work with. You can only write a single bit by reading entire sector, changing that bit and writing entire sector back. Writing an entire sector, on the other hand, requires no additional reads, so it makes sense to avoid working with units smaller than bits if possible. Thus persistent storage is entirely built around the concept of sectors. All partition and filesystem structures are sector-aligned to avoid the need for inefficient partial writes.

Now let's say you've detected a single failing bit in a single sector and you have the technology to disable it. Your entire computer is built to work with 8-bit bytes only, so entire byte is unusable. Your sector is now 511 bytes large instead of the typical 512 bytes. Once again everything in your computer assumes you're able to fit 512 bytes in a sector, and you can't, so entire sector is unusable. Hence bad sector.

In addition, tracking health of single bits would be absolutely impractical. Information about health of a single sector takes up one bit of space (0 = bad, 1 = good). A single 512b sector contains 4096 bits, so it can store health of 4096 sectors, so 1 in every 4097 sectors is sacrificed for health bitmap. That's 0,024%, completely acceptable. If you were to track health of single bits (which isn't useful anyway as I've already explained), you'd need one bit for health of every single bit, so 50% of storage is sacrificed for health information.

In real life applications bad sectors probably wouldn't be stored as a bitmap, but it's easy to explain the issue with them and it gives you the sense of scale.

2

The sector is the minimum unit that disk read/write commands work with.

Disks don't actually allow the computer to request individual bits (nor bytes – a sector is usually 512 or 4096 bytes, not bits). Instead, the OS always issues "Read entire sector" commands, and they don't include any indication about which parts of the sector are damaged – either the disk returns the entire sector (recovered using ECC if necessary) or it returns nothing at all (too many errors for ECC to cope with).

I'm not sure I understand the mechanism correctly, but as far as I know: When there's just a single bad bit you won't even notice it because the ECC information will be used to correct it. But if the sector is corrupted beyond that point, then usually ECC doesn't even know which specific bits are bad – it only knows that 'more than X' of them are bad.

You must log in to answer this question.

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