116

I upgraded to Windows 10 and a 450Mb Recovery partition was created on my disk. I would like to extend the system partition but the Recovery partition is in the way.

How can I move the Recovery partition to the end of the disk volume without installing third party software?

7
  • 3
    You can't do it using Windows 10 tools only. Not from Disk Management, neither using DISKPART. I personally recomend MiniTool Partition Wizard. Always backup your files before doing these kinds of operations. Jun 27, 2019 at 21:27
  • 2
    Thanks for the recommendation @milo8505. I have Windows 10 Pro version and for that I expected to handle such trivial tasks natively, now I see this is again something not to look for in the MS world... :/
    – pharsfalvi
    Jun 28, 2019 at 0:58
  • It's not a trivial task. Windows relies on this partition for specific functions. It's not very large either, so there's no great benefit to moving it for the majority of people. Jun 28, 2019 at 18:45
  • 1
    For future reference, you may be able to move the recovery partition (Windows RE) by deleting the partition manually and following the Windows RE deploy instructions on MSDN: docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/…
    – citelao
    Jun 5, 2020 at 20:10
  • 1
    Warning: Minitool will install the Avast malware. You may be able to remove it, if you download avastcleaner and do it from safe mode.
    – unhammer
    Oct 7, 2020 at 9:53

5 Answers 5

124

According to MS's documentation, capture-and-apply-windows-system-and-recovery-partitions, the recovery partition can be captured and applied to a new partition. I have made it to work on my windows 10 PC.

Warning 1: You must know what the following commands do before you execute them. Check the link above and MS's documentation for diskpart, dism and reagentc.

Warning 2: Check disk numbers, partition numbers and volume letters carefully before executing commands.

  1. Use diskpart to find current recovery partition and assign a driver letter(eg. O) to it:
DISKPART> list disk
DISKPART> select disk <the-number-of-disk-where-current-recovery-partition-locate>
DISKPART> list partition
DISKPART> select partition <the-number-of-current-recovery-partition>
DISKPART> assign letter=O
  1. Create an image file from current recovery partition:
Dism /Capture-Image /ImageFile:C:\recovery-partition.wim /CaptureDir:O:\ /Name:"Recovery"
  1. Apply the created image file to another partition(eg. N) that will become the new recovery partition:
Dism /Apply-Image /ImageFile:C:\recovery-partition.wim /Index:1 /ApplyDir:N:\
  1. Register the location of the recovery tools:
reagentc /disable
reagentc /setreimage /path N:\Recovery\WindowsRE
reagentc /enable
  1. Use diskpart to hide the recovery partition:
    • For UEFI:
    DISKPART> select volume N
    DISKPART> set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    DISKPART> gpt attributes=0x8000000000000001
    DISKPART> remove
    
    • For BIOS:
    DISKPART> select volume N
    DISKPART> set id=27
    DISKPART> remove
    
  2. Reboot the computer, now the new recovery partition should be working
  3. (Optional) Delete the old recovery partition:
DISKPART> select volume O
DISKPART> delete partition override
  1. (Optional) Check if the recovery partition is working:
    1. Show the current status:
      reagentc /info
      
    2. Specifies that Windows RE starts automatically the next time the system starts:
      reagentc /boottore
      
    3. Reboot the computer and do your stuff in Windows RE (eg. enter CMD and run some tools)
