Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Aug 2012 22:11:51 +1000
From:      Lawrence Stewart <lstewart@freebsd.org>
To:        "Andrey V. Elsukov" <bu7cher@yandex.ru>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>, Marcel Moolenaar <marcel@freebsd.org>
Subject:   Re: gpart rewrites pmbr in a way which breaks Win 7 EFI bootloader
Message-ID:  <5023A907.7060800@freebsd.org>
In-Reply-To: <5023979B.4010903@yandex.ru>
References:  <50237B73.9040301@freebsd.org> <5023979B.4010903@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Andrey,

On 08/09/12 20:57, Andrey V. Elsukov wrote:
> On 09.08.2012 12:57, Lawrence Stewart wrote:
>> After identifying the cause of the problem and a workaround (please see the README.txt at the above
>> URL for full details and pre/post gpart dumps of the MBR+GPT), I have the following questions:
>>
>> - Should gpart be writing 0x80 (active) in the protective MBR entry?
> 
> AFAIK, this was added because some BIOS could not boot without it.

Makes sense if gpart is writing the pmbr out i.e. "gpart bootcode -b
/boot/pmbr <geom>", but manipulating an existing pmbr for a GPT specific
subcommand smells dodgy to me.

>>   - Why is Windows EFI bootloader so sensitive to 0x80 in pmbr?
> 
> This question you should ask to the Microsoft. :)

Perhaps I should rephrase my question as:

Is the MS bootloader's behaviour reasonable/unreasonable based on what
people know of the relevant specs? My current guess why it behaves like
this is that if it sees an MBR partition marked active, it simply
assumes another OS is in charge and therefore bails out at the Windows
EFI boot stage.

>> - Should gpart be silently rewriting the protective MBR entry at all when only asked to make changes
>> to the GPT?
> 
> The PMBR is part of GPT metadata described in the UEFI spec. So, I think it can.

Can and should are two different things. I would argue it's a POLA
violation at the very least to manipulate the pmbr when the user asked
for something else. I certainly started my hunting expecting to find the
GPT changing in some subtle way when FreeBSD wrote it out compared to
what Windows writes.

We have a specific gpart command to put a pmbr in place so I think it's
reasonable to expect other GPT specific commands not to fiddle with the
pmbr.

Cheers,
Lawrence



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