From owner-freebsd-hackers Mon Sep 9 13:12:01 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA16291 for hackers-outgoing; Mon, 9 Sep 1996 13:12:01 -0700 (PDT) Received: from megazone.bigpanda.com (hac-nj1-15.ix.netcom.com [206.214.115.47]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA16277 for ; Mon, 9 Sep 1996 13:11:53 -0700 (PDT) Received: from localhost.bigpanda.com (localhost.bigpanda.com [127.0.0.1]) by megazone.bigpanda.com (8.7.5/8.6.12) with SMTP id QAA02289 for ; Mon, 9 Sep 1996 16:10:11 -0400 (EDT) Message-Id: <199609092010.QAA02289@megazone.bigpanda.com> X-Authentication-Warning: megazone.bigpanda.com: Host localhost.bigpanda.com [127.0.0.1] didn't use HELO protocol X-Mailer: exmh version 1.6.7 5/3/96 To: hackers@freebsd.org From: Richard Hwang Reply-to: Richard Hwang Subject: rebuilding trashed disklabel Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Sep 1996 16:10:11 -0400 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I have a drive here (western digital 32500 2.5G ide) on a Dell P6 system with 80M RAM which had FreeBSD on it. (The whole drive was allocated to FreeBSD; no multiple boot to other operating systems.) When I rebooted the system, it failed to boot, claiming that I should insert bootable media. When I checked out the disklabel, it looked something like this: [...] 1 partition: # size offset fstype [fsize bsize bps/cpg] c: 65536 0 4.2BSD 0 0 0 # (Cyl. 0 - 31) I figured that all I had to do was to rebuild the disklabel, and then I'd get the entire drive back, since the data is probably still there (unless it decided to follow the disklabel into oblivion). The problem is that I don't know the sizes of the partitions. Here is what I do know: wd0a / 32M wd0b swap ?M (probably between 80M - 256M?) wd0e /var ?M wd0f /tmp ?M wd0g /usr ?M I was able to recover wd0a successfully by defining wd0a. I have a perl script which adjusts the partition offsets, writes the disklabel, and tries to mount the partition, but realized that it would take forever to finish. Is there some easier way to restore the other partitions? -Rich -- Richard Hwang rhwang@io.com