Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Sep 2001 15:35:23 -0500
From:      Mike Meyer <mwm@mired.org>
To:        walton@digger.net
Cc:        questions@freebsd.org
Subject:   Re: Partition table problem
Message-ID:  <15286.12427.511662.737926@guru.mired.org>
In-Reply-To: <36029379@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
walton@digger.net types:
> Ok, I need some help from someone who is EXTREMELY familiar with
> partition tables, DOS partitions (esp. extended), and the FreeBSD
> partition tools (fdisk and the partition editor in sysinstall).

Just a note - FreeBSD terminology is slices, as the things that go
inside a FreeBSD slice are partitions. Fdisk doesn't follow that
usage, though.

> At that point, I discovered that the partition editor had rewritten 
> the partition table (even though it was unnecessary), and had marked
> the 4th (formerly extended DOS) partition as unused!!  It did not 
> alter the partition offsets or sizes (as far as I can tell), so no
> data should be lost, but I am now unable to access that partition.

Sysinstall doesn't know that you didn't make any changes, and writes
the partition table out in any case. It shouldn't have touched the 4th
partition if you didn't change it, though.

> What I need to know is how I can SAFELY edit that entry in the 
> partition table to convert it from unused back into an extended DOS
> partition, with a single logical drive in it.  Any use of DOS fdisk
> is out of the question, since that will wipe the partition.  I suspect
> I could use the partition editor to create a partition there 
> (type number?), but I don't know for sure that is safe, and what about 
> the logical drive?

FreeBSD tools generally can't deal with logical partitions. They show
up as s5 and up, but you've got to use tools from other systems to
create them.  If you're going to use FreeBSD tools, the best you can
do is use fdisk to tag the type of that 4th partition to extended, and
hope that the logical partition reappears. The extended partition type
is either 5 or 15 for the LBA version. If you've got an unused disk,
create an extended partition on it the same way you created the one
you're trying to recover, and then just use "fdisk" on that disk and
it'll tell you the type.

To use fdisk this one, invoke it as "fdisk -4 -u ad0" - assuming it's
disk ad0 that you need to fix. It will then print the partition 4
information, and ask you if you want to change it. Say "y". It will
then ask about the sysid - set that to either 5 or 15, whichever you
believe is correct. Just hit newline for the reast of the questions -
that will use the old values and not change things - until it prints
the new partition table and asks you if you want to write it. At that
point, tell it "y" to write it, nor "n" if you want to chicken out.

Then you can use "mount -r -t msdos /dev/ad0s5 /mnt" - again assuming
it's ad0 - to try mounting that logical from that disk and see what
happens. Or boot an MS os and see if the logical partition came back.

> Ok, experts...  Dazzle me with your brilliance!  :)

Sorry, this is the best I can do. You might want to try some of the
non-MS Windows partitions managers instead. Partition Commander is the
only one I can think of, but I won't recommend it as I don't use
Windows.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Q: How do you make the gods laugh?		A: Tell them your plans.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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