21
3
On an NTFS-formatted hard drive with some bad sectors, does the hard drive still remember bad sectors after Windows's diskpart clean
is used to remove the NTFS volume? What about clean all
?
21
3
On an NTFS-formatted hard drive with some bad sectors, does the hard drive still remember bad sectors after Windows's diskpart clean
is used to remove the NTFS volume? What about clean all
?
31
NTFS remembers bad clusters. A cluster is considered bad if any sector in it is inaccessible. Since the cluster badness information is stored in a file ($BadClus
, specifically), that information will get blown away if the NTFS volume is removed. (clean
and clean all
are essentially the same in that regard. clean all
does a more thorough destruction of the disk's data, while clean
just wipes the partition table.) Further reading: NTFS System (Metadata) Files.
The hard drive is what remembers bad sectors. Exactly how it does that depends on the model of the drive, but most modern disks automatically detect and remap dead sectors so that the operating system doesn't even know there's a problem. In that case, nothing the OS does can affect the disk's internal bookkeeping.
As others (notably harsh's answer) mentioned, if the OS can see bad sectors, the disk may have run out of internal spare sectors. (Especially true if the failure is returned on a write.) Bad ThingsTM will probably happen soon if you do not replace it.
2The harddisk has spare sectors to use instead of those gone bad. (This can be investigated with S.M.A.R.T). If the drive starts reporting bad sectors back to the operating system, it means it has run out of spare sectors, and will likely soon go bad. It is then advisable to replace the disk with a new one. – Thorbjørn Ravn Andersen – 2016-04-03T00:01:10.893
1@ThorbjørnRavnAndersen No, that's not true. If a sector goes bad, and the OS tries to read it, the disk can do nothing but return an error—it can't replace it with a spare, because it has no way to know what data to put there. That'd lead to silent data corruption. If after writing to a sector it remains bad (the write itself fails, or reading it back does), then there is a problem. – derobert – 2016-04-06T18:15:27.960
@derobert Good info. I've adjusted my answer slightly. I'm sure the disk updates its own bad sectors table when a read fails, in addition to notifying the OS. – Ben N – 2016-04-06T18:18:03.133
20
If the OS is encountering bad sectors, the drive's internal bad block table is probably full (as Ben N pointed out) and it is time to retire the drive. Drives typically don't stop failing.
1If I could uptick this answer multiple times, I would. If the OS is showing bad sectors, it's time to retire the disk. Anything less is taking a huge risk with your data. – Rod Smith – 2016-04-02T19:55:41.087
3@RodSmith, not so much. AFAIK, Windows happily flags the cluster bad after a read failure without trying to re-write the sector. This is usually why they "go away" when you format; because that causes a write and that fixes the problem. – psusi – 2016-04-10T13:59:43.050
2
Out of the factory, the HDD is capable of re-mapping bad sectors to "spares" on inner cylinders. Your SMART diagnostics will record the count. This can be Googled easily enough. Needless to say there will be a seek delay even if your drive is "defragged". In the bad old days the HDD cam with the bad sectors named on a label affixed to the drive for listing in a low level format.
This remapping is abstracted from the OS, which will remember bad "clusters" and to answer your question, may have to re-learn bad clusters.
1Depends on the hard drive. I remember drives with a hand-written table of bad sectors, on the label, beneath the serial number! – Brian Drummond – 2016-04-03T12:27:22.037