Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SOURCE: https://support.microsoft.com/en-us/topic/kb5028997-instructions-to-manually-resize-your-partition-to-install-the-winre-update-400faa27-9343-461c-ada9-24c8229763bf
- SOURCE: https://www.bleepingcomputer.com/news/microsoft/windows-10-kb5034441-security-update-fails-with-0x80070643-errors/
- SOURCE: https://www.tenforums.com/tutorials/106215-factory-recovery-create-custom-recovery-partition-8.html
- Online Post: https://pastebin.com/4z64XKeg
- NOTE: Its useful to have [Start > Create and format hard disk partitions] open in a side window for a visual representation of what is happening to the drive while issuing commands.
- Manually resize the Recovery Partition to be 250 MB larger to fix error 0x80070643 for KB5034441:
- 1. Open a Command Prompt window (cmd) as admin.
- 2. Check the WinRE status: $ reagentc /info
- If the WinRE is installed, there should be a "Windows RE location" with a path to the WinRE directory.
- For example: "Windows RE location: [file://%3f/GLOBALROOT/device/harddisk0/partition4/Recovery/WindowsRE]\\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE."
- Examining "\\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE", the number after "harddisk" and "partition" is the index of the disk and the partition WinRE is on.
- 3. Disable the WinRE: $ reagentc /disable
- WARNING: If you skip [$ reagentc /disable] then later when you run [$ reagentc /enable] you will get "REAGENTC.EXE: The Windows RE image was not found".
- SOURCE: https://www.youtube.com/watch?v=hlNtLcFqfOo
- The reason this happens is [$ reagentc /disable] moves a file called Winre.wim from the recovery partition to C:\Windows\System32\Recovery\ for safe keeping.
- And [$ reagentc /enable] moves Winre.wim from C:\Windows\System32\Recovery\ to the recovery partition.
- If you delete the Recovery partition without disabling reagentc then you have work to do to extract a copy of Winre.wim from a Windows ISO.
- 1. Mount the Windows ISO.
- NOTE: IDK if it matters if the Windows ISO is not the exact same version as the OS you have installed according to $ winver.
- But if this happened to me i would use https://files.rg-adguard.net/ to find the name of the iso with the matching version
- and download it from the internet.
- 2. Go to the sources folder and locate "install.esd" e.g. D:\sources\install.esd.
- 3. cmd as administrator:
- NOTE: In the next steps, replace "D:\sources\install.esd" with the path to your install.wim file and /Index:1 with the appropriate index number. C:\mount is the directory where the image will be mounted.
- A. Use the following command to list the indices within the install.esd file:
- $ dism /Get-WimInfo /WimFile:D:\sources\install.esd <-- Remember the index number that matches your OS.
- B. Create an install.wim from the install.esd:
- NOTE: This step takes a while. If you click the cmd prompt, then it will pause progress. Press enter if that happens to unpause.
- $ dism /Export-Image /SourceImageFile:D:\sources\install.esd /SourceIndex:3 /DestinationImageFile:C:\install.wim /Compress:max /CheckIntegrity
- C. Create a mount directory:
- NOTE: This step takes a while. If you click the cmd prompt, then it will pause progress. Press enter if that happens to unpause.
- $ mkdir C:\mount
- D. Confirm that in the created C:\install.wim that your OS index is now 1, i.e. it only contains your selected OS at index 1:
- $ dism /Get-WimInfo /WimFile:C:\install.wim
- E. Mount C:\install.wim at the desired index:
- $ dism /Mount-Image /ImageFile:C:\install.wim /Index:1 /MountDir:C:\mount
- F. Locate and Copy Winre.wim to C:\Windows\System32\Recovery\:
- $ copy C:\mount\Windows\System32\Recovery\Winre.wim C:\Windows\System32\Recovery\
- G. Unmount the image and cleanup:
- NOTE: This step takes a while.
- $ dism /Unmount-Wim /MountDir:C:\mount /Discard
- $ rmdir C:\mount
- $ del C:\install.wim
- 4. [$ reagentc /enable] should work now without error.
- 4. Shrink the OS partition and prepare the disk for a new recovery partition.
- A. Shrink the OS: $ diskpart
- B. Run $ list disk
- C. Select the OS disk: $ sel disk <OS disk index>
- This should be the same disk index with the recovery partition.
- D. Select the WinRE partition: $ sel part <WinRE partition index>
- -----
- E. Note the type of the partition before we delete it: detail partition
- F. Delete the WinRE partition: $ delete partition override
- -----
- G. Find the partition index of the OS partition: $ list part
- It will be the partition before the recovery partition on a standard Windows install.
- H. Select the OS partition: $ sel part <OS partition index>
- I. Shrink the OS partition by 250 MB run $ shrink desired=250 minimum=250
- -----
- J. For SSDs you should have unallocated space after the recovery partition for wear leveling.
- I like to use 50 GB (51200 MB) but the amount is up to you.
- To shrink the OS partition by an additional 50 GB run $ shrink desired=51200 minimum=51200
- K. Check if the drive is GPT (GUID Partition Table) or MBR (Master Boot Record):
- $ list disk <-- If you see '*' in in the "Gpt" column then its GPT, otherwise its MBR.
- NOTE: The default recovery partition size for Windows 10 is 522 MB.
- For Windows 11 its size is 768 MB (+246 MB larger).
- Microsoft instructions suggest making a +250 MB larger partition,
- so the new recovery partition size will be: 522 MB + 250 MB = 772 MB.
- NOTE: Microsoft instructions do not specify a size, but we will because it prevents
- the new recovery partition from taking up all the unallocated space at the end of the drive,
- which we want to keep unallocated for SSD wear leveling reasons.
- L. Create a new recovery partition:
- For GPT drives:
- $ create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac size=772
- $ gpt attributes=0x8000000000000001 <-- WARNING: Do not forget to do this.
- --- --- -- This changes "Required: No" to "Required: Yes" in [$ detail partition].
- If you skip this step then [Start > Create and format hard disk partitions]
- will ONLY display the size of the Recovery partition,
- and will NOT display "Healthy (Recovery Parititon)".
- WARNING: ^-- Do not forget to do this.
- NOTE: If "Healthy (Recovery Parititon)" isn't shown in Start > Create and format hard disk partitions
- then try this to mark the selected partition as a recovery partition:
- $ detail partition <-- What does the type indicate that is causing this issue?
- $ set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
- $ detail partition <-- Should see type: de94bba4-06d1-4d40-a16a-bfd50179d6ac
- You should now see "Healthy (Recovery Parititon)" in Start > Create and format hard disk partitions.
- Or
- For MBR drives:
- $ create partition primary id=27 size=772
- NOTE: If "Healthy (Recovery Parititon)" isn't shown in Start > Create and format hard disk partitions
- then try this to mark the selected partition as a recovery partition:
- $ detail partition <-- What does the type indicate that is causing this issue? NOTE: I got "type: 07" every time i tried this on a MBR system for some reason:
- 07 = Windows NT NTFS
- 17 = Hidden
- 27 = OEM Recovery
- $ set id=27
- $ detail partition <-- Should see type: 27
- You should now see "Healthy (Recovery Parititon)" in Start > Create and format hard disk partitions.
- M. Format the recovery partition:
- $ format fs=ntfs quick <-- TODO: Not sure why M$ instructions added [label="Windows RE tools"] here when the original recovery partition had no label.
- 5. Exit from diskpart: $ exit
- 6. Enable WinRE: $ reagentc /enable
- 7. Confirm WinRE is enabled: $ reagentc /info <-- If you get the error message "REAGENTC.EXE: The Windows RE image was not found" then re-read step 3 for the fix.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement