/
/

How to Create a Custom Bootable Recovery Partition to Restore Windows

How to Create a Custom Bootable Recovery Partition to Restore Windows blog banner image

Most Windows computers come with a factory partition to restore a system to its original state. However, reverting to factory settings means dealing with outdated Windows versions, unwanted bloatware, and the risk of losing user settings.

An easier way would be to create a custom recovery partition by capturing a system’s disk image, enabling users to restore a device without having to start from scratch. Learn how to create a custom bootable recovery partition through this guide, saving you time and ensuring your Windows computer is always up and running.

How to create a custom recovery partition in Windows 10

Part 1: Prepare Windows for recovery image creation

  1. Ensure Windows is updated to the latest version.
    1. Below are quick instructions on how to manually check for Windows Updates:
      1. Press Start > Settings > Update & Security Windows Update.
      2. Click Check for Updates to download and install pending updates.
  2. Remove unnecessary files to reduce the recovery image size.
    1. The Disk Cleanup tool can be used to remove unwanted files.
      1. Type disk cleanup using the Search Bar, and then open the Disk Cleanup app.
        1. Select a drive when prompted, then click OK.
      2. Tick the box next to the type of files you want cleaned.
      3. Once all desired files are selected, press OK.
  3. Create a full system backup before making a recovery image.

Note: This safeguards users against possible boot issues after modifying a partition.

  1. Instructions on creating a backup in Windows 10:
    1. Log in with a Microsoft Account. free account comes with 5GB of OneDrive cloud storage for backup.
    2. Press Start, then type Backup.
    3. Select Windows Backup.
    4. Choose which files and settings to back up.
    5. Click Back up. Wait for the process to complete.

Part 2: Create a custom recovery image

  1. Open the Command Prompt as Administrator.
    1. Click Start and type cmd.
    2. Right-click Command Prompt, then press Run as Administrator.
  2. Use the DISM tool to capture a system image. (Note: Ensure the target partition has at least twice the used space of C:\ to avoid insufficient disk space errors.)
    1. Enter the following command: dism /capture-image /imagefile:D:\install.wim /capturedir:C:\ /name:”Recovery” /description:”My Custom Recovery Image” /compress:maximum
      1. The switch /imagefile:D: indicates where the captured Windows image will be saved. In this case, D: is the target drive.
      2. /capturedir:C: contains the drive letter where the Windows image to be captured is located. In this example, C: is the drive we’ll capture.
      3. /description:”My Custom Recovery Image” is an essential switch as it ensures the .wim file can be used for system recovery.
  3. Save the image (.wim) to a separate partition or external storage.

Part 3: Create a recovery partition

Note: If you’re working on a drive with available space, you can shrink its unallocated space to make space for another partition.

  1. Use DISKPART to create a new partition.
    1. Open Command Prompt as administrator.
    2. Type diskpart and press enter.
    3. Afterward, type list disk and hit enter.
      1. All detected disks will be shown enumerated with a corresponding number.
    4. Type select disk X and press enter.
      1. X is the number that corresponds to your chosen drive.
    5. Enter the command create partition primary size=X.
      1. X denotes the size in MB you want your partition to have.
      2. It’s advisable to have your partition size the same as your .wim file size + 1GB rounded up to the next full GB.
        1. For example, your .wim file size is 10.4GB, add 1 GB for a total of 11.4GB, and round off to the next GB, which would now be 12GB (12,000MB).
  2. Format the partition and assign a letter for easy access.
    1. Start formatting the partition by typing format fs=ntfs quick.
    2. Once the partition is finished formatting, users can assign drive letters by typing assign letter=X and pressing enter.
      1. X is the letter you want to assign the partition.
      2. To remove an assigned letter, type remove letter=X.
    3. With the partition still selected, enter the following command: set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac.
      1. This command sets the partition type as recovery.
    4. Next, type gpt attributes=0x8000000000000001.
      1. This gpt attribute indicates the partition as an EFI System Partition and marks it as active.
    5. Type exit, then hit enter.
  3. Move the custom recovery image (.wim file) to the partition.

