UEFIGuide

Embed Size (px)

Citation preview

  • 8/12/2019 UEFIGuide

    1/19

    Installing Windows onUEFISystems

    June 13, 2012

    Abstract

    The Windows operating system supports Unified Extensible Firmware Interface

    (UEFI)-based platforms. This paper provides guidelines for system manufacturers

    and IT administrators to prepare and install Windows on UEFI-based computers by

    using either of the following tools:

    Windows Setup

    Windows deployment tools, such as the Windows Assessment andDeployment Kit (Windows ADK), the Windows OEM Preinstallation Kit

    (Windows OPK), or the Windows Automated Installation Kit (WAIK).

    To obtain Windows deployment tools, see "Resources" at the end of this

    paper.

    This information applies to the following operating systems:

    Windows 8

    Windows 7

    Windows Vista with Service Pack 1 (SP1)

    Windows Server 2012

    Windows Server 2008 R2Windows Server 2008

    The current version of this paper is maintained on the Web atInstalling Windows

    on UEFI Systems.

    Disclaimer : This document is provided as-is. Information and views expressed in this document,including URL and other Internet website references, may change without notice. Some informationrelates to pre-released product which may be substantially modified before its commercially released.Microsoft makes no warranties, express or implied, with respect to the information provided here. You

    bear the risk of using it.Some examples depicted herein are provided for il lustration only and are fictitious. No real association orconnection is intended or should be inferred.

    This document does not provide you with any legal rights to any intellectual property in any Microsoftproduct. You may copy and use this document for your internal, reference purposes.

    2012 Microsoft. All rights reserved.

    http://www.microsoft.com/whdc/system/platform/firmware/uefiguide.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/uefiguide.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/uefiguide.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/uefiguide.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/uefiguide.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/uefiguide.mspx
  • 8/12/2019 UEFIGuide

    2/19

    Installing Windows on UEFI Systems - 2

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Document History

    Date Changes

    June 13,

    2012

    Updated document for Windows 8 and Windows Server 2012.

    Updated final installation procedures to include an initial boot

    sequence.

    August 3,

    2011

    Updated document for Windows 7 and Windows Server 2008 R2.

    July 25,

    2008

    Updated document to include Windows 7 and better describe the

    Windows Setup installation procedure.

    Changed title to reflect new contents.

    May 9,

    2007

    Originally published as Imaging Guidelines for Windows

    Server 2008 R2 on UEFI Systems.

    ContentsContents ................................................................................................................................................ 2Introduction ........................................................................................................................................... 3Installing the Operating System by Using Windows Setup .................................................................... 3

    Preparing the System by Configuring Partitions ............................................................................... 3Preparing the System to Boot in UEFI Mode .................................................................................... 6Installing the Software ..................................................................................................................... 6

    Creating and Deploying a Windows Image ............................................................................................ 7Resources ............................................................................................................................................ 11Appendix A: BCD System Store Settings for UEFI ................................................................................ 12

    Windows Boot Manager Settings for UEFI ..................................................................................... 12Device Setting ........................................................................................................................... 12Path Setting ............................................................................................................................... 13

    Other Settings ........................................................................................................................... 13Windows Boot Loader Settings ...................................................................................................... 14

    Device and OSDevice Settings ................................................................................................... 14Path Setting ............................................................................................................................... 15

    Windows Memory Tester Settings ................................................................................................. 15Device Setting ........................................................................................................................... 15Path Setting ............................................................................................................................... 15

    Appendix B: Clearing Duplicate Firmware Objects in BCD and NVRAM .............................................. 16

  • 8/12/2019 UEFIGuide

    3/19

    Installing Windows on UEFI Systems - 3

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Introduction

    The Windows operating system includes the following support for Unified

    Extensible Firmware Interface (UEFI)-based computers:

    Disk partitions support the GUID partition table (GPT) disk format.

    Windows Setup can initialize the system's hard disk drive to use the GPTformat and create a system partition, which is also known as the EFI system

    partition (ESP).

    Note: The term EFI is often used synonymously with UEFI. EFI refers to

    Extensible Firmware Interface, which is a predecessor to UEFI.

    The system can install and service boot environment files on the system

    partition. These files include the Windows Boot Manager file, the Boot

    Configuration Data (BCD) file, and related font files.

    The system includes EFI versions of the Windows Boot Manager and Windows

    Resume from Hibernate boot applications.

    The system automatically manages nonvolatile RAM (NVRAM) boot entriesthat reference the partition that contains Windows Boot Manager.

    The system provides backup support for the system partition.

    BitLocker Drive Encryption supports UEFI systems.

    You can install Windows onto UEFI-based platforms in either of the following ways:

    Use Windows Setup to install the operating system on a single UEFI-based

    computer.

    Use the tools in the Windows ADK to create and deploy a Windows image on

    multiple UEFI-based computers.

    Installing the Operating System by Using Windows Setup

    Windows Setup provides the simplest way to install Windows on a UEFI-based

    computer.

    Preparing the System by Configuring Partitions

    UEFI-based computers use a GPT disk partition format, which is distinct from the

    reference boot record (MBR) format that is used for BIOS-based systems. UEFI

    computers require at least three GPT partitions:

    A system partition to store the boot applications and other related information

    A Microsoft reserved (MSR) partition, which must be located between the

    system and Windows partitions

    A Windows partition

    Additional partitions might also be necessary for purposes such as supporting

    Windows RE and BitLocker. For more information about GPT disks, EFI, and disk

    partitions, seeUnderstanding Disk Partitions.

    http://technet.microsoft.com/en-us/library/dd799232(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799232(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799232(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799232(v=WS.10).aspx
  • 8/12/2019 UEFIGuide

    4/19

    Installing Windows on UEFI Systems - 4

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    You can use Windows Setup to install Windows on any UEFI-compatible computer.

    If the hard drive that you plan to use already has an existing operating system that

    uses the MBR disk partition format, you must first delete all partitions on the

    selected hard drive, and then convert the drive to the GPT disk partition format.

    To convert the drive:

    1. Boot the computer in the Windows Preinstallation Environment (Windows PE).

    2. Open a Command Promptwindow, and then type the following Diskpart

    commands.

    diskpartselect disk 0cleanconvert gpt

    If the hard drive that you plan to use is empty, you can create the GPT partitions

    by using Windows Setup. If you select the default partition layout, Windows Setup

    automatically creates the Windows RE Tools, System, MSR, and Windowspartitions before it installs Windows, as shown in the following table.

    Default UEFI Partitions

    Partition Size Type Format

    Windows RE Tools 300 megabytes (MB) Primary NTFS file

    system

    System 100 MB EFI FAT32 file

    system

    MSR 128 MB MSR

    Windows Available disk size Primary NTFS file

    system

    To automate Windows Setup, create an answer file by using Windows System

    Image Manager (Windows SIM). Then, add the following settings in the Microsoft-

    Windows-Setup component to set up the system, MSR, and Windows partitions.

    0true

    1Primary300

    2EFI

  • 8/12/2019 UEFIGuide

    5/19

    Installing Windows on UEFI Systems - 5

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    100

    3MSR128

    4Primarytrue

    11WINRENTFS

    22SystemFAT32

    33

    44WindowsCNTFS

    OnError

    03

  • 8/12/2019 UEFIGuide

    6/19

    Installing Windows on UEFI Systems - 6

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    For instructions about how to use Windows SIM to create these partitions, see

    Create UEFI-Based Hard-Disk Partitions by Using Windows SIM.

    Preparing the System to Boot in UEFI Mode

    When you are installing Windows, you may need to explicitly instruct thecomputer to boot in UEFI mode.

    Some UEFI platforms support booting in BIOS mode, and it is not always apparent

    whether UEFI or BIOS is the default boot option. If you do not explicitly instruct the

    computer to boot in UEFI mode, Windows Setup might install Windows in BIOS

    mode. This would not give you the advantages of UEFI.

    Installing the Software

    Different UEFI firmware implementations support different methods for handling

    the installation operation.

    To install the software for UEFI firmware based primarily on the Intel TianoCore

    framework

    1. Insert the installation DVD and restart the computer.

    2. When the firmware starts to initialize, press F10, and then open the menu for

    the UEFI firmware boot device.

    3. Select an EFI drive, such as EFI DVD/CD Drive, EFI USB Drive, or EFI Network

    Drive. You may be immediately prompted to press a key to boot from the

    drive.

    Note: On some computers, you may need to manually select the boot files. For

    example, select Boot from file, and then browse to the boot file

    (\EFI\Boot\BootX64.efi) on your boot device.

    If the computer does not have an option to boot from an EFI drive, you may be

    able to boot from the firmware shell.

    To boot from the firmware shell

    1. Start the EFI internal shell from the EFI boot menu, and then select the drive

    that contains the Windows product DVD or Windows PE. The following

    example assumes that the DVD drive is Fs0.

    Shell> Fs0:

    2. Start the EFI boot application. There are separate applications for x64 and Intel

    Itanium systems. For an x64 system, run the following command:

    fs0:> \EFI\BOOT\BOOTX64.EFI

    For an Intel Itanium system (Windows Server 2008 R2 and Windows Server

    2008 only), run the following command:

    Fs0:\EFI\BOOT\BOOTIA64.EFI

    3. After the application starts, the system displays the following message.

    Press any key to boot from CD or DVD

    http://technet.microsoft.com/en-us/library/dd744271(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd744271(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd744271(v=WS.10).aspx
  • 8/12/2019 UEFIGuide

    7/19

    Installing Windows on UEFI Systems - 7

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Press a key to continue booting from the installation media.

    After the installation is complete, you can verify that Windows used the EFI boot

    environment by running the Diskparttool. You can use the following commands to

    verify that the disk partition table uses the GPT format and that the system and

    MSR partitions are present.

    diskpartlist disk

    select disk 0

    list partition

    Creating and Deploying a Windows Image

    You can simplify installing Windows on multiple UEFI-based computers by using

    the Windows ADK tools to create and deploy a custom Windows image.

    To use the Windows ADK tools to create and deploy a customized Windows image,you must have the following systems:

    A technician computer.

    You install the Windows ADK tools, including Windows SIM, on the technician

    computer.

    A UEFI-compatible reference computer.

    You create a reference installation by installing and customizing the selected

    Windows version on this computer. You then use image-capturing tools, such

    as the Deployment Image Servicing and Management (DISM) tool, to create

    an image of the reference installation for deployment.

    One or more UEFI-compatible destination computers.

    You use Windows PE and the DISMtool to deploy the customized Windows

    image to the destination computers.

    To create an image of the disk partitions

    1. Use Windows SIM on the technician computer to create an answer file that

    contains the details of your reference installation. For information about how

    to create an answer file, see the Windows ADK documentation. Save the file to

    a DVD or other portable media.

    2. Prepare a reference installation by installing the appropriate version of

    Windows with UEFI support on the reference computer and customizing theinstallation as required.

    3. Generalize the computer. For example, at a command prompt, type the

    following command.

    Sysprep /generalize /OOBE /shutdown

    For more information, seePrepare to Capture an Image for Deployment

    (Generalize).

    http://technet.microsoft.com/en-us/library/dd799233(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799233(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799233(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799233(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799233(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/dd799233(v=WS.10).aspx
  • 8/12/2019 UEFIGuide

    8/19

    Installing Windows on UEFI Systems - 8

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    4. Capture an image of the Windows partition on the reference installation for

    deployment to the destination computers. For example, you can use Windows

    PE and either DISM or ImageX to capture the images.

    For Windows PE 4.0, you can use DISM commands to capture and apply

    images.

    For Windows PE 2.x and 3.0, you can use ImageX to capture and apply images.

    At the Windows PE command prompt, type the following command.

    DISM:

    Dism /Capture-Image /CaptureDir:D:\ /ImageFile:n:\images\my-windows-partition.wim /Name:"Windows Server 8"

    ImageX:

    imagex /capture D: n:\images\my-windows-partition.wim "Windows Server2008 R2"

    For more information, seeHow to Configure UEFI/GPT-Based Hard Disk

    Partitions.

    To deploy the image

    1. Boot Windows PE on the destination computers by using the UEFI boot option,

    as described in "Preparing the System by Switching to UEFI Mode" in this

    paper. The remainder of this procedure uses the Windows PE Command

    Promptwindow.

    2. Create partitions on the destination computers.

    The following Diskpartcommands create the recommended UEFI partition

    structure. The structure includes a system, MSR, and Windows partition, in

    addition to recovery image partitions.

    diskpartrem == These commands are used with DiskPart to

    rem erase the drive and create five partitions

    rem for a UEFI/GPT-based computer.

    rem Adjust the partition sizes to fill the drive

    rem as necessary. ==

    select disk 0

    clean

    convert gpt

    rem == 1. Windows RE tools partition ===============create partition primary size=300

    format quick fs=ntfs label="Windows RE tools"

    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"

    assign letter="T"

    rem == 2. System partition =========================

    create partition efi size=100

    http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261
  • 8/12/2019 UEFIGuide

    9/19

    Installing Windows on UEFI Systems - 9

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    rem ** NOTE: For 4KB-per-sector drives, change this

    rem value to 260 **

    format quick fs=fat32 label="System"

    assign letter="S"

    rem == 3. Microsoft Reserved (MSR) partition =======

    create partition msr size=128

    rem == 4. Windows partition ========================

    rem == a. Create the Windows partition ==========

    create partition primary

    rem == b. Create space for the recovery image ===

    shrink minimum=15000

    rem == c. Prepare the Windows partition =========

    format quick fs=ntfs label="Windows"

    assign letter="W"

    rem === 5. Recovery image partition ================

    create partition primary

    format quick fs=ntfs label="Recovery image"

    assign letter="R"

    list volume

    exit

    3. Apply the Windows system image to the destination computers' Windows

    system partition by using DISMor ImageX.

    DISM:

    Dism /Apply-Image /ImageFile:n:\images\my-windows-partition.wim/Index:1 /ApplyDir:W:\

    ImageX:

    imagex /apply n:\images\my-windows-partition.wim 1 W:\

    4. Copy the boot files to the system partition.

    W:\Windows\System32\bcdboot W:\Windows /s S: /f all

    For more information, seeHow to Configure UEFI/GPT-Based Hard Disk

    Partitions.

    5. Remove the Windows PE media, and then reboot the destination computers.

    Allow the destination computers to complete initial configuration tasks, suchas configuring hardware devices and applying pending updates.

    6. When Windows Welcome appears, turn off the computer by holding down the

    power button for more than five seconds.

    7. Boot the computers again by using the Windows PE media.

    8. Use Diskpart to temporarily reassign the drive letters.

    The following Diskpartcommands reassign the drive letters.

    http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261
  • 8/12/2019 UEFIGuide

    10/19

    Installing Windows on UEFI Systems - 10

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    diskpartselect disk 0

    select partition 1

    assign letter="T"

    select partition 2

    assign letter="S"

    select partition 4

    assign letter="W"

    select partition 5

    assign letter="R"

    list volume

    exit

    9. Capture the recovery image to the recovery partition. You can use either DISM

    or ImageX to capture the image.

    DISM:

    md R:\RecoveryImage

    Dism /Capture-Image /CaptureDir:W:\/ImageFile:R:\RecoveryImage\install.wim /Name:"Recovery image"

    ImageX:

    md R:\RecoveryImage

    imagex /capture W: R:\RecoveryImage\install.wim "Recovery image"

    10.Copy the Windows RE tools to the Windows RE tools partition.

    md T:\Recovery\WindowsRE

    copy W:\windows\system32\recovery\winre.wim

    T:\Recovery\WindowsRE\winre.wim11.Register the locations of the Recovery image.

    W:\Windows\System32\reagentc /setreimage /path T:\Recovery\WindowsRE/target W:\Windows

    W:\Windows\System32\reagentc /setosimage /path R:\RecoveryImage /targetW:\Windows /index 1

    rem == Report the status of the Windows RE locations ==

    W:\Windows\System32\Reagentc /info /target W:

    12.Use Diskpart to hide the drive letters of the recovery partitions.

    diskpartselect disk 0

    select partition 1

    remove

    set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac

    gpt attributes=0x8000000000000001

    select partition 5

    remove

  • 8/12/2019 UEFIGuide

    11/19

    Installing Windows on UEFI Systems - 11

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7

    gpt attributes=0x0000000000000001

    list volume

    exit

    13.Remove the Windows PE media, and then shut down the computers. To do

    this, either hold the power button for 5 full seconds, or use the following

    command.

    wpeutil shutdown

    The system is now ready to be distributed to an end user.

    Resources

    Deployment Tools for Windows 8 and Windows Server 8

    Windows Assessment and Deployment Kit

    http://go.microsoft.com/fwlink/?LinkId=221062

    Deployment Tools for Windows 7, Windows Vista, Windows Server 2008 R2,

    and Windows Server 2008

    Windows OEM Preinstallation Kits (Windows OPK)

    http://www.microsoft.com/oem

    Windows Automated Installation Kit (Windows AIK)

    http://www.microsoft.com/download/en/details.aspx?id=5753

    Other resources

    BCDEdit Commands for Boot Environment

    http://www.microsoft.com/whdc/system/platform/firmware/bcdedit_reff.ms

    px

    Boot Configuration Data in Windows Vista

    http://www.microsoft.com/whdc/system/platform/firmware/bcd.mspx

    How Basic Disks and Volumes Work (TechNet)

    http://technet.microsoft.com/en-us/library/cc739412(v=WS.10).aspx

    How to Configure UEFI/GPT-Based Hard Disk Partitions

    http://go.microsoft.com/fwlink/?LinkId=214261

    UEFI Support and Requirements for Windows Operating Systems

    http://www.microsoft.com/whdc/system/platform/firmware/uefireg.mspx

    UEFI information and resources in the Windows Hardware Development Center

    (WHDC)

    http://www.microsoft.com/whdc/system/platform/firmware/default.mspx

    Windows and GPT FAQ (WHDC)

    http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx

    http://go.microsoft.com/fwlink/?LinkId=221062http://go.microsoft.com/fwlink/?LinkId=221062http://www.microsoft.com/oemhttp://www.microsoft.com/oemhttp://www.microsoft.com/download/en/details.aspx?id=5753http://www.microsoft.com/download/en/details.aspx?id=5753http://www.microsoft.com/whdc/system/platform/firmware/bcdedit_reff.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/bcdedit_reff.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/bcdedit_reff.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/bcd.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/bcd.mspxhttp://technet.microsoft.com/en-us/library/cc739412(v=WS.10).aspxhttp://technet.microsoft.com/en-us/library/cc739412(v=WS.10).aspxhttp://go.microsoft.com/fwlink/?LinkId=214261http://go.microsoft.com/fwlink/?LinkId=214261http://www.microsoft.com/whdc/system/platform/firmware/uefireg.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/uefireg.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/default.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/default.mspxhttp://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspxhttp://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspxhttp://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/default.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/uefireg.mspxhttp://go.microsoft.com/fwlink/?LinkId=214261http://technet.microsoft.com/en-us/library/cc739412(v=WS.10).aspxhttp://www.microsoft.com/whdc/system/platform/firmware/bcd.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/bcdedit_reff.mspxhttp://www.microsoft.com/whdc/system/platform/firmware/bcdedit_reff.mspxhttp://www.microsoft.com/download/en/details.aspx?id=5753http://www.microsoft.com/oemhttp://go.microsoft.com/fwlink/?LinkId=221062
  • 8/12/2019 UEFIGuide

    12/19

    Installing Windows on UEFI Systems - 12

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Appendix A: BCD System Store Settings for UEFI

    For a typical deployment scenario, you do not need to modify the BCD store.

    This section discusses the various BCD settings in the BCD store that you can

    modify. On UEFI systems, this includes settings for the following boot applications:

    Windows Boot Manager

    The Windows boot loader

    Windows Resume from Hibernate

    Windows Memory Tester

    The following sections describe the available settings for each of these boot

    applications in detail and how to modify each application for UEFI systems.

    Note:For simplicity, the BCDEdit examples in this section modify the BCD system

    store. To modify another store, such as a copy of the BCD-template, include the

    store name in the command line.

    Windows Boot Manager Settings for UEFI

    Windows Boot Manager ({bootmgr}) manages the boot process. UEFI-based

    systems contain a firmware boot manager, Bootmgfw.efi, that loads an EFI

    application that is based on variables that are stored in NVRAM.

    The BCD settings for the deviceand pathelements in Windows Boot Manager

    indicate the firmware boot manager. The template that is named BCD-template

    for Windows includes the following settings for Windows Boot Manager.

    Windows Boot Manager--------------------

    identifier {bootmgr}device partition=\Device\HarddiskVolume1path \EFI\Microsoft\Boot\bootmgfw.efidescription Windows Boot Manager

    Device Setting

    The deviceelement specifies the volume that contains Windows Boot Manager.

    For UEFI systems, the deviceelement for Windows Boot Manager is set to the

    system partition volume letter. To determine the correct volume letter, use the

    Diskparttool to view the disk partitions. The following example assumes that the

    system has a single hard drive that has multiple partitions, including a system

    partition that has been assigned a drive letter of S.

    The following Diskpartcommands select disk 0 and then list the details of the

    volumes on that disk, including their drive letters. It shows volume 2 as the system

    partition.

    DISKPART> select disk 0DISKPART> list volume

    Volume ### Ltr Label Fs Type Size Status Info---------- --- ------ ----- ---------- ------- --------- ------Volume 0 D NTFS Partition 103 GB Healthy

  • 8/12/2019 UEFIGuide

    13/19

    Installing Windows on UEFI Systems - 13

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Volume 1 C NTFS Partition 49 GB Healthy BootVolume 2 S FAT32 Partition 200 MB Healthy System

    If the system partition does not have an assigned drive letter, assign one by using

    the Diskpartassigncommand. The following example assumes that the system

    partition is volume 2 and assigns it S as the drive letter.

    Diskpart

    select disk 0list volumeselect volume 2 // assuming volume 2 is the system partitionassign letter=s

    After you have determined the system partition volume, set thedeviceelement

    for Windows Boot Manager to the corresponding drive letter. The following

    example sets deviceto drive S.

    Bcdedit /set {bootmgr} device partition=s: // system partition

    Path Setting

    The pathelement specifies the location of the Windows Boot Manager applicationon that volume. For UEFI systems, pathindicates the firmware boot manager,

    whose path is \EFI\Microsoft\Boot\Bootmgfw.efi.

    You can confirm that BCD-template has the correct path by enumerating the

    values in the store, as follows.

    bcdedit /store bcd-template /enum all

    To explicitly set pathto \EFI\Microsoft\Boot\Bootmgfw.efi, use the following

    command.

    Bcdedit /set {bootmgr} path \efi\microsoft\boot\bootmgfw.efi

    Other Settings

    You should set Windows Boot Manager to be the first item in the display order of

    the EFI firmware, as shown in the following example.

    Bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst

    You should also specify the topmost Windows boot loader application in the

    Windows Boot Manager display order. The following example shows how to put a

    specified Windows boot loader at the top of the display order.

    Bcdedit /set {bootmgr} displayorder {} /addfirst

    In the preceding example, is the identifier for the specified Windows boot

    loader object. The next section discusses this identifier in greater detail.

    Note: A multiboot system that has multiple installed operating systems has

    multiple instances of the Windows boot loader. Each instance of the Windows

    boot loader has its own identifier. You can set the default Windows boot loader

    ({default}) to any of these identifiers.

  • 8/12/2019 UEFIGuide

    14/19

    Installing Windows on UEFI Systems - 14

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Windows Boot Loader Settings

    A BCD store has at least one instance, and optionally multiple instances, of the

    Windows boot loader. A separate BCD object represents each instance. Each

    instance loads one of the installed versions of Windows that has a configuration

    that the object's elements have specified. Each Windows boot loader object has its

    own identifier, and the object's deviceand pathsettings indicate the correctpartition and boot application.

    BCD-template for Windows has a single Windows boot loader object that has the

    following settings.

    Windows Boot Loader-------------------identifier {9f25ee7a-e7b7-11db-94b5-f7e662935912}device partition=C:path \Windows\system32\winload.efidescription Microsoft Windows Server 8locale en-USinherit {bootloadersettings}

    osdevice partition=C:systemroot \Windows

    The identifier for this Windows boot loader is {9f25ee7a-e7b7-11db-94b5-

    f7e662935912}. You can use this GUID on your system or let the BCDEdittool

    generate a new GUID for you.

    To simplify BCDEditcommands, you can specify one of the Windows boot loaders

    in the BCD system store as the default loader. You can then use the standard

    identifier ({default}) in place of the full GUID.

    The following example specifies the Windows boot loader for EFI as the default

    boot loader, assuming that it uses the identifier GUID from BCD-template.

    Bcdedit /default {9f25ee7a-e7b7-11db-94b5-f7e662935912}

    Device and OSDevice Settings

    The following elements specify key locations:

    The deviceelement specifies the partition that contains the boot application.

    The osdeviceelement specifies the partition that contains the system root.

    For the Windows boot loader for EFI, both elements are usually set to the drive

    letter of the Windows system partition. However, if BitLocker is enabled or a

    computer has multiple installed versions of Windows, osdeviceand devicemight

    be set to different partitions.

    BCD-template sets both elements to drive C, which is the typical value. You can

    also explicitly set the deviceand osdevicevalues, as shown in the following

    example. The example also assumes that you have specified the Windows boot

    loader for EFI as the default boot-loader object.

    Bcdedit /set {default} device partition=c:Bcdedit /set {default} osdevice partition=c:

  • 8/12/2019 UEFIGuide

    15/19

    Installing Windows on UEFI Systems - 15

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Path Setting

    The pathelement of a Windows boot loader specifies the location of the boot

    loader on that volume. For UEFI systems, pathindicates the Windows boot loader

    for EFI, whose path is \Windows\System32\Winload.efi.

    You can confirm that BCD-template has the correct pathvalue by enumerating the

    values in the store. You can also explicitly set the path value, as shown in the

    following example.

    Bcdedit /set {default} path \windows\system32\winload.efi

    Windows Memory Tester Settings

    The Windows memory tester ({memdiag}) runs memory diagnostics at boot time.

    The BCD settings for the application's deviceand pathelements indicate the

    correct application.

    Note: Intel Itanium computers do not include a Windows memory tester and do

    not require {memdiag} settings.

    BCD-template for Windows has the following settings.

    Windows Memory Tester---------------------identifier {memdiag}device partition=\Device\HarddiskVolume1path \boot\memtest.exedescription Windows Memory Diagnostic

    Device Setting

    For UEFI systems, the deviceelement for the Windows memory tester is set to the

    system partition drive letter. The following example assumes that the systempartition is drive S, as used in earlier examples.

    Bcdedit /set {bootmgr} device partition=s: // system partition

    Path Setting

    The pathelement specifies the location of Windows Test Manager on the volume

    that the deviceelement has specified. For UEFI systems, pathindicates the EFI

    version of the application (\EFI\Microsoft\Boot\Memtest.efi).

    You can confirm that BCD-template has the correct pathvalue by enumerating the

    values in the store. You can also use the BCDEdittool to explicitly set the path

    value, as shown in the following example.

    Bcdedit /set {memdiag} path \efi\microsoft\boot\memtest.efi

  • 8/12/2019 UEFIGuide

    16/19

    Installing Windows on UEFI Systems - 16

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    Appendix B: Clearing Duplicate Firmware Objects in BCD andNVRAM

    On some UEFI systems, the firmware creates NVRAM entries for local devices such

    as CD-ROM drives or hard drives when the devices are turned on. When you run

    commands such as bcdedit /setor bcdedit /enum, the BCDEdittool opens the

    BCD system store and compares the firmware namespace objects in NVRAM with

    the corresponding objects in the store. If any firmware namespace objects do not

    exist in the BCD system store, BCDEditcreates appropriate objects and adds them

    to the store.

    When BCDEditcloses the BCD system store, it compares the firmware namespace

    objects in the store with the objects in NVRAM. If any of the BCD objects do not

    exist in NVRAM, BCDEditcreates appropriate NVRAM entries.

    If you run bcdedit /import, BCDEditadds copies of all firmware namespace objects

    in the BCD system store to NVRAM. If you run bcdedit /importmultiple times, the

    system's NVRAM might eventually contain multiple duplicate entries for devicessuch as the CD-ROM and hard disk drives.

    To determine whether your system has duplicate NVRAM entries, run the

    following BCDEditcommand, which enumerates the firmware namespace objects

    in the BCD system store.

    Bcdedit /enum firmware

    The following example is similar to the output from the bcdedit /enum firmware

    command.

    Firmware Boot Manager---------------------

    identifier {fwbootmgr}displayorder {bootmgr}

    {93cee840-f524-11db-af62-aa767141e6b3}{93cee841-f524-11db-af62-aa767141e6b3}{93cee842-f524-11db-af62-aa767141e6b3}{93cee844-f524-11db-af62-aa767141e6b3}{93cee843-f524-11db-af62-aa767141e6b3}

    timeout 2

    Windows Boot Manager--------------------identifier {bootmgr}device partition=\Device\HarddiskVolume1path \EFI\Microsoft\Boot\bootmgfw.efi

    description Windows Boot Managerlocale en-USinherit {globalsettings}default {current}displayorder {current}toolsdisplayorder {memdiag}timeout 30

    Firmware Application (101fffff)-------------------------------identifier {93cee840-f524-11db-af62-aa767141e6b3}

  • 8/12/2019 UEFIGuide

    17/19

    Installing Windows on UEFI Systems - 17

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    description Primary Reference CDROM

    Firmware Application (101fffff)-------------------------------identifier {93cee841-f524-11db-af62-aa767141e6b3}description Harddisk 4

    Firmware Application (101fffff)-------------------------------identifier {93cee842-f524-11db-af62-aa767141e6b3}description Internal EFI Shell

    Firmware Application (101fffff)-------------------------------identifier {93cee843-f524-11db-af62-aa767141e6b3}description Floppy

    Firmware Application (101fffff)-------------------------------identifier {93cee844-f524-11db-af62-aa767141e6b3}descriptionAcpi(PNP0A03,0)/Pci(1F|1)/Ata(Primary,Reference)/CDROM(Entry1)

    The following example resembles the way that the bcdedit /enumoutput might

    appear for a system that has multiple entries.

    Firmware Boot Manager---------------------identifier {fwbootmgr}displayorder {bootmgr}

    {93cee840-f524-11db-af62-aa767141e6b3}{93cee841-f524-11db-af62-aa767141e6b3}{93cee842-f524-11db-af62-aa767141e6b3}{93cee844-f524-11db-af62-aa767141e6b3}{93cee843-f524-11db-af62-aa767141e6b3}

    {8b87c5a0-f2f2-11db-9717-f87ee6ea6002}{8b87c5a1-f2f2-11db-9717-f87ee6ea6002}{8b87c5a2-f2f2-11db-9717-f87ee6ea6002}{8b87c5a3-f2f2-11db-9717-f87ee6ea6002}{8b87c5a4-f2f2-11db-9717-f87ee6ea6002}

    timeout 2

    Firmware Application (101fffff)-------------------------------identifier {93cee840-f524-11db-af62-aa767141e6b3}description Primary Reference CDROM

    Firmware Application (101fffff)-------------------------------identifier {8b87c5a0-f2f2-11db-9717-f87ee6ea6002}

    description Primary Reference CDROM...

    The BCD system store in this example has duplicate firmware namespace objects

    for its devices. One set of objects has identifiers that start with 93, and the

    duplicate set has identifiers that start with 8b. The example shows the details for

    the primary reference CD-ROM.

  • 8/12/2019 UEFIGuide

    18/19

    Installing Windows on UEFI Systems - 18

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    You can use the BCDEdittool to remove duplicate entries from NVRAM and the

    BCD system store. The operation requires a series of BCDEditcommands, so you

    might find it useful to create a command script that uses the correct object

    identifiers for the multiple object entries that you want to remove.

    To remove duplicate entries

    1. Save a copy of the current BCD system store by running the following

    command.

    bcdedit /export Newbcd

    2. Make another backup of the system store.

    copy Newbcd bcdbackup

    3. Enumerate the firmware namespace objects in the BCD system store, and then

    save the output to a text file.

    bcdedit /enum firmware > enumfw.txt

    4. Open the Enumfw.txt file in Notepad, and then delete everything except the

    list of firmware GUIDs.

    5. Save the edited Enumfw.txt file to a new command file that you name

    Removedups.cmd.

    6. Insert the following BCDEditcommand in front of each identifier in the

    Removedups.cmd file.

    Bcdedit /store newbcd /delete

    This command deletes all the duplicate firmware IDs. For the example that this

    procedure uses, the Removedups.cmd file resembles the following example.

    bcdedit /store newbcd /delete {93cee840-f524-11db-af62-aa767141e6b3}bcdedit /store newbcd /delete {93cee841-f524-11db-af62-aa767141e6b3}bcdedit /store newbcd /delete {93cee842-f524-11db-af62-aa767141e6b3}bcdedit /store newbcd /delete {93cee843-f524-11db-af62-aa767141e6b3}bcdedit /store newbcd /delete {93cee844-f524-11db-af62-aa767141e6b3}bcdedit /store newbcd /delete {8b87c5a0-f2f2-11db-9717-f87ee6ea6002}bcdedit /store newbcd /delete {8b87c5a1-f2f2-11db-9717-f87ee6ea6002}bcdedit /store newbcd /delete {8b87c5a2-f2f2-11db-9717-f87ee6ea6002}bcdedit /store newbcd /delete {8b87c5a3-f2f2-11db-9717-f87ee6ea6002}bcdedit /store newbcd /delete {8b87c5a4-f2f2-11db-9717-f87ee6ea6002}

    Note: On systems where the EFI firmware initializes NVRAM entries for local

    devices, delete all GUID entries for firmware namespace objects, but do notdelete the {bootmgr} entry.

    7. Add the following command to the end of the Removedups.cmd file, and then

    save the file.

    bcdedit /import newbcd /clean

    The/import /cleanoption deletes all NVRAM entries and then re-initializes

    NVRAM based on the firmware namespace objects in the Newbcd BCD store.

  • 8/12/2019 UEFIGuide

    19/19

    Installing Windows on UEFI Systems - 19

    June 13, 2012 20072012 Microsoft Corporation. All rights reserved.

    8. Run the Removedups.cmd file. This removes the duplicate entries from the

    Newbcd store, reinitializes NVRAM, and imports Newbcd into the BCD system

    store.

    9. Reboot the system.

    During the reboot, the EFI firmware reinitializes the NVRAM by using the

    firmware object GUIDs that correspond to the attached devices.

    10. Use bcdedit /enumfirmwareto verify that all duplicate firmware namespace

    objects have been removed.