UEFI/GPT-based hard drive partitions
UEFI/GPT-based hard drive partitions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Use these steps to deploy Windows Recovery Environment (Windows RE) to a new computer, to help end users repair a PC when a system failure occurs.
To complete this walkthrough, you need the following:
Create a new directory in the Windows RE Tools partition, and then copy your custom Windows RE tools image (Winre.wim) to this directory. The following are examples based on your firmware type:
UEFI:
mkdir T:\Recovery\WindowsRE
xcopy /h W:\Windows\System32\Recovery\Winre.wim T:\Recovery\WindowsRE
Where T: is the drive letter of your Windows RE Tools partition. For example:
BIOS:
mkdir S:\Recovery\WindowsRE
xcopy /h W:\Windows\System32\Recovery\Winre.wim S:\Recovery\WindowsRE
Where S: is the system partition.
Register your custom Windows RE tools image:
UEFI:
C:\Windows\System32\Reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows
Where T: is the Windows RE Tools partition.
BIOS
C:\Windows\System32\Reagentc /setreimage /path S:\Recovery\WindowsRE /target W:\Windows
Where S: is the System partition.
Optional: If you have added a custom tool to your Windows RE boot image, register it so that it will appear on the Advanced startup menu:
Reagentc /setbootshelllink /configfile E:\Recovery\BootMenu\AddDiagnosticsToolToBootMenu.xml
For more information about adding a custom tool, see Add a Custom Tool to the Windows RE Advanced startup Menu.
Optional: Configure a hardware recovery button (or button combination) to run a secondary boot path that contains Windows RE. For more information, see Add a Hardware Recovery Button to Start Windows RE.
Configure your partitions as recovery partitions, and then conceal the drive letters so the partitions don't appear in common Windows menus, such as File Explorer.
In Notepad, create a text file that includes commands to identify and hide the recovery partitions. The following examples are based on your firmware type:
UEFI:
Use the ID: PARTITION_MSFT_RECOVERY_GUID
(de94bba4-06d1-4d40-a16a-bfd50179d6ac) to define the partitions as recovery partitions.
Use the GPT attributes: 0x8000000000000001
to hide the drive letters and to mark them as required, by using a combination of two attributes: GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER
and GPT_ATTRIBUTE_PLATFORM_REQUIRED
.
For more information about UEFI hard drive partition attributes, see PARTITION_INFORMATION_GPT structure.
rem == HideRecoveryPartitions-UEFI.txt
select disk 0
select partition 1
remove
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001
rem == If Push-button reset features are included, add the following commands:
rem select partition 5
rem remove
rem set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
rem gpt attributes=0x8000000000000001
list volume
BIOS:
Use the attribute: id=27
to define the system partition, and use the remove
command to remove the drive letter.
rem == HideRecoveryPartitions-BIOS.txt
select disk 0
select partition 3
set id=27
remove
list volume
exit
Save your completed file as either E:\Recovery\HideRecoveryPartitions-UEFI.txt or E:\Recovery\HideRecoveryPartitions-BIOS.txt, based on your firmware type.
Run the diskpart script to identify and hide the recovery partitions:
Diskpart /s E:\Recovery\HideRecoveryPartitions-<firmware>.txt
Where <firmware>
is either UEFI or BIOS.
Verify that the Windows RE configuration is set correctly
Open an administrative command prompt.
Verify the Windows RE information:
reagentc /info
Verify the following:
\Recovery\<GUID>\
. On UEFI-based PCs, this file is on the Windows RE Tools partition, at \Recovery\WindowsRE\
.\Recovery\WindowsRE
directoryWindows Recovery Environment (Windows RE) Technical Reference
UEFI/GPT-based hard drive partitions
Capture and apply Windows, system, and recovery partitions
The following scripts are used in the lab. It may be helpful to create these all at once, or to download the samples from the web.
Customize Windows RE