Table of Content
- Presentation
- Specifying boot devices in BIOS mode
- Specifying boot devices in UEFI mode
- Specifying Boot devices in practice
- The Boot override section
- Windows UEFI boot sequence detail
- Where are UEFI information stored
- Creating GPT Disk Partitions
- Windows 7 X64 Installion on GPT Disk
- UEFI / GPT Caveats
- Open Questions
- References
This page is under development
Presentation
The Asus P8P67 Deluxe motherboard uses an UEFI firmware to boot the system. Compared to the well-known BIOS firmware it provides many new features like nicer GUI, faster boot time, but more importantly it support booting in UEFI mode from GPT disks. This last capability is becoming essential as many new drives with a capacity of 2.5TB and 3TB are now available (MBR disks capacity is limited to 2TB).
The UEFI firmware of the Asus motherboard allows starting the system using an UEFI boot sequence or a standard BIOS boot sequence. The BIOS capability is provided to boot legacy OS like Windows XP. Therefore the Asus UEFI firmware provides a new set of options to specify boot devices and priorities which is somewhat different from what you find in classic BIOS. In this document we will present the Asus boot options, how to partition a GPT disk, how to install Windows 7 X64 in UEFI mode, and how to boot in UEFI mode.
Note that the Asus implementation of the boot sequence is more flexible than many other implementations. With the Asus UEFI firmware the boot mode is automatically selected by the targeted boot file/device without user intervention. In contrast most of the other implementation will require the user to enter the BIOS and specify the boot mode for switching between legacy OS and “UEFI OS”.
Specifying boot devices in BIOS mode
In the BIOS mode the boot devices are organized by type of devices (Hard Drives, CD/DVD, and Network). For each type it is possible to define a boot order. This is done in the Boot Menu of the UEFI setup program by clicking on the corresponding BBS (BIOS Boot Specification) priorities entry located at the bottom of the Boot Menu page (you may have to scroll down to find them).
For example if you click on the Hard Drive BBS Priorities you will enter a submenu that presents all the drives connected to the system. Here you can define the boot order for the Hard disks. For example you can specify an SDD as the first priority (Boot Option #1) and a HDD as the second priority (Boot Option #2). This implies that the system will first try to boot from the SSD and if this fail it will try to boot from the HDD.
The same prioritization procedure can be used for the CD/DVD as well as for the Network devices.
Note that the Network Devices BBS Priorities entry only shows up if you have enabled the LAN (Intel / Realtek) Oprom options.
Once you have defined the ordering for each type of devices you need to specify the overall priority. This is done in the Boot Option Priorities section of the Boot Menu. For example you can define to use the CD/DVDs first (Boot Option #1) and then to use the HDs after (Boot Option #2). Note that in the menu displayed you will only see the device with the highest priority for a specific type. For example if you have several HDs you will only see the highest priority one (the SDD in our previous example).
Using the above examples the boot manager would first try to boot from the CD/DVD. If this fails it would try to boot from the SDD and if this fails it would try to boot from the HDD.
Specifying boot devices in UEFI mode
The way boot options works in UEFI differs from legacy BIOS. The UEFI boot option:
- Specifies the location of a file on a device as boot target (vs. device in BIOS)
- Is automatically created by the OS during installation and points to the boot file
- Provides a predetermined boot path for removable devices.
Therefore during initialization the Asus firmware looks for UEFI boot files on removable devices (maily CD/DVD or USB stick). If such devices are present and contain the appropriate efi file in the appropriate directory they appear in the Boot Option Priorities section. The name of the devices is prefixed with “UEFI:” string. For example if you have inserted a Windows X64 installation disk in your DVD drive you will now have two entries for the DVD drive and the second entry will be prefixed with UEFI: . Selecting the first one will boot the system in BIOS mode while selecting the second one will boot the system in UEFI mode.
You will probably also find special UEFI entries that are added by the OS during installation. This information is stored by the OS into NVRAM and is displayed by the Asus firmware. You will not find any description for them in in the Asus documentation as they depend on the software installed by the user. For example if you install Windows 7 X64 on a GPT disk then a “Windows Boot Manager” entry is proposed as an option but another OS could have added a “Ubuntu Boot Manager” entry.
All the entries prefixed by UEFI: can be prioritized in the Boot Option Priorities section of the Boot Menu. However this is not really useful as the first one should always be used.
Of course in UEFI mode the BBS specifications are totally ignored as the order of the boot sequence is now defined by the EFI boot manager. In the case of the Windows boot manager the order is defined in the BCD store. You can use the bcdedit utility to display or modify these special entries (e.g. bcdedit /enum firmware).
Specifying boot devices in practice
If you do not use the UEFI boot capability then you should first define your boot drive in the HD BBS priorities section and then specify if you prefer to boot from the HD first or the CD/DVD first in the Boot Option Priority section.
If you need to boot from a GPT disk then you probably want to define the “Windows Boot Loader” as your first priority boot option and mostly ignore anything else.
The Boot Override section
This section of the Boot Menu allows booting from a specific device immediately. Therefore you should see an entry for all bootable devices including the UEFI boot devices.
This list contains the same entries as the menu list presented by pressing the F8 key during post.
Windows UEFI boot sequence detail
Assuming you have installed Windows 7 X64 on a GPT disk, the following boot sequence happens:
- The UEFI firmware of the Asus motherboard will first initialize the hardware
- The UEFI boot manager will now load the boot application as pointed by the Boot Option Priorities. In case of Windows on GPT disk this should be the Window Boot Manager entry.
- The Windows boot manager presents the user with a screen where he/she can select the instance to use and loads the Windows OS loader selected. Note that if there is only one instance of Windows the Windows Boot Manager calls directly the Windows OS Loader without user interaction.
- The Windows OS loader loads Windows and gives control to the Kernel
Where are the UEFI Boot information stored
- The specifications of the UEFI boot file and options are stored in NVRAM. For example the Windows Boot Manager entry of the Asus UEFI points to the Windows Boot Manager file on the GPT disk. This file is called bootmgfw.efi and is located in the \EFI\Microsoft\Boot directory of the ESP System partition (FAT32 hidden partition).
- The Windows Boot Manager loads the BCD store to get a list of boot options and displays eventually a boot menu to the user based on this information. It then calls the Windows OS Loader. The BCD file is located in the same directory as the boot manager file and abstracts all the information in the NVRAM. In particular the NVRAM boot entries are cached in the BCD store. Manipulating the {fwbootmgr} entry with bcdedit automatically updates the NVRAM.
- The Windows OS loader is located in the \Windows\system32 directory of the selected Windows partition and is called winload.efi
Creating GPT disk Partitions for Windows
The following procedure describes how to create a GPT disk and to create 3 Primary partitions. This would allow for example to install Windows 7 on the first and second one and to keep the third one for user data. In order to be used with Windows, a GPT disk must also contain two hidden partitions called the ESP (EFI System Partition) and the MSR (Microsoft reserved) and they must be placed in this order and before the primary partitions.
For partitioning the GPT disk we are going to use the Windows diskpart utility. This utility can work with any type of Disk (HDD & SDD) and handle correctly large disk above 2TB as well as disk using Advance Format (4K size blocks) or 512e Format (especially in term of alignment). The following operations can be done prior to the Windows installation or during the installation (as described below).
Be very careful when using the diskpart utility as it can remove all information on a disk and/or partition without warning or confirmation.
The utility needs to be started from a command shell with the administrator rights. Type diskpart to get the diskpart> prompt.
- Type: list disk to locate the disk you want to use. Let’s assume that you want to use disk 1.
- Type: select disk 1 to select the disk to clean
- Type: clean to remove any information on the disk (everything removed! No confirmation!)
- Type: convert gpt to convert the MBR disk to a GPT disk
- Type: create partition efi size=100 to create the ESP partition
- Type: create partition msr size=128 to create the MSR partition
- Type: create partition primary size=60000 to create a first data partition of 60GB
- Type: create partition primary size=60000 to create a second data partition of 60GB
- Type: create partition primary to create a third data partition that will occupy the rest of the disk
- Type: list partition. This should display the partitions on the disk: the System Partition, the Reserved partition and the three Primary partitions
- Type: exit to quit the diskpart utility.
Note that if you want to create a GPT disk with only one Primary partition that occupy the complete disk you do not need to pre-partition the disk as the Windows installation will take care of this for you. In that case you can use the diskpart utility just to clean the disk and then convert it to GPT.
Back to TopWindows 7 X64 Installation on a GPT Disk
- Start your system, enter the Asus BIOS and select the Boot Menu and go to the Boot Override section. Click on the UEFI entry that corresponds to the Windows installation media. Alternatively you can hit the F8 key during boot to enter the boot device selection menu. In this menu select the UEFI entry that corresponds to the Windows installation media.
- You should see “Press any key to boot from cd…” hit space (note that this does not show if you boot from an USB stick). You now enter the standard Windows setup procedure: select language and click install now. In the type of installation select custom install.
- The next screen displays all the disks with all their partitions and allows you to specify where you want to install Windows.
- If the GPT disk has already been pre-partitioned using the procedure explained above you only need to select the partition where you want to install windows. Of course this should not be the System or Reserved partition but one of the Primary partitions. Click Next.
- If the disk has not been partitioned the way you want (or not yet converted to a GPT disk) type SHIFT-F10. This will open a command shell as an administrator and here you can use the procedure described above. Once you are done with the diskpart utility close the cmd window by typing exit and click the refresh button to display the partitions you have just created. If you have fully partitioned the disk, you just have to select the Primary partition where you want to install Windows. Otherwise (in the case you only converted the disk to GPT without creating partition) you have to select the unpartitioned disk that should be marked as “Unallocated Space”, and the Windows installation will automatically create the ESP, MSR, and one Primary partition for you. Click Next
- The standard Windows installation takes place and should reboot your system after copying files to the disk. At reboot do not press any key. The system will automatically reboot to the newly installed partition and finish the standard Windows Installation. Note that if you have installed Windows on several partitions the Windows Boot Manager will present a screen that allows you to select which instance you want to use and in that case you should stay on the first one.
UEFI / GPT Caveats
- In order to be detected as “UEFI bootable” a device needs to have a specific EFI file in a specific location. For example if you place a Windows 7 X64 DVD installation disk in your DVD drive it will be recognized as an UEFI boot device and you will be able to perform the Windows installation in UEFI mode. In contrast a Windows 7 X86 DVD installation disk does not have the appropriate efi file and therefore in that case the DVD will not be displayed as an UEFI boot device.
- Beware that you cannot boot in UEFI mode from an USB stick formatted in NTFS (UEFI do not handle NTFS partitions). For example a Windows 7 X64 Installation USB Stick created using the “Windows USB DVD Download” tool provided by Microsoft will not boot in UEFI (but work well in BIOS legacy mode). Therefore you have to format the USB stick in FAT32, make it bootable, and copy the proper files in the proper location (see references at the end) so you can successfully install Windows 7 X64 in UEFI mode from it.
- UEFI Boot Options are stored in NVRAM on a system. When an operating system installer executes, it creates a boot option for the operating system in the system’s NVRAM. If the hard disk which contains the operating system is removed and transferred to another system, this new system will not have the boot option in its NVRAM, and a user will not be able to boot to the operating system.
- For the same reason if the disk configuration of a system booting in UEFI is changed (for example if you add another disk with an already installed Windows 7) the Windows boot loader will get confused and in most cases you will end up with the error code 0xC0000225. Unfortunately in that case the Windows repair utility will not fix the problem and may even end up breaking your MBR boot sequence! Fixing this kind of situation is hard and beyond the scope of this short presentation.
Open Questions
- How do I remove the Windows Boot Manager entry from the boot options if for example I have removed the GPT drive with Windows. Several vendors provide a delete boot option?
- Not yet clear on how to fix the BCD/NVRAM if disk configuration on system is changed (add/remove disks) in UEFI mode.
Useful References
- Traditional BIOS versus UEFI/EFI Framework - an overview
- Using GPT Drives
- Windows and GPT FAQ
- Hitachi Deskstar 3TB Hard Drives FAQ
- WD drives with Advanced Format
- Installing Windows from USB Stick to a GPT Drive