My main disk is for a BIOS/MBR system running Windows 10 Pro Version 22H2 (OS Build 19045.3930).
If you have a GPT/EFI formatted disk that not a plain vanilla basic layout i.e. dynamic, mirrored, or clustered don’t do this!
Either way, while seemingly simple, this is not for the faint of heart; caveat emptor!
Also I expect this to work for Windows 11 equally well.
2024-01 Security Update for Windows 10 Version 22H2 for x64-based Systems (KB5034441)
failed to install twice with error 0x80070643 on my system.
MiB is 1024*1024=1048576
You must use DIR /A to look at hidden and system files.
You must run ReAgentC, diskpart, DIR /A command at an Administrator command prompt.
All partition offsets and sizes used in commands in diskpart are in integer multiples of MiB even if they are shown in bytes.
That is what is meant by disk alignment.
Very important:
When ReAgentC is run an entry is appended to C:\Windows\Logs\ReAgent\ReAgent.log
That log will help you understand what is going on. It is very verbose.
Any recovery partition must be identified as Recovery(id=27) not Primary(id=7) and be large enough to be suitable.
When not in use it should be empty.
ReAgentC /disable moves everything from the recovery partition’s NTFS filesystem under \Recovery\WindowsRE to C:\Windows\system32\Recovery.
ReAgentC /enable moves everything from C:\Windows\system32\Recovery to a suitable recovery partition under \Recovery\WindowsRE.
If there is no suitable recovery partition, everthing is moved into C:\Recovery\WindowsRE.
Successful installation of KB5034441 has happened for me under the following circumstance:
- ReAgentC /disable was run moving everything into C:\Windows\system32\Recovery
- The recovery partition was changed from a recovery partition to a primary partition using diskpart set id=7. See log down below. (If you have more than one recovery partition, they all must be changed.)
- ReAgentC /enable was run moving everything into C:\Recovery\WindowsRE.
I ran ReAgentC /info before and afterwards to confirm this. Note that partition3 changed to partition2.
Also look at C:\Windows\Logs\ReAgent\ReAgent.log for confirmation.
Once KB5034441 has finished installing (click retry) you can run ReAgentC /disable followed by ReAgentC /enable then examine C:\Windows\Logs\ReAgent\ReAgent.log.
What you are looking for is this entry for example:
MeetPartitionRequirements Required free space: 525711190
and the partition information (this one is 750 MiB):
Partition number: 3, offset: 2198235774976, free space: 769089536, total space: 786427904
Since KB5034441 originally failed the size will need to be extended to be able to use it.
However you can just use C:\Recovery\WindowsRE as is without doing anything more.
Verify that Start menu: Power > shift-Restart boots into the Recovery Environment all the way to bringing up a console. Type exit to reboot.
The easiest way to resize is just use delete partition in diskpart after shrinking the previous partition.
I had a 509 MiB recovery partition which I resized to 750 MIB, this is the sequence of commands I used:
diskpart list disk select disk 0 list partition select partition 2 shrink desired=241 minimum=241 select partition 3 delete partition override create partition primary id=27 format quick fs=ntfs label=”Windows RE tools” set id=27 list partition list volume exit
Beware that the format command changes the id to 7, so it has to be reset to 27.
Here’s the log of changing the recovery partition into a primary partition using the diskpart set id=7 command
(set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 should work for GPT)
detail partition should show Type: 27 (or de94bba4-06d1-4d40-a16a-bfd50179d6ac for GPT):
C:\Windows\system32>reagentc /info Windows Recovery Environment (Windows RE) and system reset configuration Information: Windows RE status: Enabled Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\WindowsRE Boot Configuration Data (BCD) identifier: 83a4c69e-57e7-11ed-8fff-d0cb8a159000 Recovery image location: Recovery image index: 0 Custom image location: Custom image index: 0 REAGENTC.EXE: Operation Successful. C:\Windows\system32>diskpart Microsoft DiskPart version 10.0.19041.3636 Copyright (C) Microsoft Corporation. DISKPART> list disk Disk ### Status Size Free Dyn Gpt ——– ————- ——- ——- — — Disk 0 Online 2048 GB 0 B Disk 1 Online 1678 GB 1678 GB Disk 2 Online 29 GB 3072 KB DISKPART> select disk 0 Disk 0 is now the selected disk. DISKPART> list partition Partition ### Type Size Offset ————- —————- ——- ——- Partition 1 Primary 50 MB 1024 KB Partition 2 Primary 2047 GB 51 MB Partition 3 Recovery 750 MB 2047 GB DISKPART> select part 3 Partition 3 is now the selected partition. DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ———- — ———– —– ———- ——- ——— ——– Volume 0 D DVD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 50 MB Healthy System Volume 2 C 3C NTFS Partition 2047 GB Healthy Boot Volume 3 F FAT32 Removable 29 GB Healthy * Volume 4 Windows RE NTFS Partition 750 MB Healthy Hidden DISKPART> detail part Partition 3 Type : 27 Hidden: No Active: No Offset in Bytes: 2198235774976 Volume ### Ltr Label Fs Type Size Status Info ———- — ———– —– ———- ——- ——— ——– * Volume 3 E Windows RE NTFS Partition 750 MB Healthy DISKPART> set id=7 override DiskPart successfully set the partition ID. DISKPART> list partition Partition ### Type Size Offset ————- —————- ——- ——- Partition 1 Primary 50 MB 1024 KB Partition 2 Primary 2047 GB 51 MB * Partition 3 Primary 750 MB 2047 GB DISKPART> exit Leaving DiskPart… C:\Windows\system32>reagentc /info Windows Recovery Environment (Windows RE) and system reset configuration Information: Windows RE status: Enabled Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition2\Recovery\WindowsRE Boot Configuration Data (BCD) identifier: 83a4c6a0-57e7-11ed-8fff-d0cb8a159000 Recovery image location: Recovery image index: 0 Custom image location: Custom image index: 0 REAGENTC.EXE: Operation Successful.
To just change the primary partition back into a recovery partition use set id=27 (or for GPT set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac)
See PARTITION_INFORMATION_GPT structure (winioctl.h)
PARTITION_BASIC_DATA_GUID ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 The data partition type that is created and recognized by Windows. Only partitions of this type can be assigned drive letters, receive volume GUID paths, host mounted folders (also called volume mount points) PARTITION_MSFT_RECOVERY_GUID de94bba4-06d1-4d40-a16a-bfd50179d6ac The partition is a Microsoft recovery partition. This value can be set for basic and dynamic disks.
Intel®Core™2 “Wolfdale” E8400 3.0 GHz / 8.00 GB
HP ProDesk 400 G5 SFF PC / Windows 11 Pro / 23H2
Intel®Core™ “Coffee Lake” i3-8100 3.6 GHz / 16.00 GB