Date: Mon, 26 Jan 1998 08:49:12 -0800 (PST) From: Julian Elischer <julian@whistle.com> To: John Polstra <jdp@polstra.com> Cc: freebsd-hardware@FreeBSD.ORG Subject: Re: SCSI bad block handling? Message-ID: <Pine.BSF.3.95.980126084717.29311D-100000@current1.whistle.com> In-Reply-To: <199801261639.IAA21681@austin.polstra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
The disk driver has an ioctl to force a remap. it's commented out only because I didn't know where to put the ioctl definition. we use it at TFS so it works. On Mon, 26 Jan 1998, John Polstra wrote: > Mike Smith wrote: > > > You may then need to actually write to the blocks before they will > > be reallocated, which will generally involve using dd to plaster > > the entire disk (unless you write a program to write to just the > > offending parts of the raw device). > > Attached is a quickie program I wrote a while ago for just this > purpose. It first reads the block and saves its original contents, > both in memory and in a file on disk. Then it bashes the block on > disk with several fixed patterns and then several random patterns, > trying to provoke a write error and force the disk to remap the block. > Finally, it restores the block from its original data. It has worked > well for me to get a few troublesome blocks remapped. Also, it has > the nice property that it won't remap a block that just isn't bad. > > As I mentioned, it was a quickie, so don't expect a software > engineering marvel. In particular, the block number is hard coded > into main(). :-O The fix for that is left as an exercise for the > reader. > > John > -- > John Polstra jdp@polstra.com > John D. Polstra & Co., Inc. Seattle, Washington USA > "Self-knowledge is always bad news." -- John Barth > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980126084717.29311D-100000>
