From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 18 18:01:20 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 8B57F16A420 for ; Sat, 18 Feb 2006 18:01:20 +0000 (GMT) (envelope-from wb@freebie.xs4all.nl) Received: from smtp-vbr15.xs4all.nl (smtp-vbr15.xs4all.nl [194.109.24.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFD3643D48 for ; Sat, 18 Feb 2006 18:01:19 +0000 (GMT) (envelope-from wb@freebie.xs4all.nl) Received: from freebie.xs4all.nl (freebie.xs4all.nl [213.84.32.253]) by smtp-vbr15.xs4all.nl (8.13.3/8.13.3) with ESMTP id k1II0umB097452; Sat, 18 Feb 2006 19:00:56 +0100 (CET) (envelope-from wb@freebie.xs4all.nl) Received: from freebie.xs4all.nl (localhost [127.0.0.1]) by freebie.xs4all.nl (8.13.4/8.13.3) with ESMTP id k1II0tMZ063082; Sat, 18 Feb 2006 19:00:55 +0100 (CET) (envelope-from wb@freebie.xs4all.nl) Received: (from wb@localhost) by freebie.xs4all.nl (8.13.4/8.13.1/Submit) id k1II0t0N063081; Sat, 18 Feb 2006 19:00:55 +0100 (CET) (envelope-from wb) Date: Sat, 18 Feb 2006 19:00:55 +0100 From: Wilko Bulte To: "M. Warner Losh" Message-ID: <20060218180055.GA63046@freebie.xs4all.nl> References: <20060218.102145.26324437.imp@bsdimp.com> <200602181735.k1IHZOuj040864@gate.bitblocks.com> <20060218.104749.104696960.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060218.104749.104696960.imp@bsdimp.com> X-OS: FreeBSD 6.1-PRERELEASE User-Agent: Mutt/1.5.11 X-Virus-Scanned: by XS4ALL Virus Scanner 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 18:01:20 -0000 On Sat, Feb 18, 2006 at 10:47:49AM -0700, M. Warner Losh wrote.. > In message: <200602181735.k1IHZOuj040864@gate.bitblocks.com> > Bakul Shah writes: > : > I have a hard disk that's been in service a long time. I recently > : > installed the SMART monitoring tools. On occasion, I get reports of > : > LBAs it can't read. I'd like to map the LBA to an actual file in the > : > file system, if possible. Does anybody have any tools that can help > : > me with this? > : > > : > I know I need to get a new disk. In the mean time, I need to cope > : > with these errors in a sane manner... > : > > : > Warner > : > > : > P.S. Here's a sample report: > : > > : > Num Test_Description Status LifeTime(hours) LBA_of_first_error > : > # 1 Extended offline Completed: read failure 8949 65818210 > : > # 2 Short offline Completed without error 8948 - > : > : Wouldn't bad block forwarding by the disk take care of this? > : Generally you want the read of a bad block to return an error > : but if you write the block the disk will automatically remap > : this block to one of the spare blocks. > > Correct. That's exactly what I'm trying to do. > > : What exactly are you trying to do by mapping a bad block to a > : file? Nevertheless may be fsdb will help? You still need to > : map LBA to the slice/partition offset. > > Right, I've mapped the lba to a partition, and used badsect to request > that at the next fsck the file that contains the bad block be removed > and replaced with the file in BAD. 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. > > 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. > > Maybe there's a better way to cope, maybe not. I don't know. Hence > my question :-). > > This is with an ata disk, btw. Obviously. But for intents and purposes it could have been an RK05 :-P So much for progress -- Wilko Bulte wilko@FreeBSD.org