0

This is not a duplicate of Is there any way to force Windows to map inserted USB drives using the first available drive letter?. I am not asking about assignment of USB drives to drive letters, but rather device mapping (e.g. \Device\Harrdisk1\Partition1).

I use two separate USB drives each day. For security reasons, they are removed and securely stored separately from the PC at the end of each day, and each morning I retrieve them and plug them in. Each of them contains a separate Veracrypt volume which is mounted when they're plugged in. Different files are written on each volume, which in some cases is automatic, so each must be mounted to a specific drive letter.

The (perhaps admittedly minor) issue that I encounter is that the device mapping of each USB drive randomly changes. Let's call the two physical drives Alpha and Beta. Some days, Alpha shows up in Veracrypt as \Device\Harrdisk1\Partition1, while other days it shows up as \Device\Harrdisk2\Partition1. The same of course applies to Beta. I don't know of any way to discern one from the other prior to mounting in Veracrypt, so sometimes Alpha ends up being mounted to Y: when it should be mounted to X:.

I can of course examine the contents of a given drive once mounted to see if I've mounted the correct drive to the correct drive letter, but it's a bit of a pain to do this each day, every day. And on occasion I do forget to check and it causes more problems.

What I'd like to know is if there is any way to "fix" the device mapping of each of USB drives so that it remains persistent over time, such that each time Alpha is plugged in, it will always be mapped to \Device\Harrdisk1\Partition1 (and of course the same with Beta).

Any suggestions would be most appreciated.

4
  • I don't think that MS did not had in mind that a partition "path" like \Device\Harrdisk1\Partition1 would ever be visible to the user (except may be in the disk management MMC). Therefore the paths is not persistent. BTW: When the USB device changes to \Device\Harrdisk2\Partition1 how many disks do you see in disks management MMC?
    – Robert
    Commented Apr 29, 2022 at 14:15
  • Thanks. I see three. Two are the USB drives and the third is the primary drive for the PC.
    – user415851
    Commented Apr 30, 2022 at 17:22
  • Robert - you are a genius. Thanks very much for the suggestion. This is exactly what I was looking for and does the trick. Should I perhaps copy and paste your comment above as the answer? Not sure what the right process is on superuser. LMK.
    – user415851
    Commented May 3, 2022 at 17:47
  • It most certainly does. Thanks again.
    – user415851
    Commented May 4, 2022 at 4:36

1 Answer 1

0

The path to a volume/partition like \Device\Harrdisk1\Partition1 is not the only way to address a partition. This is just the short version that simply allows to enumerate through all disks and volumes.

Internally Windows uses unique volume IDs that can also be used in a path like \\?\Volume{42ce6dbb-c976-4f28-8472-21a454c6093e8}. You should also be able to use this way to address a volume in VeraCrypt or other programs that allow to enter a path.

To get the correct path you can open a PowerShell terminal and exe cute the following command:

Get-WmiObject -namespace root\cimv2 -class win32_volume

Then scroll through the list of volumes and identify the correct volume. If the volume has no drive letter assigned it can be pretty hard to identify the correct volume, for identifying an encrypted volume you can try to filter for volumes that don't have a file-system property set:

Get-WmiObject -namespace root\cimv2 -class win32_volume -filter "FileSystem=NULL"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .