USB3.0 HDD issues

1- Local copy: HDD plugged to USB3.0 port on my PC
Remote copy: HDD plugged to USB3.0 port on my wrt3200acm and accessing it via samba share from my PC which is connected with lan cable to the router

2- You mean "usbutils"? "usb-utils is not available to install on openwrt repo, if you mean "usbutils", then I suppose you may want to see "lsusb" output:

Bus 003 Device 002: ID 0bc2:3322 Seagate RSS LLC SRD0NF2 [Expansion Desktop Drive]
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

3- The router has 2 ports, esata/usb (usb port 1) and usb3.0 (usb port 2, with traditional blue connector), I am plugging the HDD to usb port 2

4- No idea about uboot, what could I check? I am a bit lost with this point

1 Like

see if > fw_printenv
gives you output... should be good on that device.

but essentially, that question is a general one to possibly factor in and maybe some guru's here can say yay/nay whether it could play a role.

my ipq8065 oem sets usb3 off in the uboot var.... but i doubt owrt reads / honours that setting... etc.

did we get a> opkg list-installed | grep usb ( looking for xhci )

( possibly not relevant here: Proper USB3 controller recognition WRT1900AC(V2) )

For a proper speed bench;

sync; dd if=/dev/zero of=/mnt/external/speed.tmp bs=1M count=1024; sync
lsusb -t

As always triple check before enter with dd.... we all know what it stands for.....

Also.... The size of your disk :wink: ..... Not sure but the last few times I upgraded to the cutting edge it TB..... my PC had dramas let alone a router......

We need to confirm that it's all good regarding that too....

1 Like

Kernel logs don't seem to be helping us...

The only possible clue is the PC's have a line like:

scsi hostX: uas


usbcore: registered new interface driver uas

And the router doesn't, but it's hard to tell if that's a clue or if the kernel is just skipping that detail...

Edit: rather the router has:

scsi host6: usb-storage 2-7:1.0

It might be that the kernel is preferring or defaulting to one USB driver over another...

I'm curious how things would turn out if you made your own build and included all these kernel mods in rootfs...

On a different device that I am working with, here's where the UAS driver gets loaded (other hubs with ports are detected just before this)

[    4.375693] hub 4-0:1.0: USB hub found
[    4.383515] hub 4-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    4.390997] usbcore: registered new interface driver usb-storage
[    4.395305] usbcore: registered new interface driver uas
[    4.400461] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.415149] init: - preinit -
[    4.664900] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[    4.852896] usb-storage 1-1:1.0: USB Mass Storage device detected
[    4.853352] scsi host0: usb-storage 1-1:1.0
[    5.888762] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    5.888874] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    5.897762] qca8k c000000.switch lan1: configuring for phy/ link mode
[    5.899793] IPv6: ADDRCONF(NETDEV_UP): lan1: link is not ready
[    6.007179] scsi 0:0:0:0: Direct-Access              USB DISK 2.0     PMAP PQ: 0 ANSI: 4
[    6.824502] sd 0:0:0:0: [sda] 7579008 512-byte logical blocks: (3.88 GB/3.61 GiB)
[    6.827055] sd 0:0:0:0: [sda] Write Protect is off
[    6.831236] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[    6.833261] sd 0:0:0:0: [sda] No Caching mode page found
[    6.835812] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    6.872909]  sda: sda1
[    6.875082] sd 0:0:0:0: [sda] Attached SCSI removable disk

Just to make sure you are not barking up the wrong tree, I would mirror @anon50098793's suggestion: You should do a "proper" speed test on your disk, not going through samba and a network connection.

samba and other services will always be a bottleneck due to the CPU overhead on network connections. I have personally seen limitations like you describe (in the lower 20 MB/s), even on quite capable SoCs with a disk directly attached to SATA.

On the shell, cd to where you mounted your disk and do

# time dd if=/dev/zero of=tempfile bs=1M count=1024

This will write a 1 GB file to disk, divide 1024 by the resulting time in seconds and you got your MB/s for writing. After that you can test your read speed in a similar manner with

# time dd if=tempfile of=/dev/null bs=1M count=1024

(after that you can delete the tempfile file again). It might well very turn out that your USB connection is actually not the limiting factor.

fw_printenv gives indeed plenty of output, but no idea what should be helpful for us, what should I look for?

There it goes the opkg output:

