NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GPT and UEFI booting



Le Tue, Apr 05, 2022 at 12:54:40PM +0200, Martin Husemann a écrit :
> On Tue, Apr 05, 2022 at 12:28:16PM +0200, tlaronde%polynum.com@localhost wrote:
> > No. This affects only a GPT partition not the "whole" pseudo-partition
> > put as a MBR first slot. One can set these flags without flagging the
> > PMBR as active, so...
> 
> This is a grey area - the UEFI spec requires the "active" byte in the PMBR
> to be 0x00 (section 5.2.3 Protective MBR, table 5-4 BootIndicator), to
> make sure a non-UEFI BIOS does not consider this a bootable partition
> and then says "Must be ignored by UEFI implementations".
> 
> However, buggy UEFI seems to exist, so the gpt "create" command grew the -A
> option to mark the PMBR entry covering the whole GPT disk as "active".
> 
> This is meant for expert use firmware bugs workarounds, and there seems
> to be no official way to toggle it off again. You can play tricks with dd
> to write a 0 byte to the proper offset ;-}

Or as I have explained in an answer to my own initial mail, copy
the first block holding the PBMR; unset the active flag using
fdisk(8) on this file (-r pmbr.blk); and put back this first block
on the disk (using fdisk(8) will whether flag the disk as MBR in
the kernel and block the use of GPT(?) or trash the GPT---the fact
being that, without rebooting, in the same session, if fdisk(8) has
been used on the GPT partioned disk, gpt show the_device does not work
and gpt recover does not work either).

I have found, since, that there is at least one bug report on FreeBSD
stating too that once the active flag is set in the PMBR, at least
some UEFI aware BIOSes do not consider anymore the GPT (in my case even
when booting in pure UEFI mode).

And for the record, I have also set the "required" flag on the EFI
System partition; but have not tested if, when not set, there is a
problem with the UEFI shell.

The lesson is that one can, indeed, mix MBR disks and UEFI/GPT disks,
and use accordingly various booting methods when the BIOS supports
legacy+UEFI with a PMBR in the GPT partitioned disks, as long as the
active flag is not raised.
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
                       http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index