USB Port Management

Jarret B

Active Member
Staff member
With the abundance of Universal Serial Bus (USB) devices it is difficult to come across a system which is not using some type of USB device. Systems have numerous USB ports and there can arise some complications when connecting too many devices. To help with such difficulties it is best to understand the abilities of the USB ports on a system. Another issue is that some systems when booting from a USB device you may not know which device is the primary one. Using the following method you can determine which port is the primary, secondary and so on.

LSUSB

The basic command ‘lsusb’ will provide information about the existing root hubs and devices attached to the hubs. From the information given from ‘lsusb’ we can learn information about the system as well as the USB devices.

Open a Terminal from the keyboard shortcut (CTRL+ALT+T) or from the system menu. To get initial information about the USB Root Hubs on the current system we will use the command: ‘lsusb -s <bus>:<device>’. We will not specify a Bus, but we will specify a specific device with the command ‘lsusb -s :1’ in the Terminal:

Figure 01.jpg

FIGURE 1


Make a note of the listed USB Root Hubs. The Root Hubs are noted as being ‘Linux Foundation 1.x’, Linux Foundation 2.x’ or Linux Foundation 3.x’. The number shows the USB Standard for the Hub, such as USB 1.0, USB 2.0 or USB 3.0. Each standard has different capabilities. Root Hubs and not devices show the USB Standard by which it operates, but we can can determine the Standard for each device. The speeds of each bus are determined by the USB standard as follows:

  • Linux Foundation 1.x – 12 Mbps
  • Linux Foundation 2.x – 480 Mbps
  • Linux Foundation 3.x – 5000 Mbps

For each device note its Bus and Device number. We have only listed the Root Hubs which are always Device 1 on each Bus. You can see that Bus 1 is the USB 2.0 standard. I can find out more information on that specific Bus. As we did in Step 1 we will get a list of all devices on Bus 1. Instead of specifying the device number we will only specify a Bus number with the command: ‘lsusb -s 1:’. My results are shown in Figure 2.

Figure 02.jpg

FIGURE 2


The results are every Device on Bus 1. You can see from Figures 1 and 2 that Bus 1 supports the USB 2.0 standard.
Here is the interesting thing that most people do not understand about USB. Each port connects to the appropriate Bus assignment when a device is inserted after the device is queried. If a device is a USB 1.0 device then it will almost always connect to a Bus which is 1.0 ( I will discuss this later). In my case, a USB 2.0 device or above will always connect to Bus 1 no matter the port I insert the device in.
To see all the devices connected to my system I can simply run the command ‘lsusb’ with no parameters as shown in Figure 3. (This was run after I reconnected all of my USB devices.)

Figure 03.jpg

FIGURE 3

You can get a better view by listing the output as a Tree. Tree view can be done with the command ‘lsusb -t’ as shown in Figure 4.

Figure 04.jpg

FIGURE 4


Between Figure 3 and 4 you can see that the Logitech keyboard and mouse dongle is being assigned to Bus 2. It is assigned to Bus 2 since it does not require the speed of USB 2.0 or above. Mass Storage devices are placed on Bus 1 to allow a higher transfer rate.
Now I will throw in a little something kind of strange. Looking at Figure 3 you can see that my Sandisk Cruzer Blade is on Bus 1 and Device 8. The Device is unplugged and reinserted into the same port and the command is executed again as shown in Figure 5.

Figure 05.jpg

FIGURE 5


Since the device was removed and plugged back in the Device number is incremented. Even if the same device is inserted back into the same port the Device number cannot be immediately reused. Each device added to the Bus will have a Device number incremented by one and will continue to the Device number 127. Once the Device number hits 127 it will start back over at the lowest number available for the Bus.

Specific Device Information

To find more information about a device on Bus 3 Device 2 you could execute the command:

Code:
lsusb -D /dev/bus/usb/003/002
I ran this command on a second system and received the output as shown in Figure 6. Looking at the output you can see that the device is a mouse. In this case, a wireless mouse.

Figure 06.jpg

FIGURE 6


Each device also shows the maximum power usage for the device listed under ‘MaxPower’. The USB Standard for the device is listed under ‘bcdUSB’. If a device with a higher USB standard is placed into a Hub with a lower USB Standard then the ‘bcdUSB’ value may not be reported correctly. If some devices on a specific Bus are not acting as intended then you may check the power consumption to make sure the devices are not overtaxing the total power output.
Since power issues can arise if too many devices are on one Bus you may need to add an additional USB Hub. A powered USB Hub can be purchased which gets its power from a wall port and not from the USB Port it is plugged into on the system. The powered USB Port can solve nearly all power issued on a USB chain.

Vendor and Product ID

For the output from an ‘lsusb’ command you see the section after ‘ID’. The first set of numbers is the ID of the Vendor which made the product. The second set determines the actual device. These numbers can be checked on the Internet by searching for them on a search engine. Some ID’s may not be found since it seems the databases are not updated immediately. Each Vendor applies for an ID and pays around $5,000-$6,000 for a Vendor number.
Some people buy USB Devices which have no name on them and you may need a driver. The only way to track down the needed driver is to find the Vendor and Product name to find a driver which works.

Port Order

Let’s assume you have a system with multiple USB ports and you need to know how the devices are ordered. On my system I can select to perform a USB boot from a bootable device. I am not given a list of all of the USB devices to choose which to use as the boot device. My system will boot from the first device. I had to determine the Port order to understand how the devices were chosen. If I have a device in the first port which is not bootable it will not attempt to boot from the second device. If I insert a bootable USB device in a Port the system may boot from another USB device.
My Ports are shown in Figure 7.

Figure 7.jpg

FIGURE 7


To determine which Port is which I had to place a mass storage device or something that would be on Bus 1 in every Port. Each device had to be unique enough to let me determine which device is which. I had to fill all seven Ports at once. After I completely filled them I had to reboot my machine and make sure that my my hard drive was booted. After Ubuntu started I used the ‘lsusb’ command to see what the order showed. Every device was on Bus 1 and the ordering is shown in Figure 8.

Figure 8.jpg

FIGURE 8


Now the first three Ports are in the back of the system all located in a row. The next two Ports are on the front of the system. The last two Ports are on the back again.
If Port A has no device but Port B has an inserted device, then the device in Port B will be used to boot the system if I choose to boot from a USB device in the BIOS.
If you have a system which does not list each USB device then this method is how you can determine the Port boot order for your system.
To be very sure you may want to boot the system at least twice to verify that the order is the same each time.
I hope this article gives you some insight on how USB Ports are used and ordered. Please leave any comments that you may have about USB Ports.
 

Members online

No members online now.

Latest posts

Top