USB 3 ports

balanga

Daemon

Thanks: 86
Messages: 2,211

#1
I have a Thinkpad X220 which has a single USB 3.0 port but it doesn't seem to work any faster than the two USB 2 ports which it also has.

How can I tell whether it is faster than USB 2?
 

ronaldlees

Aspiring Daemon

Thanks: 266
Messages: 670

#2
You could use the dd utility to copy a largish file to a target storage device on each port, and look at the time taken to copy them. You'd need to have a storage device with better speed than USB2 in order to see the difference - an external SSD drive perhaps.
 

Minbari

Active Member

Thanks: 110
Messages: 237

#3
To verify if the usb 3.0 is recognised by OS run: pciconf -lv |grep xhci. xhci is the usb 3.0 driver.
To see if usb3.0 module is in the kernel: kldstat -v | grep -i xhci.

As for the transfer speed that depend on the usb flash drive type. So if the usb flash drive is usb 2.0 it will work as a usb 2.0 even if it's in the usb 3.0 port.
 
OP
OP
B

balanga

Daemon

Thanks: 86
Messages: 2,211

#4
If I have a USB 3.0 microsd card reader, what sort of microsd card should I use, and can I identify what sort of card I'm using? - not by what it says on the card but by what the os is able to tell me about the card.
 
OP
OP
B

balanga

Daemon

Thanks: 86
Messages: 2,211

#5
You could use the dd utility to copy a largish file to a target storage device on each port, and look at the time taken to copy them. You'd need to have a storage device with better speed than USB2 in order to see the difference - an external SSD drive perhaps.
i was thinking of copy a 1GB file from a ram disk.... except I don't know how to create a ram disk:(
 

leebrown66

Well-Known Member

Thanks: 101
Messages: 300

#6
Don't copy a file, copy from /dev/zero, ie, for a 1GB file:
Code:
dd if=/dev/zero of=/dev/da99 bs=1m count=1k
Replace da99 with your appropriately named device.
 
OP
OP
B

balanga

Daemon

Thanks: 86
Messages: 2,211

#7
Don't copy a file, copy from /dev/zero, ie, for a 1GB file:
Code:
dd if=/dev/zero of=/dev/da99 bs=1m count=1k
Replace da99 with your appropriately named device.
If I use da0 - the device I booted from, don't I overwrite the first 1GB of the device with zeroes?

I guess using da0p3, my swap partition, would be ok...
 

phoenix

Administrator
Staff member
Administrator
Moderator

Thanks: 1,137
Messages: 3,958

#8
Don't copy a file, copy from /dev/zero, ie, for a 1GB file:
Code:
dd if=/dev/zero of=/dev/da99 bs=1m count=1k
Replace da99 with your appropriately named device.
Don't use /dev/zero, use /dev/random; and don't do the dd directly to the target device. Use dd to create a file of a specific size and save it to disk. Then you can use that file multiple time in your tests.

For example:
Code:
# dd if=/dev/random of=/home/username/bigfile.1G bs=1M count=1024
time -h cp ~/bigfile.1G /some/mountpoint
time -h cp ~/bigfile.1G /some/other/mountpoint
time -h dd if=~/bigfile.1G of=/dev/whatever bs=1M
The reason you don't want to use /dev/zero is that some filessytems have optimisations in place to do special things with "zero-filled" files. And you don't want to use dd directly from a /dev/random to another device is that the random device will be slower than the disk device, so you will be "benchmarking" /dev/random instead of the target disk. The reason to use random is to prevent in-place compression or dedupe if those are enabled on the target disk/filesystem.
 

agm

New Member

Thanks: 2
Messages: 4

#9
transfer speed depends on the socket and the usb stick, if both provide USB 3.x then you get the higher speed (but the cable and the filesystem options can lower this also)

sudo camcontrol inquiry da0 -R will show you the max transfer rate;
pass2: 400.000MB/s transfers
or
pass2: 40.000MB/s transfers

sudo usbconfig show_ifdrv output must be filtered, but it is for example
ugen0.7: <Kingston DataTraveler 3.0> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (126mA)
or
ugen0.7: <Kingston DataTraveler 2.0> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)
 

CraigHB

Member

Thanks: 24
Messages: 90

#11
You have watch out for that. Memory devices advertise USB 3.0 conformance, but yet they use memory that can't take advantage of the higher speed, blatant gimmick.
 
Top