23
  • 1
    While creating the image, dism forced me to give a name with /name option, but other than that I was able to get through step 4. I confirmed that reagentc /info showed the status as Enabled, but once I changed the id to 27, status became Disabled and reagentc /boottore complained about the same. What could I be doing wrong?
    – haridsv
    Dec 31, 2020 at 11:38
  • 5
    There is a subtle gotcha, at least in Windows 10 2004, which is the one I just did this on: When reagentc /setreimage /path N:\Recovery\WindowsRE is executed, it actually doesn't change the Windows RE location. Once the original partition (O:) is deleted, reagentc reports Disabled. The workaround is to run reagentc /disable before step 4, or to do step 7 before step 4.
    – Jake F
    Jan 16, 2021 at 15:01
  • 4
    @JakeF Thanks for nice finding this. Added a disable-step before step 4.
    – VainMan
    Jan 16, 2021 at 17:57
  • 3
    I wanted to say great comment, people generally don't care about following through like this, and it bugs me But +1 and thanks are discouraged lol So I thought I might add a suggestion In step 2 there is no name for the image, Windows 10 1904 will complain if there is no name Just great to see thoughtful people putting the effort in, document the world!
    – Steve
    Feb 14, 2021 at 0:16
  • 22
    Great instructions! One comment: after following the above instructions, my new recovery partition kept reappearing in Windows Explorer/ This PC as drive 'N' despite the diskpart > remove step. I discovered there was a registry key \DosDevices\N: under Computer\HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices that was making this come back. Deleting that key fixed this issue. YMMV; registry editing precautions apply. This is detailed here: answers.microsoft.com/en-us/windows/forum/all/…
    – SSilk
    Jul 25, 2021 at 21:12
50

I know VainMain's answer from above is probably more careful and thorough, but I've been able to successfully move the partion by simply doing:

  1. In Windows 10: reagentc /disable
  2. In Linux boot CD: Adjust neighboring partition as needed/move recovery partition.
  3. In Windows 10 reagentc /enable

Recovery environment was automatically rediscovered and booted WinRE just fine with all recovery options (Reset/System Image restore/etc). I had only 1 C: partition, no special partitioning/dual booting/multiple recovery partition/crazy BCDEDIT settings beforehand, which helped. Tested inside a VM beforehard to make sure. Had no problems after executing live.

If I remember correctly, skipping the first step (disabling via reangetc) would cause the recovery environment to end up misconfigured, not properly re-bootable, and not easily fixed.

5
  • 3
    Can confirm, worked perfectly. Used DiskGenius to make a new partition at the end of my NVMe. Clone partition into it, delete old, reactivate. If you want to get fancy you can even set it's "file system" to 27: Microsoft Recovery Partition. It's just a hidden NTFS (but you WILL be able to delete from Disk Management, so be careful!). You may use reagentc /info before and after to confirm.
    – kcdwayne
    Sep 15, 2021 at 2:32
  • 5
    Used a Debian live ISO with Gparted to resize my Windows 11 setup, the process was surprisingly smooth! Thanks for the tip!
    – Xerz
    Oct 6, 2021 at 18:08
  • 2
    Using linux to move and resize the recovery partition and after that assigning drive letter and using single line from vainMan's answer worked : reagentc /setreimage /path N:\Recovery\WindowsRE Mar 22, 2022 at 11:54
  • After moving the partition with gparted and rebooting into Windows, I ran reagentc /enable and got "The Windows RE image was not found". But re-running the same command a few minutes later, it worked. So using a live Linux with "gparted" is definitely the easiest way to do that.
    – mivk
    Apr 29, 2023 at 16:25
  • 1
    What happens if I move the recovery partition in front on C: partition so that future disk extensions are easier?
    – Petr
    May 16, 2023 at 11:31
6

Like the person above I was able to do this by

  1. Open Windows Command prompt as admin and run reagentc /info
  • this showed recovery as Enabled, and gave the location on the disk and the BCD identifier.
  1. reagentc /disable
  • reagentc /info showed Disabled, no location and a zero identifier
  1. Shut down and boot into Linux. Move the recovery partition (to the left) with GParted.
  2. Shut down and boot back into Windows. Run reagentc /enable (reported Operation Successful)
  • reagentc /info now showed Enabled, the same location and a new BCD identifier (one digit different).
1
  • 5
    Please don't simply repeat the answers others have given. Each answer need only be given once. Jun 18, 2021 at 3:46
5

An example how to move Recovery Partition to OS Partition