Part 4: Configure Windows to recognize the recovery partition

  1. Use Reagentc.exe to register the recovery image with Windows.
    1. Open Command Prompt as an administrator.
    2. Enter reagent c/enable to detect the recovery partition automatically.
  2. Verify the recovery partition status using system commands.
    1. Using an elevated Command Prompt, type reagentc /info.
      1. The device’s Windows RE status should say Enabled, and the location should reflect the drive where the recovery image is stored.

Part 5: Test the recovery process

  1. Boot into Windows Recovery Environment (WinRE).
    1. Open the Windows Start button.
    2. Hold down Shift while selecting Power > Restart to boot into WinRE.
  2. Confirm that the custom recovery partition is detected.
    1. Recovery option should be present in the boot menu.

What does a recovery partition do in Windows 10

A recovery partition dedicates space on the hard drive for system recovery files, allowing users to capture a Windows image and restore it to that point without requiring external media.

Comparing custom and factory recovery in Windows 10

Why use a factory recovery partition

The built-in factory recovery partition in Windows restores a device to its original state, fixing corrupted boot drives and other booting issues. However, a factory recovery means losing all system settings, key Windows updates, and applications.

Why create a custom recovery partition

A custom partition enables a complete Windows image capture to retain software, drivers, and settings. Bootable recovery partitions are ideal for users who frequently reset their PCs and IT professionals who manage multiple Windows systems.

Benefits:
  • Quick and easy recovery. Eliminates the need for external drives by centralizing system recovery via Windows Recovery.
  • Enables customized recovery. Bootable recovery partitions capture an image of Windows, allowing the system to revert to an image’s precise state.
Limitations:
  • Requires sufficient disk space. Users should allocate enough disk space for the custom recovery image, which will vary according to the size of software and system files in the image.
  • Dependent on drive health. Once a drive fails, the created recovery partition is lost unless backed up externally.

Troubleshooting common recovery partition issues

Issue: Recovery partition not detected

There are two ways to ensure a system detects a recovery partition. One method is to ensure the partition is marked active using the correct gpt attributes.

For some, a correctly registered recovery image path can solve the problem. To verify, open an elevated Command Prompt, type reagentc /info, and then hit Enter.

Issue: Reagentc.exe fails to enable recovery

If this happens, users can check if they are running UEFI or Legacy BIOS mode, as different setups affect recovery registration. Insufficient space can also affect how recovery methods behave, sometimes forcing an incomplete recovery or ultimately failing to restore the system.

Issue: The system won’t boot after modifying partitions

You can create a Windows installation media on a separate drive and use it to boot your device. Choose Repair your computer or Troubleshoot, then enable Startup Repair. If this method fails, you can restore the system using a full system backup.

Frequently asked questions about bootable recovery partitions

Can I create a recovery partition on an external drive?

You can create a recovery partition using an external drive. To do this, save the captured image to the external drive by modifying the DISM switch /imagefile:X: from dism /capture-image /imagefile:X:\install.wim /capturedir:C:\ /name:”Recovery” /description:”My Custom Recovery Image” /compress:maximum—where X is the drive letter of your external drive.

Will a custom recovery partition overwrite the OEM recovery partition?

The answer is yes if you replace the factory recovery partition with your custom partition. However, the OEM recovery partition can remain in the system if you use an external drive to store the custom partition image for bare metal restores.

How much space is needed for a recovery partition?

The size of the recovery partition should generally be the same size as your system image file plus 1GB, rounded to the next full GB. For instance, if the system image file is 12.5 GB, add 1GB for a total of 13.5GB, then round off to the next GB, which gives us 14GB.

Can I update the recovery partition after creating it?

No, users must create a new system image backup with the latest Windows version and software. It’s generally advised to update your Windows to the latest version before making a recovery partition.

What’s the difference between a factory reset and a custom recovery partition?

A factory reset enables users to quickly and easily revert a device back to its original settings. Conversely, a custom bootable recovery partition utilizes a .wim file to allow system recovery at a specific point in time, retaining data according to a user’s preference.

Restore Windows using a bootable recovery partition

A custom recovery partition allows users to restore a specific version of Windows without the need for external media. This process involves backing up necessary files, creating a recovery image, setting up a partition, and configuring Windows to recognize it.

Thorough testing must be done to ensure that the recovery partition functions correctly in case of a system failure. Moreover, following the troubleshooting steps in this guide can help resolve partition detection issues and provide a successful recovery partition setup.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).