StrangeTech 26 Reputation points

With the introduction of the new partition structure( Windows 10 21H2, Windows 11) I am having problems with the ExtendOSPartition command in the unattended file. We have previously always built the image on smaller drives, resealed the image with sysprep and cloned to larger drives of varied sizes.
With the Recovery partition being installed at the end of the disk the OS partition is restricted and does not auto extend.

We are processing around 100 Hard drives a month so cloning has been the most efficient option, but I am open to alternatives if available.

<settings pass="specialize">  
        <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  

If it is not possible to automatically extend the OS partition with the recovery partition there, is there a script for the creation of a recovery partition, post install.


Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,899 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,096 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,336 Reputation points

    This is not unique to Windows 11.

    It is related to the Microsoft disk management feature.

    Extend volume is available when there is unallocated space immediately to the right of C:

    When there is not free space extend volume appears grey in disk management.

    The extend volume cannot be performed when grey in any Windows edition / version (11, 10, 8.1, 7, etc.)

    ""You can use Disk Management to add space to an existing volume, extending it into empty space on the drive, but only if the empty space doesn't have a volume on it (it's unallocated) and comes immediately after the volume you want to extend, with no other volumes in-between, as shown in the following image. The volume to extend also must be formatted with the NTFS or ReFS file systems.""


    Since the recovery partition is right after C: and the allocated space if after it, the only option is to use a 3rd party Partition manager or Partition assistance to change the order of the partitions. Some of these apps, also provide a command line that can be invoked during Unattended XML.


    --If the reply is helpful, please Upvote and Accept as answer--

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. S.Sengupta 14,811 Reputation points MVP
    0 comments No comments

  2. StrangeTech 26 Reputation points


    The best solution I have found is deleting the Recovery partition in Diskpart, Expanding the OS partition, then rebuilding the recovery partition
    This requires running this script from a Windows PE enviroment.

    Its's not a perfect solution, but it'll do.

    0 comments No comments