Re: Why are bad disk sectors numbered strangely, and what happens to them?

From: Rogier Wolff
Date: Tue Oct 14 2003 - 05:06:31 EST


On Tue, Oct 14, 2003 at 03:55:09AM -0500, Wes Janzen wrote:
> >And the real-time performance of the drive becomes unreliable.
> >Worst case, in a 1Mbyte block 1 million sectors are remapped,
> >requiring a seek of 10ms. While normally reading that block of
> >data would consume 1/40th of a second, you are now looking at
> >about 3 hours.

> Well, aren't we talking about hardware sectors? The hardware sectors
> are probably at least 1 MB in size to start with. My old 16GB Maxtor
> that had remapped its way out of sectors only had 16 to remap (the last
> unit I had fail due to this problem). I doubt the hardware sectors were
> anywhere near 1 byte in size. The bad sectors also seemed to occur at

OOops. Sorry. Too quick with the numbers. The remapping granularity is
1 sector (0.5kbytes), and there are 2000 of those in a megabyte.

So if the odd numbered ones end up remapped, you have 2000 seeks to
perform to read that 1Mb of data. That would come to 2000 * 10ms = 20
seconds. Not quite as bad as several hours, but still....

> an exponential rate, which is supported by the 5 drives I've seen go bad
> in this manner. Supposedly that has to do with debries spreading across
> the platter and taking out adjacent sectors. The one drive I didn't
> send back or replace immediately after the first error (i.e. no more
> sectors can be remapped) had lost nearly 50MB of space to bad sectors in
> a week, and 200MB by the time the replacement arrived 4 days later. I
> imagine that this only gets worse as more data is packed into a smaller
> space.

This supports my statement that if you notice sectors getting bad,
replace the disk as fast as you can, and hope that the sector
remapping bails you out until you get that chance.


> Is there even a way to disable sector remapping on an ATA drive anyway?
> To avoid these "disadvantages of hardware remapping" you'd need some way
> to ensure that the drive didn't remap any sectors. As someone noted,
> their drive remapped a sector without anything showing up in the log.

Some drives claim "AV compatibility" or something like that. I think
that this means that they will have their spare sectors on the same
cylinder. i.e. no seeking. (just on average 8ms delay).

> I start more closely watching any drive that remaps more than half its
> available sectors, if it gets close to the limit I replace it (if it's
> out of warranty, otherwise I help it along with some badblock runs).
> It's just not worth the hassle of losing data. At least if the drive
> detects the error, chances are it recovers the data and copies it to a
> good sector (at least I've never lost any data from a drive remapping).
> I can't say the same for the filesystem trying to recover the data,
> which usually seems to result in a corrupted file. IMHO, the data
> integrity of hardware remapping outweighs any performance disadvantage
> as compared to a filesystem-only based solution.
>
> Now if only the drive would catch the problem without requiring a write
> to the offending sector first. ;-) Maybe that's already fixed on the
> newer drives, none of my newer ones have remapped sectors yet.

The problem is that it would be nice if the disk could report: I just
read the data from block XXX for you, but I had a hard time getting it
for you. Recommend reassignment. The OS should then log this, and put
the file that this belongs to elsewhere. This gives the OS the
authority, and the sysop the ability to take appropriate action.

I don't mind a couple of remaps on my mp3 collection. But I rather
hate them on my root drive.

Roger.

--
** R.E.Wolff@xxxxxxxxxxxx ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
**** "Linux is like a wigwam - no windows, no gates, apache inside!" ****
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/