DEV Community

Cover image for Recreate Windows Recovery Environment partition
Sergio Peris
Sergio Peris

Posted on • Originally published at sertxu.dev

Recreate Windows Recovery Environment partition

When you install Windows on a drive it creates different partitions, one for the boot, another for the data and another for the Windows Recovery Environment (WinRE).

The WinRE partition usually is the last one on your drive, so if you clone your disk to another bigger, to expand the data partition you will be required to delete the existing WinRE partition.

Following the next steps you will be able to recreate it.

Open a command prompt as an Administrator and run carefully as some command might be different on your computer.

First, check the WinRE status to check if it's enabled.

reagentc /info

  Windows RE status:   Enabled
Enter fullscreen mode Exit fullscreen mode

If it's enabled we should disable it.

reagentc /disable
Enter fullscreen mode Exit fullscreen mode

Now, using the DiskPart utility we're going to create a delete the partition where WinRE is located.

diskpart
Enter fullscreen mode Exit fullscreen mode

Now, we should find the disk where Windows is installed.

list disk

  Núm Disco  Estado      Tamaño   Disp     Din  Gpt
  ---------- ----------  -------  -------  ---  ---
  Disco 0    En línea     953 GB      0 B        *
Enter fullscreen mode Exit fullscreen mode

And we select it.

select disk 0

  El disco 0 es ahora el disco seleccionado.
Enter fullscreen mode Exit fullscreen mode

Next, we should find the WinRE partition.

list partition

  Núm Partición  Tipo              Tamaño   Desplazamiento
  -------------  ----------------  -------  ---------------
  Partición 1    Sistema            100 MB  1024 KB
  Partición 2    Reservado           16 MB   101 MB
  Partición 3    Principal          952 GB   117 MB
  Partición 4    Recuperación       786 MB   953 GB
Enter fullscreen mode Exit fullscreen mode

And we select it.

select partition 4

  La partición 4 es ahora la partición seleccionada.
Enter fullscreen mode Exit fullscreen mode

And we delete it.

delete partition override
Enter fullscreen mode Exit fullscreen mode

Keep in mind you should leave at least 250 MB available to recreate the WinRE partition.

If you want to expand your data partition, you can do it now, once you're ready to go follow the next steps.

To recreate the WinRE partition we will use the DiskPart utility again.

diskpart
Enter fullscreen mode Exit fullscreen mode

We list the available disks. Note the asterisk character * at the GPT column, some steps differ if your drive is GPT or MBR.

If your drive has the asterisk character, your drive is GPT. Otherwise, your drive is MBR.

list disk

  Núm Disco  Estado      Tamaño   Disp     Din  Gpt
  ---------- ----------  -------  -------  ---  ---
  Disco 0    En línea     953 GB      0 B        *
Enter fullscreen mode Exit fullscreen mode

And we select it.

select disk 0

  El disco 0 es ahora el disco seleccionado.
Enter fullscreen mode Exit fullscreen mode

Next, we create the partition.

  • If your disk is GPT:
create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac

gpt attributes =0x8000000000000001
Enter fullscreen mode Exit fullscreen mode
  • If your disk is MBR:
create partition primary id=27
Enter fullscreen mode Exit fullscreen mode

Now, we format the newly created partition.

format quick fs=ntfs label="Windows RE tools"
Enter fullscreen mode Exit fullscreen mode
  • If your disk is MBR you should also run:
set id=27
Enter fullscreen mode Exit fullscreen mode

We've created the WinRE partition, you can check it running:

list partition
Enter fullscreen mode Exit fullscreen mode

We can now exit the DiskPart utility.

exit
Enter fullscreen mode Exit fullscreen mode

Now, we should re-enable WinRE.

reagentc /enable
Enter fullscreen mode Exit fullscreen mode

To confirm it has successfully re-enabled, run:

reagentc /info

  Windows RE status:   Enabled
Enter fullscreen mode Exit fullscreen mode

Top comments (0)