Letters by USB Port

USBDLM

 

Drive Letters by USB Port


 

Since V4.4 this can be used without hassle. No more delays. UsbDriveInfo shows now the USB port name determined by the old and by the new algorithm. Both should be identically. The only exception is that 1 port hubs (some active extension cables or embedded hubs and a very few flash drives) are no more ignored.

 

It's a bit hard to configure...

 

[DriveLetters]

PortName=3-2

Letters=U,R

 

;for multiple ports as the ports of an hub connected to 5-1

[DriveLetters]

PortName=5-1-1

PortName=5-1-2

PortName=5-1-3

PortName=5-1-4

Letters=X

 

Or short using Wildcards:

 

;for multiple ports as the ports of an hub connected to 5-1

[DriveLetters]

PortName=5-1-?

Letters=X

 

First the physical USB ports have to be identified for the configuration. You get the port names by attaching a drive to each port to configure. Then run the UsbDriveInfo tool. UsbDriveInfo will show something like this for each USB drive:

 

MountPoint        = Z:\

Volume Label      = King16Back

Volume Size       = 15.6 GB  /  14.5 GiB  /  15.619.129.344 Bytes

Volume Serial     = A460-5DC1

FileSystem BS     = NTFS

Volume Name       = \\?\Volume{09247b47-82df-11e4-b297-001d729ad2b2}\

KernelName        = \Device\HarddiskVolume21

Partition Device  = \\.\Harddisk1Partition1

DeviceID          = STORAGE\VOLUME\_??_USBSTOR#DISK&VEN_KINGSTON&PROD_DATATRAVELER_111&REV_PMAP#...

DeviceID Drive    = USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_111&REV_PMAP\001CC0C60DBDBCC0C000010B&0

DeviceID USB      = USB\VID_0951&PID_1693\001CC0C60DBDBCC0C000010B

Device ID HostCtl = PCI\VEN_8086&DEV_283A&SUBSYS_20AB17AA&REV_03\3&21436425&0&D7

USB Friendly Name = Kingston DataTraveler 111

USB Port Name     = 3-2

INI Sections      = [DriveLetters]:33

 

 

For this drive 3-2 is the setting for "PortName" we need. If there is a USB hub in between then a typical port name is 3-2-1, with two hubs 3-2-1-1 and so on. USB hubs with 7 ports can be in fact two cascaded 4 port hubs, so 4 of the 7 ports get an additional step in the USB tree.

USB3 controllers usually have separate logical ports for USB 1+2 and 3 devices, so the port number differs when a USB2 or a USB3 devices is attached to the same physical port, see here: http://www.uwe-sieber.de/usbtreeview_e.html#USB3

But this is true for ports of root hubs only. Ports of normal USB hubs have one incarnation only.

 

Sample to have a fixed letter for a USB3 port, no matter if a USB2 or 3 device is attached:

 

[DriveLetters]

PortName=3-2

PortName=3-5

Letters=X

 

 

If there are multiple Windows installations on a computer then the USB Port names will be equal only for identical Windows Versions.

 

Of course, if you change your USB hub assignments, you'll have to do all this over, too.

 

Furthermore the numbers of the Root Hubs are not constant when Host Controllers are removed or added. The numbering Windows does is not predictable.

 

If you have a removable USB Controller and the internal root hubs change their number when it is removed or added then an alternative notation can be used. Instead of the Root Hub's number use its host controller's device ID which is a constant.

In the sample above it is PCI\VEN_8086&DEV_283A&SUBSYS_20AB17AA&REV_03\3&21436425&0&D7

 

The resulting "long" port name whould be here PCI\VEN_8086&DEV_283A&SUBSYS_20AB17AA&REV_03\3&21436425&0&D7-2.

If each type of host controller is present only once then the ID can be shortened using wildcards. Then it would work across multiple Windows installations on the same computer:

 

[DriveLetters]

PortName=PCI\VEN_8086&DEV_283A&*-2

Letters=X

 

 

Non-USB drives

 

Since V4.7 this is no more limited to USB drives. If a drive has a "location" string like "Channel 1, Target 0, Lun 0" then USBDLM generates a short version of it by picking the numbers and putting them in a short string like 1-0-0

Alternatively you can use the "location" string as shown by UsbDriveInfo, also using wildcards.

Such a location string is usually found for ATAPI, SCSI and SATA drives.

 

Remember that you have to configure a BusType line too because we deal with non USB drives here!

 

Sample for an ATAPI CD/DVD drive on letter X:

 

[DriveLetters]

DriveType=CDROM

BusType=ATAPI

PortName=Bus Number 0, Target ID 1, LUN 0

Letters=X

 

Or with the short notation for the port:

 

[DriveLetters]

DriveType=CDROM

BusType=ATAPI

PortName=0-1-0

Letters=X