[Gllug] JFS and bad blocks

Peter Grandi pg_gllug at gllug.for.sabi.co.UK
Wed Oct 5 16:10:49 UTC 2005


>>> On Wed, 05 Oct 2005 12:09:39 +0200, "Martin A. Brooks"
>>> <martin at hinterlands.org> said:

[ ... bad blocks on JFS ... ]

martin> I may be misunderstanding but what do bad blocks have to
martin> do with a filesystem?

Ideally nothing... But!

martin> All modern hard disks remap bad sectors on the fly.

Yes, but  they use a fixed number of spare sectors, and such
spare sectors are often localized so local overflows of the
spare sector capacity are possible. Also, sector sparing in the
drive firmware can have dire performance implications.

martin> This is (allegedly) one reason why manufacturers quote
martin> hard disk capacity as 10^n rather than 2^n.  The
martin> overhead gives them unused sectors to remap to.

Nahhhh, that's a joke. There are two reasons for 10^n: one is
that hard drive engineers are proper engineers, and ''kilo'',
''mega'' and ''giga'' have well defined decimal meanings; the
other is that hard drive marketers are proper weasels, and they
love that ambiguity because it is defensible for the engineering
reason above. That's all.

martin> If a disk had a bad block that's exposed to the host
martin> then the filesystem is irrelevant - all filesystems
martin> using the partition containing the bad block will be
martin> affected.

No, there are indeed filesystems that do support ''bad sector
avoidance'', which is often rather better than having sectors
spared by the drive (see below).

martin> Perhaps you mean that you want to have the filesystem
martin> exclude writing to blocks that are known to be bad?

That is often useful indeed.

martin> If so then you either have an old disk that doesn't do
martin> on-the-fly remapping or your disk has run out of sectors
martin> to remap to.  In either case you should seriously
martin> consider simply replacing the hard disk - they are
martin> stupidly cheap these days.

martin> Or did I miss the point?

A bit... First, «stupidly cheap» is a relative term, and for
some people the ability to continue using a not-so-pristine
disc drive is an important point.

Then sectors spared by the firmware can often be ''far away''
from their original location, which can cause extra arm
movements that can impact performance a fair bit.

Just leaving bad sectors unused at the file system level avoids
that; this is one reason why it is usually possible to disable
firmware sparing of bad sectors.

Thirdly, it may be useful to be able to recover the contents of
a file system, and if to do so one reads file on an unspared
(for any of the reasons above) bad sector because the filesystem
insists on reading it, that becomes a bit more difficult (e.g.
image copy of the partition with 'dd conv=noerror,sync' and one
may not have the spare disc space to do that), and because of
retries on error, slow.

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list