From owner-freebsd-questions Tue Sep 12 10:33:59 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id KAA22018 for questions-outgoing; Tue, 12 Sep 1995 10:33:59 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id KAA22012 for ; Tue, 12 Sep 1995 10:33:57 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id KAA21886; Tue, 12 Sep 1995 10:25:27 -0700 From: Terry Lambert Message-Id: <199509121725.KAA21886@phaeton.artisoft.com> Subject: Re: recovering a FS To: kuku@gilberto.physik.RWTH-Aachen.DE (Christoph P. Kukulies) Date: Tue, 12 Sep 1995 10:25:27 -0700 (MST) Cc: freebsd-questions@freefall.freebsd.org In-Reply-To: <199509120606.IAA07544@gilberto.physik.RWTH-Aachen.DE> from "Christoph P. Kukulies" at Sep 12, 95 08:06:37 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1496 Sender: questions-owner@FreeBSD.org Precedence: bulk > During the process of upgrading a 1.1.5.1 machine to 2.1.0-950726-SNAP > I inadvertently overwrote the partition of a 1GB SCSI disk wich > was containing all my saved mail messages and such. "It's like > you have broken with the past" at the moment :-). > > I managed to reestablish the partitioning scheme by running a 1.1.5.1 > install disk set partially on it. Now the only problem is that > all disklabel data I can find doesn't seem to be the right one. > > Is there a way (with a program or whatever tool) to reestablish > or recover a disklabel from a given disk? > > Presently the only chance to find certain things is to grep through > the raw device :-( Binary grep the raw device for the file system magic number; this will give the location of the superblock structures. Look at fsck for the definition of the "dynamic" fields in the superblock. These will be non-zero on the first one. This will give you the disk offset of the superblocks, which you can then enter into your disklabel. I have often though the perhaps swap should be first to ensure that an overwrite like this would not necessarily touch important data. On the other hand, you aren't supposed to put anything important in the '/' but distribution files (and system configuration because of stupid writeable '/etc'), and '/' has to be below 1024 for BIOS to see it. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.