From owner-freebsd-questions@FreeBSD.ORG Tue Feb 27 22:13:08 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 542FE16A400 for ; Tue, 27 Feb 2007 22:13:08 +0000 (UTC) (envelope-from martster@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.freebsd.org (Postfix) with ESMTP id CDFB313C491 for ; Tue, 27 Feb 2007 22:13:07 +0000 (UTC) (envelope-from martster@gmail.com) Received: by ug-out-1314.google.com with SMTP id 71so1146764ugh for ; Tue, 27 Feb 2007 14:13:06 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ASbaTsgfzEvRimOwLCYrJ8YVjJdvq3y28ekKeFfDjlqSl0qTiEM2Ofp2ZXdmNOzEUBePvzetAB9CQJL29H0gNq6W1Y7Ub/PBCCWoqsFf5F7l59CcmrcnFOdv/arJCgrqqrZMv0fMNdGFv80E9QcOc6QXhkfJyssc/N3HfaTUBdY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=G6CYjxRN1HTcUiiKQ+DCbbfFE6H75oJl6JQCIPndeFC5QwPVP/4ISW691MK6HtXFT28skoT6nl8aJwj+61W8jM6e4qhrqKQcXGjZgEkwq9EXFs3mZfOV6kuu11mMkc8G9eITVb8qXIgilZ/xtjX/kXfaF/s/DZJ6dHeiRQZeqqE= Received: by 10.115.74.1 with SMTP id b1mr101017wal.1172614382364; Tue, 27 Feb 2007 14:13:02 -0800 (PST) Received: by 10.114.132.1 with HTTP; Tue, 27 Feb 2007 14:13:02 -0800 (PST) Message-ID: <70063950702271413w7715909dl708b5cf42f445fa6@mail.gmail.com> Date: Tue, 27 Feb 2007 17:13:02 -0500 From: "Marty Landman" To: "Jerry McAllister" In-Reply-To: <20070226153652.GA58704@gizmo.acns.msu.edu> MIME-Version: 1.0 References: <20070225182126.GA54901@gizmo.acns.msu.edu> <20070226153652.GA58704@gizmo.acns.msu.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Ian Smith , freebsd-questions@freebsd.org Subject: Re: input/output error on hd X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2007 22:13:08 -0000 On 2/26/07, Jerry McAllister wrote: > > On Mon, Feb 26, 2007 at 04:49:46PM +1100, Ian Smith wrote: > > > > Firstly, Marty, you should run dumpfs(8) on your ad1s1a. Well this didn't raise my spirits too much: %sudo dumpfs /dev/ad1s1a dumpfs: /dev/ad1s1a: could not read superblock to fill out disk % So I can get to all but my "dead" blocks via the DD command and work with it in hex; used to do mainframe assembler programming and don't particularly mind the workout, so to speak. Only with a road map it's not possible. Maybe I should write Ian Dowse and see if he can point me in the right direction (pun intended). Marty :--\ With the -m > > switch, this produces a single line suitable for feeding into newfs with > > all parameters, and is probably worth saving for all slices in case of > > any subsequent emergencies. I've just done that for mine, anyway, along > > with fdisk and boot0cfg -v output, and bsdlabel output for UFS slices. > > Yes. Good call. > I couldn't think of the dumpfs command the other evening when > I was writing, but that is the place to start. Definitely run > that output to a file. It will take some learning to understand > how to follow it out. There are tables somewhere that tell what > each of those things mean and what fields to look in in the raw > data to find each thing - and to write it back if that is what you > will want to do. > > Note that it will tell you in the first line if your filesystem if UFS2 > or something else. > > Good luck - maybe if you are successful, you can write a paper on it > and post it to a web page somewhere. I probably should have way back > when and then I would remember more now. > > ////jerry > > > > > Without the -m switch, feed the output to a file, or less, as it's very > > voluminous. For a 240GB drive, it'll likely be huge. However the data > > at the head is probably what's needed, though I can't make much of it. > > > > This post by Ian Dowse explains how to compute where the superblocks > > are, for a quoted example dumpfs: http://noc.caravan.ru/faq/SBLOCK.html > > > > Note however that Ian is talking about UFS1 (where the superblock offset > > was 32) but if you consult fsck_ffs(8) you'll see (under -b) that for > > UFS2, which you almost certainly would have used, it's at 140 .. I > > gather that's the offset from the start of each cylinder group? > > > > > > > > Also assuming my bad sectors really are > > > > totally bad, wouldn't fsck allow me to mark them as unusable and > move on? > > > > > > No, fsck does not do that. Marking blocks bad happend below the > > > level of the OS - generally in the disk controller itself. It > remaps > > > sectors until it runs out of spares and when it runs out, it starts > > > reporting unrecoverable errors. This is not even reported to the OS > > > until it runs out of spares. > > > > > > The only thing you can do with those bad sectors is to try and figure > > > out if any of them are superblocks. If they are, you can probably > > > rebuild it from other superblock clones. If it is not, it is > probably > > > lost data. In that case try to overwrite the bad sector. If that > > > works, then the sector itself is OK, but the data that was there is > > > gone. If it doesn't work, then it is bad and there is a good chance > > > that more than data got nuked in the power failure - eg, it damaged > > > the disk or controller in some way. > > > > Seeing if fsck_ffs will use any discovered alternate superblocks would > > be the first step, and if so, whether that helps to get it mounted. I'd > > certainly be careful to mount it read-only before trying data recovery! > > > > Since Marty has already been bravely using dd :) rewriting those sectors > > should be easy enough, bearing in mind the apparent off-by-one numbering > > difference between the sectors dd found bad and those fsck reported bad. > > > > > But, the next thing seems to be learning about how to follow the file > > > chains and how to find and read and write superblocks. Alternatively > > > you can decide it isn't worth the effort to recover and try and write > > > over the drive completely - just totally trash it - and see if those > > > bad sectors will write. If you did that, then you would have to > rebuild > > > the slice and partition table and do a newfs before you could again > > > use the drive and everything previously on it would be lost. > > > > Well if a dd rewriting those specific contiguous sectors failed, I doubt > > that newfs would do any better, so the dd is definitely worth a try, but > > I wouldn't write anything further to the fs until all else has failed. > > > > > Good luck. > > > > I can only echo that, again. > > > > > Maybe someone who has some experience in tracking file chains can > > > respond and give you more helpp than can I. > > > > Ditto for that .. I'm now very thoroughly out of my depth here, though > > I've learned a few new things through the exercise. > > > > Maybe mailing Ian Dowse with circumstances and the dumpfs head might be > > worth a try, Marty? See the website committers' page for his address. > > > > Cheers, Ian > > > -- Web Installed Formmail - http://face2interface.com/formINSTal/ Webmaster's BBS - http://bbs.face2interface.com/