• Please review our updated Terms and Rules here

Unmarking clusters maked "bad"

smeezekitty

Experienced Member
Joined
Jan 15, 2010
Messages
460
Location
Washington U.S.
A while back I accidentally ran scandisk with the C/H/S misconfigured. It ended up marking quite a few sectors bad.

I think that most of these sectors are not bad at all and it comprises nearly 2.5 MB of space.

Is there a utility or unmark or rescan these sectors?
 
What you call a bad block table is actually called a FAT. If you know what you are doing you can edit the FAT with a hex editor.
 
I'm guessing that is a SCSI drive, but you should still be able to run Spinrite on it. That will test and clear clusters that aren't bad.
 
Removing the partitions with FDISK and then reformatting is the best way of removing any incorrectly marked sectors and getting rid of any other mistakes that having the wrong C/H/S values might cause. Just because some clusters are actually good does not mean all are and the drive should be retested.

Spinrite is marketed towards fixing these problems. Or if you really look, there were a few tools that adjusted the FAT by replacing the 0xFFF7* value that marks a bad cluster with the 0 for unallocated cluster. Simple process to write code that does this. Note forcing the usage of a bad sector will cause data loss.

* That would be the value on FAT-16. FAT-12 or FAT-32 would have different values which are 1 below the lowest end of chain value. Not using FAT; you can do the same but I don't know what other special values are used to label bad sectors.

I don't know if Quantum LPS Prodrives had automatic sector reallocation. Changing the FAT won't clear out any previous reallocation. Some drives had reset commands that would clear the information but that is the sort of task that requires detailed correct documentation. Get it wrong and the disk will no longer work at all.
 
A good disk editor should allow you to change the FAT clusters marked bad (usually something like FFF6h) to 0000. Since you have two FATs, just copy your edited FAT to the other one and you're done.
 
Yes it is an IDE drive. Changing FAT contents directly makes me kind of nervous. I don't really understand the FAT layout that well.

How do I even find the offsets?
 
I wouldn't try manually editing the FAT. Yes, you can do it but about 1% of the clusters were marked bad which means you would have to make about 600 changes.

Look for diskedit type tools if you want to make the attempt. The better ones will keep the FAT table in order so you don't accidently split your change between 2 entries which might to loss of other data.
 
Well, my guess is that if it was a messed-up geometry, you have whole blocks of bad cluster words all together. Easy enough to clear a whole FAT sector to 0000.

If it were me, I'd just do it with DEBUG and a small hand-written program. But that's me.

But doesn't Spinrite have an option to scan a disk and release clusters marked bad? Seems to me that I've seen it in one disk utility or another.
 
The contents of the drive are still intact then? If you have a spare drive it'd probably be easiest just to copy the data off, repartition and reformat the drive that got messed up by the bad settings then copy the data back. Especially if it's IDE it should be a pretty simple and cheap procedure.
 
Back
Top