Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jul 1996 23:57:31 GMT
From:      James Raynard <fqueries@jraynard.demon.co.uk>
To:        dougal@iquest.com
Cc:        questions@freebsd.org
Subject:   Re: Partition table gone. Fixable?
Message-ID:  <199607082357.XAA04145@jraynard.demon.co.uk>
In-Reply-To: <Pine.BSI.3.93.960708142739.3972B-100000@vespucci.iquest.com> (message from Dougal Campbell on Mon, 8 Jul 1996 14:30:03 -0500 (CDT))

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> Dougal Campbell <dougal@iquest.com> 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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607082357.XAA04145>