From owner-freebsd-questions Sun Dec 25 22:35:22 1994 Return-Path: questions-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id WAA22907 for questions-outgoing; Sun, 25 Dec 1994 22:35:22 -0800 Received: from emile.math.ucsb.edu (emile.math.ucsb.edu [128.111.88.11]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id GAA22901 for ; Mon, 26 Dec 1994 06:35:20 GMT Received: from emile.math.ucsb.edu ([127.0.0.1]) by emile.math.ucsb.edu with SMTP id AAA7123; Sun, 25 Dec 1994 22:33:22 -0800 To: dufault@hda.com Subject: Re: HELP!! Boot block/disklabel wiped Cc: questions@freebsd.org Content-Length: 2167 From: alan@math.ucsb.edu (Alan D. Trombla) Date: Sun, 25 Dec 1994 22:33:22 -0800 Message-ID: <19941226063321.AAA7123@emile.math.ucsb.edu> Sender: questions-owner@freebsd.org Precedence: bulk > From dufault@hda.com Sun Dec 25 17:07 PST 1994 > Subject: Re: HELP!! Boot block/disklabel wiped > To: alan@math.ucsb.edu (Alan D. Trombla) > > Alan D. Trombla writes: > > > (...) > > How can I reconstruct a disklabel? Is the disklabel/partition info > > stashed in some other well-known location on disk? Do superblocks > > know about there own partition? Other partitions? How can I locate a > > superblock --- do they have some kind of magic cookie that I could > > scan for? > > Here is a program that might help you. I wrote it when I accidentally > trashed my disk label on a two partition drive and couldn't bear the > thought of hours of spinning tapes to get it back. Two lessons - be > careful when labeling disks and print out your labels (or at least store > them on other drives). > > As long as your label is fairly simple you should be able to find the > partitions. Look for "hits" 16 blocks apart. Here is the label > on one of my drives: > > > 8 partitions: > > # size offset fstype [fsize bsize cpg] > > a: 65536 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 31) > > b: 65536 65536 swap # (Cyl. 32 - 63) > > c: 586764 0 unused 0 0 # (Cyl. 0 - 286) > > d: 586764 0 unused 0 0 # (Cyl. 0 - 286) > > e: 455692 131072 4.2BSD 1024 8192 16 # (Cyl. 64 - 286) Thanks for your help! I wrote something very similar that has allowed me to recover the usr partition. root appears to be trashed however, unless ... One more question: I notice that your root partition above is at offset 0; the freebsd2 installation assigned an offset of 32 to the trashed disk and an offset of 91 to my new disk. Where do these numbers come from? Can I be sure that the '32' is correct? It seems that that would cause trouble if wrong, but only with the root partition? The superblock doesn't seem to know about this. My root partition is trashed so badly that fsck dumps core; should this happen? Thanks, Alan Alan D. Trombla------------------------------------------alan@math.ucsb.edu