16

Is EFI booting something hardware specific? I have a desktop motherboard with a UEFI Bios, but I can only boot from USB drives in "UEFI" mode. Both the DVD drive and the HDD's (a RAID 0 array) boot only on legacy mode. Do the HDDs need to have a GPT partition table in order for them to boot in UEFI mode?

1
  • I think you meant: Your available options in UEFI-only mode are just USB drives. Not that: You see USB drives just in UEFI-only mode and not in BIOS-mode. Commented Jun 8, 2020 at 23:38

5 Answers 5

11

(U)EFI-based systems, by specification, can only boot from GPT-style disks. The traditional BIOS can boot from MBR-style disks, and in some cases (depends on the manufacturer), they can also boot from GPT. However, as per the UEFI specification, the disk should have a GPT partition table.

This MSDN article describes it well:

Systems that support UEFI require that boot partition must reside on a GPT disk. Other hard disks can be either MBR or GPT.

9
  • Then how do I boot from a DVD in UEFI mode?
    – joaocandre
    Commented Mar 8, 2013 at 22:27
  • 2
    @joaocandre the EFI shell itself is compatible with a typical bootable DVD. CD/DVDs do not use MBR/GPT style partition schemes, so they are not affected by this change. The EFI shell will look for the relevant firmware images on the disk, and then proceed to boot using the ones it found. Commented Mar 8, 2013 at 22:42
  • Problem is, when I set boot mode to "UEFI" only in BIOS, I cannot boot from the DVD drive.
    – joaocandre
    Commented Mar 8, 2013 at 22:46
  • 2
    As a practical matter, at least some EFIs can boot from MBR disks. Certainly some (but not all) of my EFI-based computers can boot from USB flash drives partitioned with MBR. I don't believe I've tested with hard disks, though. Despite its 2000-page length, there's a lot omitted from the EFI spec, and differences in the rules that specific EFIs use to determine boot mode (BIOS/legacy vs. EFI) have slipped into those cracks, which explains inconsistencies in whether specific DVDs or hard disks boot in BIOS/legacy vs. EFI mode.
    – Rod Smith
    Commented Mar 9, 2013 at 23:13
2

No. The globally unique identifier (GUID) for the EFI system partition in the GUID Partition Table (GPT) scheme is C12A7328-F81F-11D2-BA4B-00A0C93EC93B, while its ID in the master boot record (MBR) partition-table scheme is 0xEF. So it perfectly works as it must from the spec.

"Officially the UEFI 2.x spec requires support for both GPT and MBR partitions. Pages 324 (9.3.6.1), also 72, 113–115, 539, etc"

And also "The UEFI specification requires MBR partition tables to be fully supported. However, some UEFI implementations immediately switch to the BIOS-based CSM booting upon detecting certain types of partition table on the boot disk, effectively preventing UEFI booting to be performed from EFI system partitions contained on MBR-partitioned disks". https://en.wikipedia.org/wiki/EFI_system_partition

Also see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821341

1

Is EFI booting something hardware specific?

Yes. Some implementations, especially older ones or those from OEM-locked-down motherboards are more likely to be restricted or buggy.

Do the HDDs need to have a GPT partition table in order for them to boot in UEFI mode?

Technically no, but in your case, "probably, plus you need some other things(notably EFI files and EFI variables)". Here's the long answer (also for anyone else stumbling upon this in the future):

A frequent question that people ask is "Can I UEFI boot from an MBR disk?" The answer is "yes, but it's very tricky." While it's technically possible in the right environment, many things will prevent you from doing so, such as a UEFI environment that adheres very tightly to the spec, or the Windows installer that will insist on installing to the correct type of partition table.

First things first, optical media is not part of this discussion at all. It generally uses a system like ISO9660 or UDF, which lies completely outside of the MBR/GPT realm.

Secondly, removable media tends to be handled a little bit differently than fixed disks. Most UEFI implementations will be much more tolerant of removable ad-hoc UEFI bootable disks than they will be of fixed disks.

That being said, here's how a typical UEFI system will enumerate the bootable devices:

  • If UEFI booting is enabled:

    • Look in EFI variables to see if there's any configured boot entries.

      Most OSes will create pointers to their boot files within the EFI variable system. These variables are stored in the EFI NVRAM.

      Most OSes will also take the extra step of creating an EFI System Partition and storing their boot files there instead of on the main OS volume. This improves flexiblity a little, but also works around a glaring problem with the typical UEFI system: Only FAT32 partitions are natively supported.

    • Look for any removable drives with an EFI file like "\EFI\BOOT\BOOTX64.EFI" Remember, most UEFI systems can only read from FAT32, so if your removeable drive is NTFS or something else, it probably won't find the boot files.

    • Enumerate all optical drives, regardless of whether they have EFI bootcode or not.

  • If BIOS or CSM booting is enabled:

    • Enumerate all fixed disks, regardless of whether they have a valid MBR
    • Enumerate all removable disks, regardless of whether they have a valid MBR
    • Enumerate optical drives, regardless of whether they have a bootable disc.

