Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 1996 09:06:47 -0500 (EST)
From:      Peter Dufault <dufault@hda.hda.com>
To:        joerg_wunsch@uriah.heep.sax.de
Cc:        freebsd-scsi@FreeBSD.org, petzi@zit.th-darmstadt.de
Subject:   Re: SCSI harddisk trouble: MEDIUM ERROR
Message-ID:  <199610281406.JAA01122@hda.hda.com>
In-Reply-To: <199610270844.JAA25043@uriah.heep.sax.de> from J Wunsch at "Oct 27, 96 09:44:12 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Joerg says to Michael Beckmann:

> > Is there a way to run a disk check under FreeBSD, which
> > finds (and reassigns) bad blocks ?
> 
> People have been asking for such a tool, but it's a little of work to
> do it that nobody did yet...
> 
> > Is there a good way to reassign blocks
> > automatically, and avoid the problems that follow these medium errors ?
> 
> ARRE :)  Too bad it doesn't work for you.

This comes up frequently: When the disk can't read the data it can
not reassign the block.

First try reading the block many times using dd to see if it can
read it.  It won't: The disk has already tried many times and the
driver issued retries as well, so it has already probably done
hundreds of retries.

If you have recent backups fill the partition with zeros and random
data and then restore.

When that isn't an option, you must write something to the block
and hope it is not an important block.  Use "dd" to seek to the
bad block and write zeros, then fsck and check out the partition.

Here is a sketch of what an "automatic tool" could do.
I don't think it is worth it, and such a tool may give
people a false sense of having fixed things that they haven't:

1. Unmount the drive;
2. Edit the mode pages to turn off error correction;
3. Read the offending block;
4. Turn on error checking;
5. Write the (probably garbage) data back,
causing it to reassign the block or at least store the data; 
6. fsck.

-- 
Peter Dufault               Real-Time Machine Control and Simulation
HD Associates, Inc.         Voice: 508 433 6936
dufault@hda.com             Fax:   508 433 5267



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610281406.JAA01122>