question

ChetarRuby avatar image
1 Vote"
ChetarRuby asked Tripredacus commented

How to properly hide a Recovery partition?

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: https://kitfox.pkunk.net/images/screenshots/Screenshot%20from%202021-06-08%2014-36-09.png

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 https://www.tenforums.com/tutorials/106215-factory-recovery-create-custom-recovery-partition.html guide to create my recovery partition and boot menu.

windows-10-setup
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TeemoTang-MSFT avatar image
0 Votes"
TeemoTang-MSFT answered Tripredacus commented

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
diskpart
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

Source:
https://answers.microsoft.com/en-us/windows/forum/windows_10-files/remove-driver-letter-for-oem-partition/58ced1a5-9604-4ac2-a96b-c53f73c14f71


Similar case:
Windows 10 after restoring the system from an image in a recovery partition, assigns it a letter
https://superuser.com/questions/1455292/windows-10-after-restoring-the-system-from-an-image-in-a-recovery-partition-ass


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.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for this suggestion. But it doesn't work.

When I boot from install media, and use shift-F10 for a command prompt, then use DISKPART, doing the following commands:
SELECT VOLUME=D
REMOVE LETTER=D

Then I reboot the system from the hard drive. The boot menu comes up as expected. The Recovery partition boot works and starting setup works again as expected.

But when I try to boot the sealed image, it boot loops and the OS won't start, won't do OOBE or anything, just keeps boot looping. I get this screen:
https://kitfox.pkunk.net/images/screenshots/Screenshot%20from%202021-06-09%2009-58-50.png

I rebooted it like 4 times and it just keeps doing this.

Any help would be much appreciated.

0 Votes 0 ·

A bugcheck occurs before that screen is presented. You need to see what the bugcheck is in order to debug it.

0 Votes 0 ·
ChetarRuby avatar image
1 Vote"
ChetarRuby answered ChetarRuby edited

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.