Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2012 20:14:09 +1000
From:      Lawrence Stewart <lstewart@freebsd.org>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>, ae@freebsd.org, Marcel Moolenaar <marcel@freebsd.org>
Subject:   Re: gpart rewrites pmbr in a way which breaks Win 7 EFI bootloader
Message-ID:  <5024DEF1.3050900@freebsd.org>
In-Reply-To: <50246E2C.1070604@freebsd.org>
References:  <50237B73.9040301@freebsd.org> <5023979B.4010903@yandex.ru> <5023A907.7060800@freebsd.org> <C43A8456-1B69-47BE-AFB5-3288CD16E789@xcllnt.net> <50246E2C.1070604@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/08/2012 12:13 PM, Lawrence Stewart wrote:
[snip]
> Taking my desired HP configuration as the example:
>
> - Win 7 installed as an EFI boot source
>
> - FreeBSD doesn't have EFI boot support, so it has to be installed to
> boot via pmbr bootcode + gpt(zfs)boot in a freebsd-boot GPT partition
>
> - In the HP's firmware config, I choose whether to try boot from EFI or
> "legacy" (BIOS) sources first. Currently I try from EFI first.
>
> - In this arrangement, the firmware starts in EFI mode and will always
> boot Win 7 as it's the only bootable EFI payload installed.
>
> - Using the F9 key on boot, I get a menu to choose the boot source, and
> with FreeBSD installed to boot via pmbr bootcode + gpt(zfs)boot, the
> only way to get FreeBSD to start is to select "Legacy HDD" as the boot
> source, which switches firmware to BIOS and boots from the bootcode in
> the pmbr, which in turn executes gpt(zfs)boot from the freebsd-boot GPT
> partition.

I just wanted to confirm for posterity's sake that as of a few hours 
ago, the above set up does actually work. I have Win 7 installed using 
GPT + EFI boot. I booted into a FreeBSD 9.1 CD live filesystem and used 
"gpart -b /boot/pmbr -p /boot/gptzfsboot -i 6 raid/r0" to install first 
stage boot code into the pmbr and second stage boot code into my 
freebsd-boot GPT partition. I installed a ZFS-based FreeBSD set up into 
it's own GPT partition. I then tweaked the pmbr using my dd + vim trick 
to unset the active flag.

I can now boot successfully from Win 7 EFI bootloader or, if I select 
"Legacy HDD" from my HP's boot menu, it will happily boot my FreeBSD 
install from the kernel living in my ZFS root.

It's good to confirm this actually works as I expected it would, but I 
guess we need to make some changes in order to address this issue 
completely, including all the edge cases.

Cheers,
Lawrence



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