From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 18 19:02:09 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5B6116A420 for ; Sat, 18 Feb 2006 19:02:09 +0000 (GMT) (envelope-from bakul@bitblocks.com) Received: from gate.bitblocks.com (bitblocks.com [209.204.185.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id A900243D45 for ; Sat, 18 Feb 2006 19:02:09 +0000 (GMT) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost [127.0.0.1]) by gate.bitblocks.com (8.13.4/8.13.1) with ESMTP id k1IJ243D041278; Sat, 18 Feb 2006 11:02:04 -0800 (PST) (envelope-from bakul@bitblocks.com) Message-Id: <200602181902.k1IJ243D041278@gate.bitblocks.com> To: "M. Warner Losh" In-reply-to: Your message of "Sat, 18 Feb 2006 10:47:49 MST." <20060218.104749.104696960.imp@bsdimp.com> Date: Sat, 18 Feb 2006 11:02:04 -0800 From: Bakul Shah Cc: hackers@freebsd.org Subject: Re: Bad block -> file mapping X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2006 19:02:10 -0000 > However, I'd kinda like to know > which file that is. If it is a boring file (foo.o, say), I'd dd the > bad block with 0's and then remove it. If it is a non-boring file, > I'd try to recover it a couple of times, etc. So you want a function that does this? LBA -> slice/partition/offset -> fs/inode -> list of file names Logic for the second step should be in fsck. I haven't kept uptodate on disk stds so likely I am talking through my hat but in ST506 there used to be a diagnostic read function that returned the bad block and its CRC. That allows at least a chance of a manual correction. > Once I have the file in BAD, I'd planned on overwriting it with 0's > and then removing it if I could read the block again. Why do you care? > Maybe there's a better way to cope, maybe not. I don't know. Hence > my question :-). > > This is with an ata disk, btw. My sympathies.