There are a few other things not covered by the above, like Option ROMs, PXE boot, etc.

And now some observations on the above process. For starters, optical drives tend to show up all the time, regardless of boot mode. This is usually because neither BIOS nor UEFI systems want to wait for the disc to spin up before continuing with boot. They also tend to show as bootable in both modes simultaneously, so if you have a disc that can boot both ways, you can select one or the other from your BIOS's boot menu.

Because it's a bit hard to programmatically determine whether a drive (fixed or removable) contains valid MBR bootcode, if a system has BIOS or CSM boot available, it tends to just allow booting from any of the disks currently present. However, this is probably the answer to one part of your issue: While most systems should treat a USB stick almost like a fixed disk, perhaps your system is treating it differently. For example, some BIOSes will treat a USB device exactly like a fixed disk, and you may need to adjust the "hard disk boot order" or some such control in the BIOS. Or perhaps your BIOS is locked down or broken, and does not realize that it can be booted in BIOS mode. Some additional pointers: Try pluggin the drive into a USB 2.0 instead of 3.0 port, and enable USB compatiblity options in the BIOS. Some BIOSes have trouble natively working with devices behind third-party USB or ATA controllers, like you find on machines that don't have USB3 integrated into the chipset.

With the advent of EFI, it's now easy for a system to determine what boot devices should be available (by looking at the EFI variables containing boot entries), as well as determine if a specific drive actually contains bootcode (by looking for the presence of a BOOTX64.EFI file). However, this leads to some interesting caveats. While officially an EFI system is supposed to only look for EFI files in GPT disks, most of the time it'll look elsewhere as well. For example, you can copy a Windows 7 or newer installation disc to a FAT32 USB stick, and it'll probably boot just fine in EFI mode. The UEFI is smart enough to check for the presence of the "\EFI\BOOT\BOOTx64.EFI" file in all removable disks, even though no corresponding EFI variable is present in the NVRAM. Most UEFI systems will also boot from an MBR disk just fine, as long as there's EFI variables with the details about where to go and what to do. For example, right now I'm using a Dell laptop that came from the factory with Windows 8.1 booting in UEFI mode with Secure Boot, but the disk was partitioned as MBR.

Some other funny things that can happen: If you install an EFI aware OS like Windows or Ubuntu, it'll create the appropriate EFI variables when installing its bootloader. Then, if you remove or wipe the drive, the system will have the EFI variables, complete with the name of the OS, but cannot boot to them because it cannot find the disk that the variables reference. Also, if you take a fully functioning EFI-bootable disk from one computer to another, it may not boot as seamlessly as an MBR one will. Many UEFI implementations will not allow you to even attempt booting from a fixed disk in UEFI mode if corresponding variables are not present in the NVRAM. This is why your RAID array or other fixed hard drives may not appear in the boot menu as UEFI entries until they have all the proper structures in place, like the EFI variables.

However, given your exact set of issues, I'd chalk most of your problems up to a broken BIOS more than a problem with your setup. Notably, for a USB drive to appear as a UEFI device but not a BIOS device is very strange. Have you turned off Secure Boot and enabled any CSM or BIOS boot options? Also, for your optical drive to show up as a BIOS option but not a UEFI option seems a bit strange, though not unheard of.

2
  • 3
    Officially the UEFI 2.x spec requires support for both GPT and MBR partitions. Pages 324 (9.3.6.1), also 72, 113–115, 539, etc. Commented Aug 31, 2016 at 5:05
  • 1
    This is a good answer. Why the downvote? I think the OP meant: Available options in UEFI-only mode are just USB drives. Not that: USB drives are seen just in UEFI-only mode and not in BIOS-mode. Commented Jun 8, 2020 at 23:36
0

UEFI does effect how OS's boot. You need to have space allocated for the UEFI on the harddrive. I believe with most Linux operating systems this is either done automatically or you must create a partition to host the UEFI.

2
  • 2
    The UEFI itself is a firmware image uploaded to the motherboard itself, and has nothing to do with the actual disk. Commented Mar 8, 2013 at 22:24
  • Yet it does need a partition
    – Griffin
    Commented Mar 8, 2013 at 22:25
0

Here is what's on MSDN.

Is UEFI required for a GPT disk?

"No. GPT disks are self-identifying. All the information needed to interpret the partitioning scheme of a GPT disk is completely contained in structures in specified locations on the physical media."

1
  • This seems to be the opposite of the question: The question states: Is GPT required for UEFI? And your answer answers the question: Is UEFI required for GPT?
    – zx485
    Commented Jun 30, 2021 at 22:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .