1

I am reading through the UEFI standard: https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf

On page 115 section 5 it discusses the GPT disk layout. I'm a bit confused as to exactly how this works. From the below it sounds like UEFI will ignore the MBR.

A legacy MBR may be located at LBA 0 (i.e., the first logical block) of the disk if it is not using the GPT disk layout (i.e., if it is using the MBR disk layout). The boot code on the MBR is not executed by UEFI firmware.

So is this basically saying if you put the firmware in legacy boot mode, this is how to define an MBR which will play nicely with that legacy boot mode? Am I correct in saying that if the system's firmware were in UEFI mode then a system with an MBR defined as specified in chapter 5 would not be bootable?

1 Answer 1

1

So is this basically saying if you put the firmware in legacy boot mode, this is how to define an MBR which will play nicely with that legacy boot mode?

Yes, it's possible to have a disk that's boot table in both BIOS and UEFI mode. Many tools to create a bootable USB stick can do that

Am I correct in saying that if the system's firmware were in UEFI mode then a system with an MBR defined as specified in chapter 5 would not be bootable?

No, that part of the spec only says The boot code on the MBR is not executed by UEFI firmware which means the the 446-byte region in the MBR containing the binary instructions for booting the system won't be run in UEFI mode

It's still possible to boot from an MBR disk in UEFI mode if you create a proper ESP (EFI System Partition) on it. UEFI systems only boot executable images in the ESP

So by putting a proper BIOS boot loader in the MBR and a UEFI boot loader in the ESP you can have a disk that boots in either mode

8
  • Ah so if the MBR is formatted as specified then UEFI firmware would know how to read it, find the ESP, and then run that? Apr 21 at 18:49
  • If booting via MBR, then you are using the BIOS/Legacy/CSM mode in UEFI. If UEFI Secure boot is on, there is no legacy/CSM mode. And very new systems do not have CSM. CSM - UEFI Compatibility Support Module (CSM), which emulates a BIOS mode, only available with secure boot off. Lenovo announced all 2020 products will be UEFI only (UEFI Class 3 or no CSM). support.lenovo.com/us/en/solutions/…
    – oldfred
    Apr 21 at 19:14
  • @oldfred it's not true. Who said that CSM boots from the ESP? It's boot sequence is the same as BIOS. Only UEFI boots from ESP and ESP can be on a GPT or an MBR disk. Lots of bootable pen drives are created that way for installing OSes on a UEFI system. Just like BIOS can boot GPT disks, UEFI can also boot from MBR disks. The disk format has nothing to do with the firmware
    – phuclv
    Apr 22 at 1:09
  • Windows only boots in UEFI mode from gpt and only in BIOS mode from MBR. Ubuntu will boot in either mode from either partitioning, if proper supporting partitions are on drive. If UEFI, you must have an ESP, or if BIOS on gpt you must have a bios_grub partition. Only old BIOS boot on MBR does not require any extra partitions as boot code is in MBR and sectors just after MBR. That space does not exist with gpt, so gpt needs the bios_grub partition. UEFI does highly suggest gpt. And some advantages to gpt with BIOS boot also. Windows boot mode defines partitioning and many are dual booting.
    – oldfred
    Apr 22 at 2:33
  • @oldfred that's a limitation of the Windows bootloader and has nothing to do with UEFI specs which this question is about. UEFI allows booting from both GPT and MBR, period. MS simply chose not to bother spend effort writing a GPT bootloader for BIOS
    – phuclv
    Apr 22 at 4:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.