Date: Fri, 10 Aug 2012 11:14:11 +1000 From: Lawrence Stewart <lstewart@freebsd.org> To: "Andrey V. Elsukov" <ae@FreeBSD.org> 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: <50246063.2080604@freebsd.org> In-Reply-To: <5023C723.90606@FreeBSD.org> References: <50237B73.9040301@freebsd.org> <5023979B.4010903@yandex.ru> <5023A907.7060800@freebsd.org> <5023C723.90606@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
On 08/10/12 00:20, Andrey V. Elsukov wrote: > On 09.08.2012 16:11, Lawrence Stewart wrote: >>>> - 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. > > When you create GPT it already has PMBR, because it is part of GPT > metadata. gpart's `bootcode' subcommand writes *bootcode* to specific > area in the PMBR. Right, I had a fundamental misunderstanding about the relationship between the pmbr and GPT. Thanks to you and Marcel for setting me straight on this. >>>> - 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. > > In the EFI system partition might be several boot loaders, and this MS > bootloader's behaviour seems strange to me. > >> 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. > > Don't confuse bootcode in the PMBR and PMBR. Despite my misunderstanding about the relationship between the pmbr and GPT, I still stand by my assertion that gpart is not behaving very well here, but more on that in my follow up to Marcel. Cheers, Lawrencehome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50246063.2080604>
