How to properly hide a Recovery partition?

Chetar Ruby 21 Reputation points

I am using DISKPART to hide my recovery partition during normal OS usage. I use the 'attribute volume set nodefaultdriveletter' command.

When I do this, upon booting the recovery partition and initiating setup, setup complains it requires a device driver to proceed. It's acting like it can't find the installation files. When I click 'browse' at that device driver thing, I can see the installation media, but... it won't do anything. This is what is presented:

I tried also using 'attribute volume set hidden' on the Recovery partition, but this makes the system unbootable. It just sits at the spinning circle forever when I attempt to boot the system. The boot menu never comes up, it never dies, just perpetually spinning.

I used this guide to create my recovery partition and boot menu.

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,784 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Chetar Ruby 21 Reputation points

    I came up with a usable work-around for this issue. I will outline the steps I've taken should anyone else have this problem:

    1. Install windows normally.
    2. Do the sysprep stuff.
    3. Make a recovery partition and fill it.
    4. Do not hide recovery partition in final image.

    In the sealed image, using SetupComplete.cmd script, I execute the following Powershell script to hide the recovery partition after user signs in the first time:

    $Partition = Get-Volume -FileSystemLabel "RECOVERY" | Get-Partition
    Remove-PartitionAccessPath -DiskNumber $Partition.DiskNumber -PartitionNumber $Partition.PartitionNumber -AccessPath "$($Partition.DriveLetter):"

    Doing it this way doesn't damage the system startup in any way, recovery partition works without issue. It's not a full solution, but it is an effective work-around.

    2 people found this answer helpful.

  2. Teemo Tang 11,086 Reputation points

    Recovery partition will be visible in certain tools, like Disk Management, but can be hidden in Explorer or various other programs that might display it.

    The common steps are:

    1. Right click the Start menu and select Disk Management.
    2. Locate the partition you’d like to hide and click to select it.
    3. Right-click the partition (or disk) and select Change Drive Letter and Paths from the list of options.
    4. Click the Remove button.This won’t delete anything.
    5. Click Yes on the warning confirming you’d like to hide the disk or partition. If the drive is currently in use, you’ll need to restart your PC after this step.

    If we want to use diskpart command:
    Run Command Prompt as Administrator
    Run this command and hit Enter
    Run this command and hit Enter
    list volume
    Note down the letter associated with that new drive
    Run these commands one at a time and hit Enter (replace X with the correct drive letter)
    select volume X
    remove letter=X
    Close Command Prompt and restart your PC


    Similar case:
    Windows 10 after restoring the system from an image in a recovery partition, assigns it a letter

    Please note: With MBR disks attributes HIDDEN, READONLY and NODEFAULTDRIVELETTER are applied to the whole disk


    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.