Manually create Windows recovery partition before OS partition

Microsoft Windows

With the newer Microsoft OS’s (both workstations and servers), Microsoft decided to start building a recovery partition AFTER the OS partition. This means if you need to increase the size of the OS partition, you must do some work first to get rid of the recovery partition before you can extend the OS partition size. Instead of all this, you could just manually create a more desirable partition layout, which places the recovery partition BEFORE the OS partition. This is done during a clean install, so be warned, it will clean off the entire contents of the disk you are targeting. Here’s how:

  1. Boot into your Windows installer media from USB, DVD, ISO, etc.
  2. Press Shift+F10 to launch a command prompt.
  3. Type diskpart and press Enter.
  4. Here are the commands you need to enter. Note: A line starting with rem is just a remake and can be skipped:
rem == CreatePartitions-UEFI.txt ==
rem == These commands are used with DiskPart to
rem create four partitions
rem for a UEFI/GPT-based PC.
rem Adjust the partition sizes to fill the drive
rem as necessary. ==
select disk 0
clean
convert gpt
rem == 1. System partition =========================
create partition efi size=100
rem ** NOTE: For Advanced Format 4Kn drives,
rem change this value to size = 260 **
format quick fs=fat32 label="System"
assign letter="S"
rem == 2. Microsoft Reserved (MSR) partition =======
create partition msr size=16
rem === 3. Recovery tools partition ================
create partition primary size=1500
format quick fs=ntfs label="Recovery"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
rem == 4. Windows partition ========================
rem == a. Create the Windows partition ==========
create partition primary
rem == b. Prepare the Windows partition =========
format quick fs=ntfs label="OS"
assign letter="W"
list volume
exit

Here are some other helpful articles:

Disk partition requirement for using Windows RE tools on a UEFI-based computer – Windows Client | Microsoft Learn

How to recreate the Windows recovery partition. Solved – Windows 10 Forums (tenforums.com)

UEFI/GPT-based hard drive partitions | Microsoft Learn

Windows 10 Clean Installation – Recovery Partition Position – Microsoft Community

Fix: Can’t Extend Volume in Windows | Windows OS Hub (woshub.com)

Leave a Reply

Your email address will not be published. Required fields are marked *