justastar
justastar

Reputation: 141

usb 2.0 and usb 3.0: how to determine the version of a usb port and match it to a usb drive

I need to match the version of a usb port to a usb drive.

For example, I want to ensure that a usb drive, whose version is 3.0 for example, is connected to a computer via a usb 3.0 port for example.

I have an idea but I do not know how to implement it.

so, when I connect a USB drive to a computer, I can get information about the drive using lsusb, but what command can I use to find out whether the USB drive is connected to USB port 2.0 or USB port 3.0?

Can anyone please help me with this problem?

shell programming

Upvotes: 2

Views: 11117

Answers (2)

Jason95
Jason95

Reputation: 1

There are also other simple ways to confirm usb2.0 or usb3.0 port:

  1. Check usb port logo of computer. usb2.0 & 3.0 have different logo.
  2. By downloading or uploading a fixed size file. After transaction completed, statistical information would be showed including data size, speed and time. usb2.0 and 3.0 have different speed limit.

For example:

C:\Users\jason95>adb root & adb remount

adbd is already running as root
remount succeeded

C:\Users\jason95>adb pull /data/test.img

/data/test.img: 1 file pulled, 0 skipped. 323.9 MB/s (1073741824 bytes in 3.161s)

Upvotes: 0

justastar
justastar

Reputation: 141

I was able to find the answer after several days. for those interested: first of all, you need to execute the lsusb command, from there you write down the bus number of the device, as well as the number of the device. then you run "lsusb -t", from this command you can determine if you device is connected to a usb 3.0 or a usb 2.0 port. in the output of this command, look for the host controller interface (hci) of the bus where your device is connected. if it is xhci (extensible) then the device is connected to a usb 3.0 port, and if it is ehci (enhanced) then the device is connected to a usb 2.0 port. Cheers!

Upvotes: 8

Related Questions