3

If I have an HDD with some bad sectors and I format the disk (from Windows) or re-partition the disk, will bad sectors still be marked as bad?

4
  • 2
    bad sectors are handled by the firmware of the drive not the filesystem.
    – Ramhound
    Apr 29, 2015 at 15:18
  • 1
    The HDD, itself, manages bad sectors. Marked sectors will be preserved regardless of what you do with the drive (unless you explicitly reassess the sectors).
    – fixer1234
    Apr 29, 2015 at 15:27
  • 1
    Why downvote? If I know the answer I don't create a question. If I created a question, you should not downvote without posting a comment about why downvote it!!!
    – realtebo
    Apr 29, 2015 at 15:27
  • @realtebo - Alright; Here is your comment. This question was not well researched before asking it. There is not only a duplicate but the subject is well documented.
    – Ramhound
    Apr 29, 2015 at 16:03

2 Answers 2

3

A long time ago hard drives did not have spare sectors or advanced firmware that did much more than read/write the disk. This was around the time that hard drives were "full-height" (the height of 2 CD-ROMs) and came with a "defect table" sticker which identified bad sectors on the disk from the factory.

So filesystem support for identifying bad sectors was a necessity, and exists in FAT and NTFS (though by the time NTFS appeared with NT in 1993 I think these types of drives no longer existed or were on the way out).

If you have one of these ancient drives that information is killed when you redo partitions - you have to format and create the filesystem again, and scan again for bad sectors.

These days, spinning hard drives have advanced firmware and spare sectors, and can switch them out "on the fly" without the OS even knowing. Since the sector is not in line with others physically, it degrades performance. SMART data will report on this (Reallocated Sector Count). The OS will only receive a report of a bad sector from a hard drive if the drive is out of spare sectors, which means at this point you ought to replace it. (Hard drives likely are still manufactured with some existing surface defects that the firmware hides as well.)

The filesystem support for marking clusters as bad is still there in FAT and NTFS, but never used basically.

Anything you do to the filesystem does NOT affect the firmware. So a simple reformat, or redoing your partitions and reformatting, will not do anything with firmware-managed spare sectors.

1

They will be left alone since they have been marked as bad by the hard disk controller firmware.

There is software that will reset bad sectors (Spinrite for example) if it can. But the standard drive handling simply assumes that a problem seen once may indicate worse problems ahead - a not unreasonable assumption.

If you are seeing bad sectors appear on a drive, it is time to buy a new one, modern drives fail pretty regularly.

Spinrite is sometimes able to fix bad sectors because the way it works effectively recalibrates the drive heads against the physical track of data on the platters. Drive heads may drift slightly out of alignment over time which can cause disk read/write errors since the margins of error on modern drives are microscopic (literally!). So if the drive hasn't actually got a physical error, the "bad" sectors may be recoverable.

4
  • I think technically Spinrite doesn't itself reset the bad sectors, it just tries the read/write process a bunch of times, until its sucessful and by doing so the firmware rediscovers the sector. Of course it also is doing some low level ATA commands so it might also request the firmware to do that also.
    – Ramhound
    Apr 29, 2015 at 16:05
  • Thanks @Ramhound, you may well be right as I think it is the internal disk controller that actually sets/resets the bad sectors. Apr 29, 2015 at 16:12
  • The way the author suggests Spinrite works, is that it attempts to write and read the same data mutiple times to a sector, making sure the data it read is the same each time. Likewise if it finds data on a bad sector, it trys basically every combination, to fill in the missing spaces until the HDD indicates that the combination is correct. All the HDD knows is the data isn't correct.
    – Ramhound
    Apr 29, 2015 at 16:16
  • Yes, it is really quite clever in that it uses he tolerances of the mechanism by moving back and forward repeatedly, each move may result in the heads being in a slightly different place and so having a different chance at getting a usable signal. Those signals are then combined in order to try and get recognisable data. It can take weeks of trying to recover data but Spinrite will just keep going. Apr 29, 2015 at 16:21

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