From owner-freebsd-fs@FreeBSD.ORG Mon Feb 23 11:13:24 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9393916A4CE for ; Mon, 23 Feb 2004 11:13:24 -0800 (PST) Received: from happy.cow.org (happy.cow.org [216.130.13.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F33443D1D for ; Mon, 23 Feb 2004 11:13:24 -0800 (PST) (envelope-from ravi@cow.org) Received: by happy.cow.org (Postfix, from userid 1001) id 5CA5AEBE0A; Mon, 23 Feb 2004 14:13:18 -0500 (EST) Date: Mon, 23 Feb 2004 14:13:18 -0500 From: ravi pina To: freebsd-fs@freebsd.org Message-ID: <20040223191318.GA69611@happy.cow.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i Subject: Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ravi@cow.org List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 19:13:24 -0000 hi. i have a 4 disk raid5 using the 3ware 7410 using their fbsd driver on 4.8. at one point one of my targets failed and the system seized. not knowing the former, i rebooted the system and it did its regular fsck. after finding a unusually large number of mussing or corrupt inodes, i stopped the check and left the volume mounted read only. accessing (i'm guessing) certain parts of the array while in the degraded state caused the kernel to panic. after (finally) learning of the state of the array i left it dismounted until i was able to replace the disk. after doing so the array appeared to rebuild fine and it went from a degraded state to a ok state. long story short: it seems the disklabel got blown away and other filesystem important data is corrupt preventing me from accessing data. so my question is: is the data still there and if so, will recreating the disklabel by hand and doing a newfs -N to find where the alternate superblocks may reside bring me any closer to getting the data back without having to seriously consider professional data recovery? if so, how would i go about zeroing out the corrupt disklabel and manually creating a new one? specifically how would i obtain the drive geometry suitable for a disklabel import? thanks a bunch, -r -- From owner-freebsd-fs@FreeBSD.ORG Mon Feb 23 11:21:36 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 826F716A4CE for ; Mon, 23 Feb 2004 11:21:36 -0800 (PST) Received: from citi.umich.edu (citi.umich.edu [141.211.133.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 681F143D1D for ; Mon, 23 Feb 2004 11:21:36 -0800 (PST) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (citi-166.Connectathon.ORG [130.128.53.166]) by citi.umich.edu (Postfix) with ESMTP id 4086520EF5 for ; Mon, 23 Feb 2004 14:21:35 -0500 (EST) To: freebsd-fs@freebsd.org From: Jim Rees In-Reply-To: ravi pina, Mon, 23 Feb 2004 14:13:18 EST Date: Mon, 23 Feb 2004 14:21:33 -0500 Sender: rees@citi.umich.edu Message-Id: <20040223192135.4086520EF5@citi.umich.edu> Subject: Re: Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 19:21:36 -0000 I've often wished I had a tool that searches a raw disk for superblocks then suggests a possible disklabel. Surely someone has already written this? From owner-freebsd-fs@FreeBSD.ORG Mon Feb 23 11:30:47 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8DDC116A4CE for ; Mon, 23 Feb 2004 11:30:47 -0800 (PST) Received: from relay.macomnet.ru (relay.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDA1043D2D for ; Mon, 23 Feb 2004 11:30:46 -0800 (PST) (envelope-from maxim@macomnet.ru) Received: from mp3 (q6v24wpc@mp3files.int.ru [195.128.64.20]) by relay.macomnet.ru (8.12.10/8.12.10) with ESMTP id i1NJUiOB6869590; Mon, 23 Feb 2004 22:30:44 +0300 (MSK) Date: Mon, 23 Feb 2004 22:30:44 +0300 (MSK) From: Maxim Konovalov To: Jim Rees In-Reply-To: <20040223192135.4086520EF5@citi.umich.edu> Message-ID: <20040223222914.F96304@mp3files.int.ru> References: <20040223192135.4086520EF5@citi.umich.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org Subject: Re: Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 19:30:47 -0000 On Mon, 23 Feb 2004, 14:21-0500, Jim Rees wrote: > I've often wished I had a tool that searches a raw disk for superblocks then > suggests a possible disklabel. Surely someone has already written this? Sure. We have one in our src tree: src/tools/tools/find-sb. -- Maxim Konovalov From owner-freebsd-fs@FreeBSD.ORG Mon Feb 23 12:47:42 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFDD816A4CE for ; Mon, 23 Feb 2004 12:47:42 -0800 (PST) Received: from happy.cow.org (happy.cow.org [216.130.13.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id B28D843D1F for ; Mon, 23 Feb 2004 12:47:42 -0800 (PST) (envelope-from ravi@cow.org) Received: by happy.cow.org (Postfix, from userid 1001) id 4CDC6EBE0A; Mon, 23 Feb 2004 15:47:36 -0500 (EST) Date: Mon, 23 Feb 2004 15:47:36 -0500 From: ravi pina To: Maxim Konovalov Message-ID: <20040223204736.GB69611@happy.cow.org> References: <20040223192135.4086520EF5@citi.umich.edu> <20040223222914.F96304@mp3files.int.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040223222914.F96304@mp3files.int.ru> User-Agent: Mutt/1.5.1i cc: freebsd-fs@freebsd.org Subject: Re: Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ravi@cow.org List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 20:47:43 -0000 On Mon, Feb 23, 2004 at 10:30:44PM +0300, Maxim Konovalov said at one point in time: > On Mon, 23 Feb 2004, 14:21-0500, Jim Rees wrote: > > > I've often wished I had a tool that searches a raw disk for superblocks then > > suggests a possible disklabel. Surely someone has already written this? > > Sure. We have one in our src tree: src/tools/tools/find-sb. which version? i didn't see it in my 4.8 tree. -r From owner-freebsd-fs@FreeBSD.ORG Mon Feb 23 14:07:09 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C611B16A4CE for ; Mon, 23 Feb 2004 14:07:09 -0800 (PST) Received: from happy.cow.org (happy.cow.org [216.130.13.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id B000D43D1F for ; Mon, 23 Feb 2004 14:07:09 -0800 (PST) (envelope-from ravi@cow.org) Received: by happy.cow.org (Postfix, from userid 1001) id CF56DEBE0A; Mon, 23 Feb 2004 17:07:02 -0500 (EST) Date: Mon, 23 Feb 2004 17:07:02 -0500 From: ravi pina To: freebsd-fs@freebsd.org Message-ID: <20040223220702.GD69611@happy.cow.org> References: <20040223191318.GA69611@happy.cow.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040223191318.GA69611@happy.cow.org> User-Agent: Mutt/1.5.1i Subject: Re: (followup) Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ravi@cow.org List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 22:07:09 -0000 forgot to mention that when doing a disklabel on twed0s1 it returns: disklabel: ioctl DIOCGDINFO: Invalid argument but when doing it on twed0 i (believe) correctly get: # /dev/twed0: type: ESDI disk: amnesiac label: fictitious flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 91203 sectors/unit: 1465185024 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize bps/cpg] c: 1465185024 0 unused 0 0 # (Cyl. 0 - 91203*) From owner-freebsd-fs@FreeBSD.ORG Tue Feb 24 03:06:39 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7973716A4CE for ; Tue, 24 Feb 2004 03:06:39 -0800 (PST) Received: from relay.macomnet.ru (relay.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DA1843D2D for ; Tue, 24 Feb 2004 03:06:38 -0800 (PST) (envelope-from maxim@macomnet.ru) Received: from mp3 (o00g5fgu@mp3files.int.ru [195.128.64.20]) by relay.macomnet.ru (8.12.10/8.12.10) with ESMTP id i1OB6WOB6810582; Tue, 24 Feb 2004 14:06:32 +0300 (MSK) Date: Tue, 24 Feb 2004 14:06:32 +0300 (MSK) From: Maxim Konovalov To: ravi pina In-Reply-To: <20040223204736.GB69611@happy.cow.org> Message-ID: <20040224140611.S84325@mp3files.int.ru> References: <20040223192135.4086520EF5@citi.umich.edu> <20040223222914.F96304@mp3files.int.ru> <20040223204736.GB69611@happy.cow.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org Subject: Re: Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2004 11:06:39 -0000 On Mon, 23 Feb 2004, 15:47-0500, ravi pina wrote: > On Mon, Feb 23, 2004 at 10:30:44PM +0300, Maxim Konovalov said at one point in time: > > On Mon, 23 Feb 2004, 14:21-0500, Jim Rees wrote: > > > > > I've often wished I had a tool that searches a raw disk for superblocks then > > > suggests a possible disklabel. Surely someone has already written this? > > > > Sure. We have one in our src tree: src/tools/tools/find-sb. > > which version? i didn't see it in my 4.8 tree. http://cvsweb.freebsd.org/ -- Maxim Konovalov From owner-freebsd-fs@FreeBSD.ORG Tue Feb 24 10:08:47 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B50116A4CE for ; Tue, 24 Feb 2004 10:08:47 -0800 (PST) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2127D43D1D for ; Tue, 24 Feb 2004 10:08:47 -0800 (PST) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 154A172DD4; Tue, 24 Feb 2004 10:08:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 103D172DD2; Tue, 24 Feb 2004 10:08:47 -0800 (PST) Date: Tue, 24 Feb 2004 10:08:47 -0800 (PST) From: Doug White To: ravi pina In-Reply-To: <20040223220702.GD69611@happy.cow.org> Message-ID: <20040224100730.G30559@carver.gumbysoft.com> References: <20040223191318.GA69611@happy.cow.org> <20040223220702.GD69611@happy.cow.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org Subject: Re: (followup) Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2004 18:08:47 -0000 On Mon, 23 Feb 2004, ravi pina wrote: > forgot to mention that when doing a disklabel on twed0s1 it > returns: > > disklabel: ioctl DIOCGDINFO: Invalid argument Looks like the slice table got mulched too. Are you sure you didn't have a double-disk failure, or that the 3ware has finished rebuilding the volume? There's a lot of data missing for a single disk failure in a raid5. In particular, it looks like the whole first shunk fo the volume is missing. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org From owner-freebsd-fs@FreeBSD.ORG Tue Feb 24 20:17:52 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C762416A4CE for ; Tue, 24 Feb 2004 20:17:52 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7622943D1F for ; Tue, 24 Feb 2004 20:17:52 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i1P4GqDL064734; Tue, 24 Feb 2004 23:16:52 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i1P4GpqH064731; Tue, 24 Feb 2004 23:16:51 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Tue, 24 Feb 2004 23:16:51 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: ravi pina In-Reply-To: <20040223204736.GB69611@happy.cow.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org Subject: Re: Possible corrupt disklabel and more X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2004 04:17:52 -0000 On Mon, 23 Feb 2004, ravi pina wrote: > On Mon, Feb 23, 2004 at 10:30:44PM +0300, Maxim Konovalov said at one point in time: > > On Mon, 23 Feb 2004, 14:21-0500, Jim Rees wrote: > > > > > I've often wished I had a tool that searches a raw disk for superblocks then > > > suggests a possible disklabel. Surely someone has already written this? > > > > Sure. We have one in our src tree: src/tools/tools/find-sb. > > which version? i didn't see it in my 4.8 tree. If you're running 4.x, try: http://www.watson.org/~robert/freebsd/scan_ffs_freebsd4/ That's a port of the OpenBSD tool. There was a version adapted for UFS2 floating around somewhere also, but if you're running 4.x that's not an issue. It has a mode that spits out the disklabel -- make sure to run it on the disk slice so you get offsets relative to the slice. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research From owner-freebsd-fs@FreeBSD.ORG Fri Feb 27 04:09:56 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A511916A4CE; Fri, 27 Feb 2004 04:09:56 -0800 (PST) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E92443D2F; Fri, 27 Feb 2004 04:09:55 -0800 (PST) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.12.9p2/8.12.9) with ESMTP id i1RC9r0V025978; Fri, 27 Feb 2004 15:09:53 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.12.9p2/8.12.9/Submit) id i1RC9q9B025977; Fri, 27 Feb 2004 15:09:52 +0300 (MSK) (envelope-from yar) Date: Fri, 27 Feb 2004 15:09:52 +0300 From: Yar Tikhiy To: Brian Fundakowski Feldman Message-ID: <20040227120951.GC20684@comp.chem.msu.su> References: <200402212132.i1LLWa7P057630@green.homeunix.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200402212132.i1LLWa7P057630@green.homeunix.org> User-Agent: Mutt/1.5.3i cc: fs@freebsd.org cc: mckusick@freebsd.org Subject: Re: SoftUpdates/fsck considered harmful X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2004 12:09:56 -0000 On Sat, Feb 21, 2004 at 04:32:36PM -0500, Brian Fundakowski Feldman wrote: > I lost some data which was important to me (thankfully, not lost completely, > as a fgrep on the hard disk was able to find a copy) because of a crash > while SoftUpdates had some data not yet flushed. I simply had done this: > > 1. vi file > 2. *edit edit edit, :wq* > 3. ci file > 4. co -l file > > That should have left me with several copies of it, but when the system > panicked, upon reboot fsck told me: > > Feb 19 21:34:46 green fsck: /dev/ad0s2e: UNREF FILE I=448021 OWNER=green MODE=100644 > Feb 19 21:34:46 green fsck: /dev/ad0s2e: SIZE=6298 MTIME=Feb 19 20:38 2004 (CLEARED) > > I'm certain this was the file I was editing. SoftUpdates only guarantees > the disk is in a valid state, not that I won't lost files, but if fsck > hadn't decided that "UNREF" meant "the user did not intend this file to > exist any longer", I would have had a copy of it in /home/lost+found! Can > there please be a less harmful behavior than simply not restoring unlinked > files just because they appear to be "UNREF"? I'm afraid you demand from the filesystem logic what it isn't supposed to provide. In the case you described, having a remote repository on a stable machine would be the solution. On the one hand, using Softupdates indeed leads to probably "losing" recently created files upon a system crash (which may be compensated for by deleted files reappearing :-) On the other hand, without Softupdates one would have a close chance to end up with files that existed but had inconsistent contents because of the crash preventing some buffered data from being committed to stable storage. Personally, I see no point in trying to choose the lesser of the two evils when an orthogonal path can be followed. And Softupdates has the advantage of keeping at least the filesystem metadata in a consistent state. Now let's return to the fsck topic. AFAIK "UNREF" means that the reference count of an inode has dropped to zero because all links from directories are gone, but the inode hasn't actually been freed due to a system crash or malfunction. This is different from the case of a lost inode, which has a non-zero reference count but no actual references from directories. Therefore fsck will clear UNREF'ed inodes, but reconnect lost ones to lost+found. Please correct me if I'm wrong. -- Yar