Port-amd64 archive

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

Re: How to control booting via BIOS vs booting via EFI?



Hi Martin,

Many thanks for your response.

On 12 Oct 2025, at 18:36, Martin Husemann <martin%duskware.de@localhost> wrote:

I would be suprised if NetBSD/xen could not boot via UEFI but actually all
my xen machines still use BIOS boot (mostly for historical reasons).

We have multiboot2 support, so technically it is unclear to me why xen
would fail.

While I would very much like that to be true, I simply do not understand enough of the boot magic to have an opinion other that “it seems not to work”.

However, unrelated to that: you can force BIOS boot by installing from
the amd64-bios-install.img[1] USB image and removing all existing partitions
starting from scratch.

Tried that; didn’t work. That image is not considered as bootable by the firmware (it is as expected a pure traditional MBR-partitioned BIOS-boot image). It seems clear that the firmware does not boot such things.

Or you can manually modify your exixting setup by something like:

- remove the EFI partition (details depend on whether you used MBR
  or GPT partitionining)
- install the proper first stage booloader (either via "gpt biosboot"
  or by "installboot" if using MBR)
- copy /usr/mdec/boot to / on the NetBSD root partition

I had already done the two latter things (and then the system still does an UEFI-boot). Now I also did the first (removing the EFI boot). I did not remove the entire partition, I only moved the directory /efi/boot/ to /efi/boot.no/. After this the system doesn’t boot at all from this disk.

The mystery remains: exactly what magic is on the disk that enables either system to do a BIOS-boot? The disk uses GPT partitioning, it has the EFI bootloader in the original place (/efi/boot/bootxx64.efi) and in general seems to be identical to a disk that I install from the netbsd-10 installer.

As the pure MBR install image wasn’t recognized as bootable it seems that GPT is clearly a requirement (which presumably is to be expected by a UEFI-system). Question is what else is needed.

Regards,
Johan

1) https://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-10/latest/images/NetBSD-10.1_STABLE-amd64-bios-install.img.gz
or https://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-11/latest/images/NetBSD-11.0_BETA-amd64-bios-install.img.gz



Home | Main Index | Thread Index | Old Index