Summary
Microsoft has changed how it updates PCs that run the Windows Recovery Environment (WinRE). WinRE will be updated using the monthly cumulative update. This change only applies to PCs that get updates from Windows Update (WU) and Windows Server Update Services (WSUS). This change starts on June 27, 2023, for the Windows 11, version 22H2 cumulative update.
Some PCs might not have a recovery partition that is large enough to complete this update. Because of this, the update for WinRE might fail. You will receive the error message, "Windows Recovery Environment servicing failed.” To help you recover from this failure, this article provides instructions to manually resize your recovery partition if you get a system ErrorPhase of 2. This requires your device to have the recovery partition after the OS partition. Use the steps below to verify this.
Manually resize your partition by 250 MB
- Open a Command Prompt window (cmd) as admin.
- To check the WinRE status, run reagentc /info. If the WinRE is installed, there should be a “Windows RE location” with a path to the WinRE directory. An example is, “Windows RE location: [file://%3f/GLOBALROOT/device/harddisk0/partition4/Recovery/WindowsRE]\\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE.” Here, the number after “harddisk” and “partition” is the index of the disk and partition WinRE is on.
- To disable the WinRE, run reagentc /disable
- Shrink the OS partition and prepare the disk for a new recovery partition.
- To shrink the OS, run diskpart
- Run list disk
- To select the OS disk, run sel disk This should be the same disk index as WinRE.
- To check the partition under the OS disk and find the OS partition, run list part
- To select the OS partition, run sel part
- Run shrink desired=250 minimum=250
- To select the WinRE partition, run sel part
- To delete the WinRE partition, run delete partition override
- Create a new recovery partition.
- First, check if the disk partition style is a GUID Partition Table (GPT) or a Master Boot Record (MBR). To do that, run list disk. Check if there is an asterisk character (*) in the “Gpt” column. If there is an asterisk character (*), then the drive is GPT. Otherwise, the drive is MBR.
- If your disk is GPT, run create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac followed by the command gpt attributes =0x8000000000000001
- If your disk is MBR, run create partition primary id=27
- To format the partition, run format quick fs=ntfs label=”Windows RE tools”
- If your disk is MBR, to hide the partition run setid id=27
- First, check if the disk partition style is a GUID Partition Table (GPT) or a Master Boot Record (MBR). To do that, run list disk. Check if there is an asterisk character (*) in the “Gpt” column. If there is an asterisk character (*), then the drive is GPT. Otherwise, the drive is MBR.
- To confirm that the WinRE partition is created, run list vol
- To exit from diskpart, run exit
- To re-enable WinRE, run reagentc /enable
- To confirm where WinRE is installed, run reagentc /info
- Following that, an update should successfully complete install on the next run of the Windows Update
https://support.microsoft.com/en-us/topic/kb5042320-windows-recovery-environment-update-for-windows-10-version-21h2-and-22h2-january-9-2024-f5784a62-2b82-4522-b5b2-c31b67049526
https://www.diskpart.com/articles/change-partition-type-id-8523.html
Set partition type ID via Diskpart
Some people prefer to use DiskPart to change partition ID with the command: set id. Detailed steps are listed as below:
1. Press Windows Key + R to open the Run dialogue. Type diskpart and click “OK” or press Enter to run Diskpart.
2. Type list volume and press Enter.
3. Type select volume # (ex: volume 8) and press Enter to select the volume/partition of which you want to change partition type ID.
4. Type set id=# (ex: id=0B) and press Enter to set a new partition type ID.
(Tips: The leading “0x” of the ID is omitted when specifying the hexadecimal partition type.)
5. Type exit and press Enter to exit Diskpart.
KB5042320, KB5042321 and KB5042322. These new patches will only be installed on devices where the WinRE partition contains at least 250 MB of free space.
in powershell get-hotfix
https://www.askwoody.com/forums/topic/kb5042320-replaces-prev-not-fixing-kb5034441/
Run Minitool Partition Wizard free.
Select the WinRE partition.
Select Explore partition
Check the size of WinRE.wim
This was intended to fix a vulnerability (CVE-2024-20666) that attackers could use to bypass BitLocker encryption using the Windows Recovery Environment (WinRE).