How to resize WinRe partition on Windows Server 2022?

You are getting error 0x80070643 when installing KB5034439 in January 2024 updates? You are not only one, there is a problem with the important security patch, and we will look into it now. Problem is that Windows Recovery partition is too small. So, we will look into this problem now, and with the process learn how to resize our Windows partition through CMD.

There is official Microsoft guide on this, you can look it up here, but, with it, when expanding your WinRE partition it will eat up all of your free space. Not ideal. We want to expand WinRE partition only by 250MB.

On fresh Windows Server 2022 installation, I’m getting error 0x80070643, for KB5034439

I also haven’t tested MBR option, so if your disk is MBR, not GPT, please be aware you are testing on your own!

Before we, begin, since this can do a lot of damage, please, test this first in test environment, don’t rush. I cannot take any kind of responsibility, material, physical, mental, if you do something wrong. Test this out make sure you have backups of important data and servers, before proceeding.

Don’t just blindly copy/paste commands, check carefully, which disks and partitions are actually on your system. With these commands you can delete or shrink wrong disk.

Let’s begin

If I look into disk manager, I can see that Recovery Partition is only 570MB. Too small.

Open CMD as Administrator and type in

reagentc /info

We will now disable WinRE partition

reagentc /disable

Now, we need to start diskpart command and list our drives

diskpart

list disk

You’ll see listed all your drives. I can see that my system drive is Disk 10, and it fits when compared to Disk Management layout. Also, take note on the last column, if you have asterisk (*) sign under GPT. That means your disk is partitioned with GPT. If asterisk is missing, then it is MBR.

We will select disk 10, which we will shrink by 250MB of space.

To select disk 10 type in following command (in my case I will change X with 10)

sel disk X

We will now list partitions on disk 10 by typing in

list part

We will take 250MB in space from Partition 3, which is C:\ drive and place where our system is. (in my case I will change X with 3)

sel part X

We will now shrink partition by 250MB

shrink desired=250 minimum=250

Before we proceed, maybe you would like to copy/paste command that I will type next, to be able to do so, right click on Command Prompt label, select Properties, and under Options tab in Edit Options section select Use Ctrl+Shift+C/V as Copy/Paste. Now, with these combinations you’ll be able to copy/paste into CMD.

Let’s continue. We will now select our WinRE partition. Which is in my case partition 4. (in my case I will change X with 4) We will delete WinRE partition and make it larger in size.

sel part X

delete partition override

We will now create new partition. Now, before you proceed. Go back and check if your partition is GPT or MBR. I mentioned it in the beginning of the guide. In my case it is GPT.

For GPT (don’t type this if you have MBR partition!). Size switch is very important and is missing from Microsoft guide and scripts. Without size switch, Windows Recovery partition will eat all of your unformatted empty disk space. I haven’t tested MBR option – in Microsoft documentation it is missing options which I added here – test at your own risk.

create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac size=850

gpt attributes =0x8000000000000001

For MBR (don’t type this if you have GPT partition!) – if command doesn’t work, leave out size=850

create partition primary id=27 size=850

Now, we will format partition

format quick fs=ntfs label=”Windows RE tools”

For MBR you need to additionally specify

set id=27

Let’s check new size of partitions…

list vol

We are done -with diskpart so we will exit

exit

We will now see info about our WinRE partition and enable it again

reagentc /enable

reagentc /info

After that, KB5034439 installed successfully.

Disclaimer