From owner-freebsd-questions Sun May 26 5:36:52 2002 Delivered-To: freebsd-questions@freebsd.org Received: from empty1.ekahuna.com (empty1.ekahuna.com [198.144.200.196]) by hub.freebsd.org (Postfix) with ESMTP id 9568537B401 for ; Sun, 26 May 2002 05:36:43 -0700 (PDT) Received: from pc-02 (pc02.ekahuna.com [198.144.200.197]) by empty1.ekahuna.com (Post.Office MTA v3.5.3 release 223 ID# 0-0U10L2S100V35) with ESMTP id com; Sun, 26 May 2002 05:36:42 -0700 From: "Philip J. Koenig" Organization: The Electric Kahuna Organization To: Questions@FreeBSD.ORG Date: Sun, 26 May 2002 05:36:42 -0700 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Disk bad sector question Reply-To: pjklist@ekahuna.com Cc: Axel Scheepers In-reply-to: <20020526125120.B43810@mars.thuis> References: <20020519122229533.AAA405@empty1.ekahuna.com@pc02.ekahuna.com>; from pjklist@ekahuna.com on Sun, May 19, 2002 at 05:22:30AM -0700 X-mailer: Pegasus Mail for Win32 (v3.12c) Message-ID: <20020526123642862.AAA448@empty1.ekahuna.com@pc02.ekahuna.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 26 May 2002, at 12:51, Axel Scheepers boldly uttered: > On Sun, May 19, 2002 at 05:22:30AM -0700, Philip J. Koenig wrote: > > Yep, I already used camcontrol to view the original and grown defect > > lists after seeing these errors. > > > > And I know I can try copying data to the sectors in question and > > force them to be remapped, etc. But I want to take a look at the > > affected files first and recover as much as I can from them, before I > > do that. I didn't see how camcontrol would help in that respect. > > > > I guess I'd be rather surprised if there is no way to figure out > > which sectors are assigned to which inodes or files.. > > > > My bad, I read your post to quickly, sorry. > You might find the information in /usr/src/sys/ufs/ufs interesting, > mostly dinode.h I think. That contains the layout of an inode as it's > present on an ufs filesystem and contains an array of the disk > blocks it's using. Then you could try to read those sectors with dd, > I hear there's a modified version which handles i/o errors a bit better > but retrieving it will be a hard job. Not a problem. I found out one way to ascertain what files are affected -- do a dump/restore and see which files have errors either saving or restoring. :-) I found a few that way, but I'm sure there are others that wouldn't show up like that. Lucky for me, all the files were A) non-critical and B) part of the base system and thus rebuilt with make world. I've been using the new disk for a few days now. FWIW, I see Linux has some utilities which might come in handy on FreeBSD. One called "badblocks" that can find bad blocks and another called "dumpe2fs" (derived from Berkeley's "dumpfs") that with a -b option will also produce a list that can be used by "e2fsck" to mark the blocks bad. (looks like dumpfs might've told me what I wanted to know, if I had *any* idea how to decipher its output :-) Phil -- Philip J. Koenig pjklist@ekahuna.com Electric Kahuna Systems -- Computers & Communications for the New Millenium To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message