Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jan 2003 21:51:00 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Juan E Navarro <jnavarro@cs.rice.edu>
Cc:        "freebsd-ia64@FreeBSD.ORG" <freebsd-ia64@FreeBSD.ORG>
Subject:   MBR/GPT mess :-) [was: Re: Problems with fxp driver]
Message-ID:  <20030130055100.GA1717@athlon.pn.xcllnt.net>
In-Reply-To: <3E38B494.7250D2AE@cs.rice.edu>
References:  <3E35E4A9.3C8A4845@cs.rice.edu> <20030128021356.GA1228@athlon.pn.xcllnt.net> <3E38AC98.E8C6FF17@cs.rice.edu> <20030130045351.GB1574@athlon.pn.xcllnt.net> <3E38B494.7250D2AE@cs.rice.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 29, 2003 at 11:13:57PM -0600, Juan E Navarro wrote:
> 
> % fdisk da
> ******* Working on device /dev/da0 *******
> parameters extracted from in-core disklabel are:
> cylinders=2213 heads=255 sectors/track=63 (16065 blks/cyl)
> 
> Figures below won't work with BIOS for partitions not in cyl 1
> parameters to be used for BIOS calculations are:
> cylinders=2213 heads=255 sectors/track=63 (16065 blks/cyl)
> 
> Media sector size is 512
> Warning: BIOS sector numbering starts with sector 1
> Information from DOS bootblock is:
> The data for partition 1 is:
> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
>     start 204834, size 35347011 (17259 Meg), flag 0
>         beg: cyl 12/ head 191/ sector 22;
>         end: cyl 164/ head 254/ sector 63
> The data for partition 2 is:
> <UNUSED>
> The data for partition 3 is:
> <UNUSED>
> The data for partition 4 is:
> <UNUSED>
> 
> % gpt -rvv show da0
> gpt show: /dev/da0: mediasize=18210037760; sectorsize=512;
> blocks=35566480
> gpt show: /dev/da0: MBR at sector 0
> gpt show: /dev/da0: Pri GPT at sector 1
> gpt show: error: bogus map
> gpt show: unable to open device '/dev/da0': No such file or directory

Ok. The "bogus map" error is an indication that you have both an
MBR partition and a GPT partition that overlap. Now the really
bad news: you cannot fix this easily, because we have a new disk
partitioning framework that tries to be helpful. It's designed
to be a pain in the ass :-(

The good news is that EFI still appears to exist. You should be
able to verify that with:
	# gpt -rvvvv show da0

Notice the increased verbosity. If you're lucky, it shows two
partitions before emitting the error, like:

itanium% sudo gpt -rvvvv show da0
gpt show: /dev/da0: mediasize=18400000000; sectorsize=512; blocks=35937500
gpt show: /dev/da0: PMBR at sector 0
gpt show: /dev/da0: Pri GPT at sector 1
gpt show: /dev/da0: GPT partition: type=c12a7328-f81f-11d2-ba4b-00a0c93ec93b, start=34, size=262144
gpt show: /dev/da0: GPT partition: type=516e7cb6-6ecf-11d6-8ff8-00022d09712b, start=262178, size=31480985

The important part is that the first partition has the same type
the one in my example. The second partition likely has a different
type.

Read the following completely before trying it out:

If we are sure the EFI partition is still valid (you can also
check that by going to the EFI shell and have fs0:) we can
update the GPT partition by removing the second partition (the
one I expect overlaps with FreeBSD -- not the EFI partition).
If the EFI partition is conflicting we have a bigger problem.
We can do this from within the EFI shell. Go to the URL
given below to download EFI disk utilities:

http://developer.intel.com/technology/efi/diskutil_overview.htm

I've not tried them seriously myself, but I believe you can
actually delete a GPT partition with the "diskpart" tool.

With the "diskpart" utility, remove all partitions, except the
EFI shell partition. iThis *should* be safe, because the FreeBSD
partition is defined by the MBR (at sector 0), not the GPT (at
sector 1). The only tricky part is that the diskpart utility
*may* be helpful and turn the MBR into a "Protective MBR". Don't
do that.

After the removal of the GPT partitions (except of course the EFI
partition), we should not have an overlap anymore. Which means that
you still have EFI, you still have the FreeBSD partition and the
"gpt show" command does not error.

I suggest that at this point you send me the output of
	# gpt show -rvvvv show da0

(The fdisk output should be the same)

This gives me a chance to see if the diskpart tool can create the
FreeBSD partition for us or if we need to do a magical trick...

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

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




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