From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 18 19:10:41 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 2FB5D16A420 for ; Sat, 18 Feb 2006 19:10:41 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3C9F43D46 for ; Sat, 18 Feb 2006 19:10:40 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id k1IJ7oqc071110; Sat, 18 Feb 2006 12:07:50 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 18 Feb 2006 12:08:08 -0700 (MST) Message-Id: <20060218.120808.73002804.imp@bsdimp.com> To: bakul@bitblocks.com From: "M. Warner Losh" In-Reply-To: <200602181902.k1IJ243D041278@gate.bitblocks.com> References: <20060218.104749.104696960.imp@bsdimp.com> <200602181902.k1IJ243D041278@gate.bitblocks.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sat, 18 Feb 2006 12:07:50 -0700 (MST) 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:10:41 -0000 In message: <200602181902.k1IJ243D041278@gate.bitblocks.com> Bakul Shah writes: : > 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. Yea. I was kinda hoping to find a tool that would do that given the LBA of the disk... I can do the math by hand, but if I don't have to... : 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? I want to know what file I'm trashing, explicitly. I could just do the dd trick to the raw block, but then I'd have a divot left in the file that I have no clue is there... Warner