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 08:54:16AM +0200, tlaronde a écrit :
> Hello,
>
> On my workstation are several disks. The first one is legacy MBR
> partitioned. A second one has been partioned using GPT.
>
> The BIOS allows legacy+UEFI for booting. I boot generally from the first
> disk, where NetBSD is installed and I want to test UEFI, using the
> second one.
>
> I have added, via gpt(8), and EFI system partition as the first index
> in the GPT partitioned disk but when entering the UEFI shell (from the
> BIOS), the partition is not recognized as a "simple filesystem" (a FAT)
> and I can not list it or load UEFI programs from it.
>
> During my experiments, I used gpt biosboot too, and the GPT PMBR has the
> active flag set. I wonder if this is not the problem, the PMBR being in
> fact more or less recognized as implying use "legacy" for it which could
> explain why only four partitions are listed as blk devices in the UEFI
> shell while there are nine of them in the GPT.
>
> But there doesn't seem to be an option to unset the active flag on the
> PMBR---and using fdisk(8) is _not_ the answer (I have tried it), since
> if one uses it and rewrite the (P)MBR, the GPT is lost (`gpt restore'
> doesn't even see the backup copy of the GPT stuff so, fortunately,
> I had `gpt backup' before...).
>
> Has anyone already faced such situation and does anyone know how to
> remove the active flag from the GPT PMBR without breaking everything?
>
> This flag is probably set in the file generated by `gpt backup' but
> where? In what looks like the MBR binary transcription (code)?
I'm replying to myself:
1) Setting the PMBR active _does_ prevent (at least my BIOS) from
booting UEFI mode from the disk even if it has a valid GPT, even in UEFI
only boot mode (in legacy+UEFI this could be considered normal: trying
MBR first and having one, using it even if a GPT is there);
2) Unsetting the active flag can be done the hard way (using a SATA wd1
as example):
$ gpt backup wd1 > wd1.plist # in case...
$ dd if=/dev/rwd1d count=1 > wd1.mbr
$ fdisk -a -r wd1.mbr # unsetting by selecting 4 as the active part
# dd if=wd1.mbr of=/dev/rwd1d count=1 # belt and suspenders
Then I have access to the EFI file system and could use an *.efi program
to bootstrap an OS.
Trying, in wd1.plist, to set in the MBR section, flag to 0 (it was 0x80)
has no effect when trying to restore with the plist: the active flag is
still set(?).
FWIW,
--
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