From owner-freebsd-questions Mon Jul 8 17:54:44 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA17534 for questions-outgoing; Mon, 8 Jul 1996 17:54:44 -0700 (PDT) Received: from relay-4.mail.demon.net (relay-4.mail.demon.net [158.152.1.108]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id RAA17507 for ; Mon, 8 Jul 1996 17:54:41 -0700 (PDT) Received: from post.demon.co.uk ([158.152.1.72]) by relay-4.mail.demon.net id ab20467; 9 Jul 96 0:54 GMT Received: from jraynard.demon.co.uk ([158.152.42.77]) by relay-3.mail.demon.net id aa15590; 9 Jul 96 1:35 +0100 Received: (from fqueries@localhost) by jraynard.demon.co.uk (8.6.12/8.6.12) id XAA04145; Mon, 8 Jul 1996 23:57:31 GMT Date: Mon, 8 Jul 1996 23:57:31 GMT Message-Id: <199607082357.XAA04145@jraynard.demon.co.uk> From: James Raynard To: dougal@iquest.com CC: questions@freebsd.org In-reply-to: (message from Dougal Campbell on Mon, 8 Jul 1996 14:30:03 -0500 (CDT)) Subject: Re: Partition table gone. Fixable? Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>>> Dougal Campbell writes: > > I've got a drive whose partition table was damaged somehow. Is there any > way to restore the partition table, and recover the filesystem data? Can I'll assume here that you mean the FreeBSD label (the one that says where /, /usr and co are in a FreeBSD slice), rather than the partition table at the start of the disk (the one which tells the system where the slices for different operating systems are). Two things come to mind (I'll assume the obvious one of getting a new disk and restoring from backups isn't applicable here :-) 1. If you have a steady hand and can remember _exactly_ how the disk was set up before, you can probably re-create it in the installation program's disklabel editor. Reboot from the install floppy (or run /stand/sysinstall), select ``Express Installation'', press 'q' to get out of the fdisk editor and you will arrive in the disklabel editor. When you think you've got it right, press 'w' to write the changes, confirm that yes, you really want to do that, and then keep pressing escape until you exit the installation. If you're a command-line traditionalist, you can do 'disklabel -e -r sd0' (or whatever the correct name is for the disk) instead. 2. Put the disk in another FreeBSD machine and try to grab the data from the raw devices for the disk (I've a nasty feeling this will require a correct partition table, though). > this be done with disklabel? The man pages aren't clear as to whether the > partition table is part of the "label", but it sort of implies such. It's a confusing topic, and the man pages are not anywhere near as clear as they could be. If by "partition table" you actually mean the one at the start of the disk, then you'll need to use 'fdisk -i -u', or the installation program's fdisk editor, instead. > Is the data salvagable, or am I just boned? Don't know - I've never actually had to do this myself. -- James Raynard, Edinburgh, Scotland james@jraynard.demon.co.uk http://www.freebsd.org/~jraynard/