diskpart
DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0         System Rese  NTFS   Partition    500 MB  Healthy    System
  Volume 1     C   Windows11    NTFS   Partition     58 GB  Healthy    Boot
  Volume 2                      NTFS   Partition    617 MB  Healthy    Hidden

DISKPART> select volume 2
DISKPART> assign letter=F
DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0         System Rese  NTFS   Partition    500 MB  Healthy    System
  Volume 1     C   Windows11    NTFS   Partition     58 GB  Healthy    Boot
  Volume 2     F                NTFS   Partition    617 MB  Healthy    Hidden

DISKPART> exit
xcopy F:\Recovery C:\Recovery /E /H /I
ReAgentc /info

Windows Recovery Environment (Windows RE) and system reset configuration
Information:

    Windows RE status:         Enabled
    Windows RE location:       \\?\GLOBALROOT\device\harddisk2\partition3\Recovery\WindowsRE
    Boot Configuration Data (BCD) identifier: b4c3cf2d-1282-11ed-b4c8-b90a37105c4b
    Recovery image location:
    Recovery image index:      0
    Custom image location:
    Custom image index:        0
ReAgentc /disable

ReAgentc /setreimage /path C:\Recovery\WindowsRE /target C:\Windows

ReAgentc /enable
ReAgentc /info

Windows Recovery Environment (Windows RE) and system reset configuration
Information:

    Windows RE status:         Enabled
    Windows RE location:       \\?\GLOBALROOT\device\harddisk2\partition2\Recovery\WindowsRE
    Boot Configuration Data (BCD) identifier: b4c3cf2f-1282-11ed-b4c8-b90a37105c4b
    Recovery image location:
    Recovery image index:      0
    Custom image location:
    Custom image index:        0

NOTE: Observe that "partition3" changed to "partition2"

delete a Recovery Partition

diskpart
DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0         System Rese  NTFS   Partition    500 MB  Healthy    System
  Volume 1     C   Windows11    NTFS   Partition     58 GB  Healthy    Boot
  Volume 2     F                NTFS   Partition    617 MB  Healthy    Hidden

DISKPART> select volume 2
DISKPART> detail partition

Partition 3
Type  : 27
Hidden: No
Active: No
Offset in Bytes: 83763396608

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
* Volume 2     F                NTFS   Partition    617 MB  Healthy    Hidden

DISKPART> delete partition override
DISKPART> exit
3
  • when I try to run ReAgentc /setreimage /path C:\Recovery\WindowsRE /target C:\Windows I get the message "The specified path was not found" Should the path be F:\Recovery\WindowsRE ?
    – mal
    Sep 17, 2022 at 13:39
  • In response to my own comment above - no, the result is the same
    – mal
    Sep 17, 2022 at 13:43
  • 1
    I obviously made a mistake somewhere along the way, my files were in C:\WindowsRE not C:\Recovery\WindowsRE In any case, this worked perfectly once I figured that out.
    – mal
    Sep 17, 2022 at 14:24
4

Just as an addition to the answer of VainMan and the comment of haridsv (can't comment myself yet):

I had the same problem. Instead of DISKPART> remove execute mountvol N: /d on the command line. If you already have removed the partition first reassign a drive letter to the new recovery partition with assign letter=N (normally reagentc /info should now show the correct status again, otherwise repeat step 4 of VainMans instructions).

2
  • Actually, diskpart's remove and mountvol's /d is the same thing in this specific situation. The illusion was probably created by duplicitous behavior of reagentc's /setreimage and the confusion it created. I don't mean "confusion" here as a personal attack — it confused me as well, for about an hour when I tried the workflow again and again with slight variations, until figuring out the actual behavior.
    – Jake F
    Jan 16, 2021 at 15:10
  • @JakeF It's not an illusion or duplicitous, it's simply the incorrect sequence of commands was executed, as in order for WinRE's path to be changed, it must be disabled (it's analogous to trying to capture a WIM of C: while booted to Windows)
    – JW0914
    Apr 15, 2022 at 12:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .