Unable to assign D: on Windows Server

I recently had a minor issue trying to assign a drive letter to a newly attached drive. Technically is was a Virtual Disk under XenServer but that’s mostly irrelevant.

The symptoms were that under “Disk Management” I could see the new drive, create a partition and correctly format it as NTFS. However when I tried to assign it a drive letter I could see all the letters of the Alphabet except C, Z and the letter I wanted D. The C and Z missing were expected as there was a System disk and a DVD drive assigned to the VM. A check of Device Manager confirmed that there was no additional disks or CD/DVD dives assigned to the server.

I dropped to dos and ran ‘net use‘ to check if there were somehow so network drives mapped that I didn’t know about (there wasn’t) and I also ran ‘subst‘ to make sure there was no drive substitution going on, subst indicated that there was no drive substitutions so I was stumped.

I dug into the registry and check HKLM\System\MountedDevices and saw like everywhere else only C and Z in use under DosDevices. I thought I’ll try and map a network drive and see what that yields, oddly enough D: did show as an available letter but when I tried to map to D: though it failed, and it could map correctly to another letter so permissions were fine.

About this time I remembered one of the other guys was talking about needing to create a subst drive for something he was testing, so I checked with him and sure enough he’d created a substituted drive the day before. Knowing this the fix was then simple. We logged onto his account and sure enough there was a subst drive, we removed it and bingo we could now assign the New disk the drive letter D:.

What was interesting  though is even as an administrator I couldn’t see this drive letter in use on another account, NET USE equivalent apparently also thought it wasn’t in use, but was kind of still in use, and most tellingly even under the HKLM (Local machine not HKCU) it didn’t show in MappedDrives.

I can also find no reference of this behaviour anywhere on Microsoft’s site or anywhere else on the web. It’s possible it’s a bug or was some other weird/unexpected behaviour but I don’t really feel like opening a Microsoft case to confirm it I just wanted my disk appearing in Windows