---
title: 'Howto Windows Recovery Partition move'
url: 'https://willifix.net/blog/howto-windows-recovery-partition-move'
markdown: 'https://willifix.net/blog/howto-windows-recovery-partition-move.md'
date: '2025-05-16'
description: 'What happened A few days ago, I once again had to retrieve a large amount of data from M$ Sharepoint. The way I know is via Onedrive. You create a shortcut in Onedrive and then tell it to keep the whole folder locally. Since I rarely use Windows, I do this stuff in a Windows VM. Unfortunately, the …'
---

# Howto Windows Recovery Partition move

## [Howto Windows Recovery Partition move](https://willifix.net/blog/howto-windows-recovery-partition-move)

    16th May 2025  

### What happened

A few days ago, I once again had to retrieve a large amount of data from M$ `Sharepoint`. The way I know is via `Onedrive`. You create a shortcut in `Onedrive` and then tell it to keep the whole folder locally. Since I rarely use `Windows`, I do this stuff in a `Windows` VM. Unfortunately, the hard disk in the VM was not big enough to download the folder completely.

#### Increase the disk

So I first enlarged the hard disk in the VM (**qemu-img resize ...**). So far so good, but now I was confronted with the problem that unfortunately, the recovery partition is located directly behind the `Windows` partition to be enlarged. This can neither be deleted nor moved by Windows using the hard disk management provided. What a mess. So first i think i must boot into some `Linux LE` to fix this with `gdisk` or `gparted`. But fortunately there is a better way for doing this inside of the running Windows.

#### how to fix it in the running windows

Here are the needed steps to move the Recovery Partition to the End of the disk.

1. start a powershell as Administrator
2. Run`reagentc /disable` command will disable the recovery partition and will move the recovery partition into a file named Winre.wim and will be located in `C:\Windows\System32\Recovery` (you have to enable showing hidden system files if you want to see it)

    ```powershell
    reagentc /disable
    ```
3. start diskpart and select the correct disk

    ```powershell
    diskpart
    list disk
    select disk 0
    list partition
    ```

    here is my output

    ![ps1](https://willifix.net/user/pages/03.blog/howto-windows-recovery-partition-move/ps1.png "ps1")
4. select the partition and delete it

    ```powershell
    select partition 4
    delete partition override
    ```

Now you can expand the Disk via DiskManagement. Please leftover 1 GB for the new RE Partition. You should then create a new Volume after the increased Windows Partition as follows: **NTFS, no drive letter, Name -> New Recovery**

#### back to the console

you should have open diskpart already if not start it again with a elevated powershell

1. select the new Recovery Partition ```powershell
    select partition 4
    set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
    gpt attributes=0x8000000000000001
    ```

On GPT disks we need to change the partition ID to de94bba4-06d1-4d40-a16a-bfd50179d6ac which tells Windows that this is a recovery partition
We also need to hide the drive and flag it as a required partition to do that we have to set a GPT attribute to 0x8000000000000001

2. Quit diskpart and reenable the Recovery Partition with ```powershell
    reagentc /enable
    ```

 [ Previous Post](https://willifix.net/blog/yubikey-magic-unlock) [Next Post ](https://willifix.net/blog/howto-encrypt-backups-on-creation)

---

## Navigation

- Parent: [Blog](https://willifix.net/blog.md)
- Previous: [Howto Encrypt Backups on creation](https://willifix.net/blog/howto-encrypt-backups-on-creation.md)
- Next: [yubikey magic unlock](https://willifix.net/blog/yubikey-magic-unlock.md)
