Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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 and Deployment 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 R2 Windows Server 2008 The current version of this paper is maintained on the Web at Installing 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 information relates 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 illustration only and are fictitious. No real association or connection is intended or should be inferred. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. 2012 Microsoft. All rights reserved.
Document History Date Changes June 13, Updated document for Windows 8 and Windows Server 2012. 2012 Updated final installation procedures to include an initial boot sequence. August 3, Updated document for Windows 7 and Windows Server 2008 R2. 2011 July 25, Updated document to include Windows 7 and better describe the 2008 Windows Setup installation procedure. Changed title to reflect new contents. May 9, Originally published as Imaging Guidelines for Windows 2007 Server 2008 R2 on UEFI Systems.
Contents
Contents ................................................................................................................................................ 2 Introduction ........................................................................................................................................... 3 Installing the Operating System by Using Windows Setup .................................................................... 3 Preparing the System by Configuring Partitions ............................................................................... 3 Preparing the System to Boot in UEFI Mode .................................................................................... 6 Installing the Software ..................................................................................................................... 6 Creating and Deploying a Windows Image ............................................................................................ 7 Resources ............................................................................................................................................ 11 Appendix A: BCD System Store Settings for UEFI ................................................................................ 12 Windows Boot Manager Settings for UEFI ..................................................................................... 12 Device Setting ........................................................................................................................... 12 Path Setting ............................................................................................................................... 13 Other Settings ........................................................................................................................... 13 Windows Boot Loader Settings ...................................................................................................... 14 Device and OSDevice Settings ................................................................................................... 14 Path Setting ............................................................................................................................... 15 Windows Memory Tester Settings ................................................................................................. 15 Device Setting ........................................................................................................................... 15 Path Setting ............................................................................................................................... 15 Appendix B: Clearing Duplicate Firmware Objects in BCD and NVRAM .............................................. 16
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 GPT format 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 entries that 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.
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, see Understanding Disk Partitions.
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 Prompt window, and then type the following Diskpart commands.
diskpart select disk 0 clean convert 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 Windows partitions before it installs Windows, as shown in the following table.
Default UEFI Partitions
Partition
Windows RE Tools System MSR Windows
Size
300 megabytes (MB) 100 MB 128 MB Available disk size
Type
Primary EFI MSR Primary
Format
NTFS file system FAT32 file system 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 MicrosoftWindows-Setup component to set up the system, MSR, and Windows partitions.
<DiskConfiguration> <Disk wcm:action="add"> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> <CreatePartitions> <!-- Windows RE Tools partition --> <CreatePartition wcm:action="add"> <Order>1</Order> <Type>Primary</Type> <Size>300</Size> </CreatePartition> <!-- System partition (ESP) --> <CreatePartition wcm:action="add"> <Order>2</Order> <Type>EFI</Type>
June 13, 2012 20072012 Microsoft Corporation. All rights reserved.
<Size>100</Size> <!-- Note: for Advanced Format Generation One drives, change to size=260 --> </CreatePartition> <!-- Microsoft reserved partition (MSR) --> <CreatePartition wcm:action="add"> <Order>3</Order> <Type>MSR</Type> <Size>128</Size> </CreatePartition> <!-- Windows partition --> <CreatePartition wcm:action="add"> <Order>4</Order> <Type>Primary</Type> <Extend>true</Extend> </CreatePartition> </CreatePartitions> <ModifyPartitions> <!-- Windows RE Tools partition --> <ModifyPartition wcm:action="add"> <Order>1</Order> <PartitionID>1</PartitionID> <Label>WINRE</Label> <Format>NTFS</Format> </ModifyPartition> <!-- System partition (ESP) --> <ModifyPartition wcm:action="add"> <Order>2</Order> <PartitionID>2</PartitionID> <Label>System</Label> <Format>FAT32</Format> </ModifyPartition> <!-- The MSR partition does not need to be modified --> <Order>3</Order> <PartitionID>3</PartitionID> <!-- Windows partition --> <ModifyPartition wcm:action="add"> <Order>4</Order> <PartitionID>4</PartitionID> <Label>Windows</Label> <Letter>C</Letter> <Format>NTFS</Format> </ModifyPartition> </ModifyPartitions> </Disk> <WillShowUI>OnError</WillShowUI> </DiskConfiguration> <ImageInstall> <OSImage> <InstallTo> <DiskID>0</DiskID> <PartitionID>3</PartitionID> </InstallTo> </OSImage>
June 13, 2012 20072012 Microsoft Corporation. All rights reserved.
</ImageInstall>
For instructions about how to use Windows SIM to create these partitions, see Create UEFI-Based Hard-Disk Partitions by Using Windows SIM.
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
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 Diskpart tool. 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.
diskpart list disk select disk 0 list partition
For more information, see Prepare to Capture an Image for Deployment (Generalize).
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-windowspartition.wim /Name:"Windows Server 8"
ImageX:
imagex /capture D: n:\images\my-windows-partition.wim "Windows Server 2008 R2"
For more information, see How 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 Prompt window. 2. Create partitions on the destination computers. The following Diskpart commands create the recommended UEFI partition structure. The structure includes a system, MSR, and Windows partition, in addition to recovery image partitions.
diskpart rem == These commands are used with DiskPart to rem rem rem rem erase the drive and create five partitions for a UEFI/GPT-based computer. Adjust the partition sizes to fill the drive 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
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 ===
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 DISM or 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:\
For more information, see How 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, such as 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 Diskpart commands reassign the drive letters.
June 13, 2012 20072012 Microsoft Corporation. All rights reserved.
diskpart select 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"
12. Use Diskpart to hide the drive letters of the recovery partitions.
diskpart select disk 0 select partition 1 remove set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac gpt attributes=0x8000000000000001 select partition 5 remove
June 13, 2012 20072012 Microsoft Corporation. All rights reserved.
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
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
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.
Device Setting
The device element specifies the volume that contains Windows Boot Manager. For UEFI systems, the device element for Windows Boot Manager is set to the system partition volume letter. To determine the correct volume letter, use the Diskpart tool 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 Diskpart commands 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 0 DISKPART> list volume
Volume ### ---------Volume 0 Ltr --D Label -----Fs ----NTFS Type ---------Partition Size ------103 GB Status --------Healthy Info ------
Volume 1 Volume 2
C S
NTFS FAT32
Partition Partition
49 GB 200 MB
Healthy Healthy
Boot System
If the system partition does not have an assigned drive letter, assign one by using the Diskpart assign command. The following example assumes that the system partition is volume 2 and assigns it S as the drive letter.
Diskpart select disk 0 list volume select volume 2 assign letter=s
After you have determined the system partition volume, set the device element for Windows Boot Manager to the corresponding drive letter. The following example sets device to drive S.
Bcdedit /set {bootmgr} device partition=s: // system partition
Path Setting
The path element specifies the location of the Windows Boot Manager application on that volume. For UEFI systems, path indicates 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
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 {<GUID>} /addfirst
In the preceding example, <GUID> 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.
June 13, 2012 20072012 Microsoft Corporation. All rights reserved.
The identifier for this Windows boot loader is {9f25ee7a-e7b7-11db-94b5f7e662935912}. You can use this GUID on your system or let the BCDEdit tool generate a new GUID for you. To simplify BCDEdit commands, 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}
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, osdevice and device might be set to different partitions. BCD-template sets both elements to drive C, which is the typical value. You can also explicitly set the device and osdevice values, 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:
Path Setting
The path element of a Windows boot loader specifies the location of the boot loader on that volume. For UEFI systems, path indicates the Windows boot loader for EFI, whose path is \Windows\System32\Winload.efi. You can confirm that BCD-template has the correct path value 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
Device Setting
For UEFI systems, the device element for the Windows memory tester is set to the system partition drive letter. The following example assumes that the system partition is drive S, as used in earlier examples.
Bcdedit /set {bootmgr} device partition=s: // system partition
Path Setting
The path element specifies the location of Windows Test Manager on the volume that the device element has specified. For UEFI systems, path indicates the EFI version of the application (\EFI\Microsoft\Boot\Memtest.efi). You can confirm that BCD-template has the correct path value by enumerating the values in the store. You can also use the BCDEdit tool to explicitly set the path value, as shown in the following example.
Bcdedit /set {memdiag} path \efi\microsoft\boot\memtest.efi
The following example is similar to the output from the bcdedit /enum firmware command.
Firmware Boot Manager --------------------identifier displayorder {fwbootmgr} {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} 2
timeout Windows Boot Manager -------------------identifier device path description locale inherit default displayorder toolsdisplayorder timeout
{bootmgr} partition=\Device\HarddiskVolume1 \EFI\Microsoft\Boot\bootmgfw.efi Windows Boot Manager en-US {globalsettings} {current} {current} {memdiag} 30
description
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} description Acpi(PNP0A03,0)/Pci(1F|1)/Ata(Primary,Reference)/CDROM(Entry1)
The following example resembles the way that the bcdedit /enum output might appear for a system that has multiple entries.
Firmware Boot Manager --------------------identifier displayorder {fwbootmgr} {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} 2
timeout
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.
You can use the BCDEdit tool to remove duplicate entries from NVRAM and the BCD system store. The operation requires a series of BCDEdit commands, 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
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 BCDEdit command 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 bcdedit bcdedit bcdedit bcdedit bcdedit bcdedit bcdedit bcdedit bcdedit /store /store /store /store /store /store /store /store /store /store newbcd newbcd newbcd newbcd newbcd newbcd newbcd newbcd newbcd newbcd /delete /delete /delete /delete /delete /delete /delete /delete /delete /delete {93cee840-f524-11db-af62-aa767141e6b3} {93cee841-f524-11db-af62-aa767141e6b3} {93cee842-f524-11db-af62-aa767141e6b3} {93cee843-f524-11db-af62-aa767141e6b3} {93cee844-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}
Note: On systems where the EFI firmware initializes NVRAM entries for local devices, delete all GUID entries for firmware namespace objects, but do not delete 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 /clean option deletes all NVRAM entries and then re-initializes NVRAM based on the firmware namespace objects in the Newbcd BCD store.
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 /enum firmware to verify that all duplicate firmware namespace objects have been removed.