How to remove "phantom" drive letters?
I recently attached two GPT-formatted USB hard drives to my Win10 workstation. I had to update the BCD store on them so I used Diskpart to assign letters S: and T: to the EFI partitions on the drives. Now I have two phantom drive letters S: and T: that are now permanently mapped to my PC even though I no longer have the hard drives in question attached.
I tried plugging the drives back in so I could remove the letter, but the EFI partitions on those drives did not get drive letters (which is the normal behavior). I tried using Diskpart again to assign them the same letters, but it tells me that those letters are already in use.
The drive letters do not correspond to anything in the Disk Management console, so I can't remove them from there. There's nothing in Device Manager that's holding them either. I opted to show hidden devices and removed every grayed out storage volume listed, but the drive letters remain.
These drive letters are "stuck" now and I can't get rid of them.
Any ideas?
The command to remove a drive letter - which shouldn't be needed, but hey, Win10, there are still some bugs - is mountvol <drive> /D
, so for you it would be mountvol S: /D
and mountvol T: /D
. You can also try mountvol /R
, which should remove all drive letter assignments for which there is no currently mounted drive. You can also try using /P
in place of /D
, but it's intended to be used while the volume is actually present.
You can also use the remove
command in diskpart
to remove drive letter assignments. You mentioned using mountvol to try re-assigning the drive letters but didn't mention trying to remove them. I'm pretty sure it just calls the same APIs as mountvol
, actually.
All of these commands will need to be run as Administrator, naturally.
This problem went away on its own after some Windows Updates forced a reboot of the computer.
This behavior appears to be a bug. I suspect that the reason the phantom drive letters persisted through a reboot was because of Windows 10's "Soft Restart" and "Fast Startup" features, which do not actually shut down or reboot anymore when you tell it to do a shutdown or reboot.
It was likely because the system never actually went through a full HW initialization (and thus never checked the presence of those drive letters) until Windows Updates forced the issue by doing a full reboot.
Brief Overview of the Soft Restart and Fast Startup Features:
In an effort to shorten startup times in Windows 8 and Windows 10, Windows no longer does a full shutdown/restart anymore. The Fast Startup feature (introduced in Windows 8) does a partial hibernation when shutting down the system. Certain core processes (but not all of them as in a full hibernate) have their states saved so that they can be resumed without going through a full initialization on the next startup. This behavior only affected shutdowns, not restarts, and you can turn it off via the Power control panel.
Windows 10 extends this behavior with the Soft Restart feature. When doing a restart, the system resets software as though it were doing a reboot, but does not reinitialize hardware or the kernel, making reboot times faster. You can't turn this feature off.
In Windows 10, the ONLY way to do a FULL reboot of the system is to issue a shutdown -r -f -t 0
from the command line.