Subject: Re: Build breaks, 19980120, generating LintSysNormal.c for libc
To: None <mason@acheron.middleboro.ma.us>
From: Ian Dall <Ian.Dall@dsto.defence.gov.au>
List: current-users
Date: 01/21/1999 10:47:52
Mason Loring Bliss <mason@acheron.middleboro.ma.us> writes:

  > On Wed, Jan 20, 1999 at 01:06:43PM -0600, Frederick Bruckman wrote:
  >> A failing hard drive tends to truncate files like that. At least it
  >> indicates the bad blocks are being replaced. Perhaps it's time to do a
  >> low-level format?

  > Hm... It's a brand new Maxtor drive, and I've seen no other problems with it
  > as yet. It's also my boot disk, and it would be difficult to low-level format
  > it and get everything back to where it is now...

  > Is there any way I can check out its health non-destructively? It rarely
  > sees problems while running fsck...

Fsck only checks the meta data. I have had bad blocks on filesystems which
pass fsck.

If we are talking about a scsi disk, there is always sdd (scsi disk doctor)
which is suffering from lack of tender loving care, but still seems to work.
I should make it into a package, hmmm.

You can do things like:

 a) scan disk with verify command (this just checks it is all readable and
    the crc is correct), This doesn't really find anything a "dd if=/dev/rxxx
    of=/dev/null" wouldn't, but it does give more information.

 b) read a chunk, write a pattern, read the pattern and re-write the
    original.  This is living dangerously, but you should be able to
    do it in single user mode with the disk mounted readonly.

 c) remap bad blocks automtically on the basis of the scan or explicitly

I don't know of any disks which remap automatically. As far as I know
they all rely on the user (or the users software) doing the
remapping. I don't think NetBSD automatically does any remapping
either. Mach did, but I wouldn't recommend adopting that feature. At
least once it caused me a lot of problems. The disk came up in a funny
mode where everything caused a read error. Power cycling fixed the
problem, but by then crucial bits of the file system had been remapped
and there was no way to revert to the last good mapping state!

Also, my experience is that disks mostly don't need much remapping
until they get near the end of their life, when they relatively
suddenly need so many blocks remapped as to exceed the spares
available. A low level format will often give a few more months use on
such a disk, but it is still on the way to disk heaven.

Ian