usb_efi_boot notes

For a USB MultiBoot drive that can boot directly from ISO files, Windows Install ISOs (inc. XP to SATA drives), support linux persistence and boot multiple UEFI payloads, checkout Easy2Boot!

See and
Windows NT6 boot process in detail (from BIOS to Windows Login!)
Useful info on EFI System Partition (ESP) here.

Note: UEFI-booting under Virtual Box of Win7-64-bit may give issues (hangs on 4 coloured orbs) - use Clover instead of the VBox UEFI firmware!

EFI BIOS provides a shell environment. The shell can be used to execute other EFI applications.
UEFI does not rely on a working boot sector, but needs a special partition table referring to a special partition containing a specially located file with a standardized name depending on the actual architecture to boot (\EFI\BOOT\boot[architecture name].efi). It can also boot from a drive containing a single FAT partition (it does not need to be marked as Active/bootable - in theory).

Boot loaders are a class of UEFI applications. As such, they are stored as files on a file system that can be accessed by the firmware. Boot variables, stored in NVRAM, indicate the paths to the loaders. Boot loaders can also be auto-detected by firmware, for instance to enable booting on removable devices.

It is common for UEFI firmware to include a boot manager, to allow the user to select and load the operating system among the possible options. On EFI BIOSes, you will often see a boot device choice with '[EFI]' or similar appended to the end of a boot device - e.g.
  • Hard disk
  • CD/DVD - boot to CD\DVD in CSM\MBR mode
  • CD/DVD [EFI] - boot to CD\DVD in UEFI mode
Many other types of UEFI firmware prepend boot choices with UEFI: - e.g. UEFI: WD My Passport.
This indicates you can boot from the optical media either in MBR mode or EFI mode. Usually you will only be presented with EFI boot options if the BIOS has detected EFI boot files on a valid (FAT) partition on the boot device.

Before UEFI BIOSes, the older 'legacy' BIOSes used the MBR (Master Boot Record = first sector) and the partition table in the MBR to boot an OS from.
UEFI BIOSes can usually be set to boot from UEFI or MBR and most can also be set to boot from either (UEFI+MBR mode). Many BIOSes term the MBR setting as CSM (Compatibility Support Module) - in this mode they will boot from an MBR filesystem.

USB Booting to WinPE v3 (Win7/SVR2K8R2)

For EFI booting from drives, the MBR (first sector of the hard disk) is not used. It is usually present on EFI disks, but only for compatibility purposes. An EFI BIOS will boot directly from a file on a partition (by default '\EFI\BOOT\BOOTxxxxx.efi' - but it can be set to boot from any file). EFI BIOSes do not understand NTFS filesystems, so use FAT32 for the efi boot files.

1. Format a USB pen as FAT32.
2. Install WAIK on a Windows system and make a 64-bit WinPE version (32-bit Win 7 does not support EFI booting).
3. Copy WinPE files to the USB stick.
4. Copy USB files from \efi\microsoft\boot to a new \efi\boot folder.
5. Copy the bootmgfw.efi file to \efi\boot folder, and rename it to bootx64.efi - i.e. make a file \efi\boot\bootx64.efi - if you cannot find this file, boot to WinPE and copy it from X:\Windows\boot\efi

USB \efi\boot contents:
bootx64.efi (672,640 bytes)

USB \efi\microsoft\boot contents:
\fonts folder

6. Set BIOS to boot from EFI - if it boots as MBR then you can run a command to set it to boot to EFI next time (this programs the NVRAM):

bcdedit /set {FWbootmgr} displayorder {Bootmgr} /addfirst

7. Before running Windows Setup to install Windows in EFI mode, you need to ensure that you have booted in EFI mode, otherwise the correct GPT/ESP partitions will not be created.

Here are two methods to verify that the installer has indeed booted in EFI mode:

  • When you see the Install welcome screen, hit Shift+F10. This will open a command prompt. Run "notepad \Windows\Panther\setupact.log", and the log will show:
Code:Callback_BootEnvironmentDetect: Detected boot environment: BIOS
for a BIOS MBR boot

Code:Callback_BootEnvironmentDetect: Detected boot environment: UEFI
for a UEFI boot.

  • Open the command prompt with Shift+F10, but this time run diskpart. Use "list disk" to see all the disks on your computer, and type "select disk n" to select the disk with number n that you're going to install Windows to (usually 1). Type "clean" to clear the partition table, then run "convert gpt" to create a GPT partition table. Once that's done, close the command prompt and start the install process. When prompted for the disk to install to, choose the one that you just created a GPT partition table on. If no yellow exclamation mark warning appears, the installer will install Windows in EFI mode, creating the necessary EFI partitions and add the necessary bootloader entry to the EFI's NVRAM. Otherwise, you've booted in BIOS mode and the installer will not let you install to a GPT disk.
You can run a small exe to see if you are in Legacy mode or UEFI mode

Additional Info