root@OpenWrt:~# opkg list-installed | grep usb 
kmod-usb-core - 4.14.95-1
kmod-usb-storage - 4.14.95-1
kmod-usb-storage-uas - 4.14.95-1
kmod-usb3 - 4.14.95-1
libusb-1.0 - 1.0.22-1
usbutils - 007-9

lsusb output:

root@OpenWrt:~# lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M

Speed check will go on next reply...

1 Like

I am not very used to this, but if there is any guide to follow, I have no problem at all to give it a try!

You are totally right, it is an excellent approach, here are the measures:

root@OpenWrt:/mnt/sda4# time dd if=/dev/zero of=tempfile bs=1M count=1024
1024+0 records in
1024+0 records out
real    0m 26.26s
user    0m 0.00s
sys     0m 4.01s
root@OpenWrt:/mnt/sda4# time dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
real    0m 9.16s
user    0m 0.01s
sys     0m 1.15

So now it gets strange, because my calculator says 38.99MBps write speed and 111.79MBps read speed, why should be only the write speed lower?

1 Like

We should definitely be seeing something like

Class=Mass Storage, Driver=uas

instead of

Class=Mass Storage, Driver=usb-storage

I noticed that the process for installing other drivers includes an insmod command, for example:

opkg install kmod-usb3
insmod xhci-hcd

could opkg have missed that step? does it exist? maybe try...

insmod uas


insmod usb-uas

and reboot (or show us the fail output)

Also, if OpenWRT has this command, show us the output of all currently loaded kernel mods


and see if you can list all loadable kernel mods, using this answer:

If none of this has a lead, and if you're able, I recommend making your own build that includes all these drivers from the start

Or, did the build come with all these mods already? which ones did you install after flashing if at all?

Edit: Then again, how do we know if the board is UAS compatible lol

1 Like

It seems to be already added, here are the outputs:

root@OpenWrt:~# opkg install kmod-usb3
Package kmod-usb3 (4.14.95-1) installed in root is up to date.
root@OpenWrt:~# insmod xhci-hcd
Failed to find xhci-hcd. Maybe it is a built in module ?
root@OpenWrt:~# opkg install kmod-usb3
Package kmod-usb3 (4.14.95-1) installed in root is up to date.
root@OpenWrt:~# insmod xhci-hcd
Failed to find xhci-hcd. Maybe it is a built in module ?

With lsmod uas is listed:

uas                    16384  0

I remember to install kmod-usb-storage, kmod-usb-storage-uas and kmod-usb3 I am not sure but maybe also usbutils, it does not work anyway

It seems that kernel is not loading the uas module right?

I know you have kmod-usb3, that was an example :smiley:

If uas is listed in lsmod, that means its loaded already...

so the only other options are:

  • hardware is not supported
  • usb drivers are not identifying the device properly

unless someone can correct me...

at this point, I would open a bug report in the kernel catagory, with the IDs of your devices, or just link to this since its all here

1 Like

Ok, I was reading this:

And it seems that it archieves 100+ MBps speeds on write and read on ntfs drives, so there is hope of hardware support, let's see if bug report hits the issue.

Since the bug report is frozen, any other recomendations are welcome, no matter if it only fixes the speed for one case

Uh.....I don't know what you're capable of...

but if you want you can try to fix it yourself :smiley:

just throwing out an idea...

  • find a better working usb driver from another linux kernel source and turn it into a kmod using OpenWRTs toolchain?

I got some news! I tried to copy 3 files at the same time to see total capacity and guess what? Copying 3 files gives me 25MBps each, and copying 4 files gives me 18MBps each so it seems that total capacity may be around 75MBps more or less, so now I guess that the issue may be with samba, because it don't use full speed when you test copying one big file, 75MBps it a lot more reasonable speed considering that the disk is capable of 100MBps (perhaps there is a 25% of samba overhead)

Any ideas of what could be the cause of that issue? The test was made copying files from samba share to my PC

Well its very possible that samba is the only problem. Try to use a higher level tool to test the actual limits of the setup, using something like iperf3 between the router and another linux machine (I'm sure there are other options too).

Yup, with iperf I measure 1 gigabit speed with no problems in both sides, so the problem is samba for sure, but I am not being able to find which config is wrong

75 MB/s is 600 mbps, which isn’t shabby over wireless.

It is not wireless, my PC goes with LAN cable to the router and the HDD is plugged via USB, plus the main issue now is that I cannot get 75MB/s for a single big file transfer, several parallel transfers are needed to use that BW