From owner-freebsd-hackers Tue Nov 21 18:07:50 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id SAA18925 for hackers-outgoing; Tue, 21 Nov 1995 18:07:50 -0800 Received: from ref.tfs.com (ref.tfs.com [140.145.254.251]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id SAA18920 for ; Tue, 21 Nov 1995 18:07:46 -0800 Received: (from julian@localhost) by ref.tfs.com (8.6.12/8.6.9) id SAA07656; Tue, 21 Nov 1995 18:07:33 -0800 From: Julian Elischer Message-Id: <199511220207.SAA07656@ref.tfs.com> Subject: Re: Help! I got a bad block.... To: hasty@rah.star-gate.com (Amancio Hasty Jr.) Date: Tue, 21 Nov 1995 18:07:33 -0800 (PST) Cc: hasty@rah.star-gate.com, hackers@FreeBSD.org In-Reply-To: <199511220128.RAA00896@rah.star-gate.com> from "Amancio Hasty Jr." at Nov 21, 95 05:28:41 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 660 Sender: owner-hackers@FreeBSD.org Precedence: bulk No in fsck it attempts to write nulls to the inode which requires it to read the block first, null out the inode, and write it back..... the read is failing.. you need to do a write with no prior read.. (using the blknum shown in dmesg, not the blknum mentionned in fsck) e.g. char buf[512]; main() int fd = open ( "/dev/rsd0",O_WRONLY,0); /* or whatever*/ lseek(fd, blknum*512, 0 ); /* without looking at the man page */ write (fd,buf,512); } > > Writes to the bad block are failing per fsck ... > On a fsck stage , it attempts to write nulls to the bad block > and the drive fails. I do have AWRE and ARRE set on the disk. > > Tnks, > Amancio >