USB3.0 HDD issues

Yup, I read that before posting here but unfortunately installing kmod-usb-storage-uas did not solve the issue, I also tried the other recommendations of this post, but with no luck either

How about kmod-scsi-core?
(from looking at youre kernel log you might already have it...)

I saw the following snippets on OEM boot log from Wikidevi:

SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
...
...
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
...
...
ahci_mv f10a8000.sata: AHCI 1.0 32 slots 2 ports 6 Gbps 0x3 impl platform mode
ahci_mv f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
scsi0 : ahci_mv_platform
scsi1 : ahci_mv_platform
ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 58
ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 58
...
...

Have you tried with any other USB3 devices? and get full speed with anything else?

If that doesn't do it for you, you should post a bug report, one of these drivers might be outdated

1 Like

Well, I tested with another USB 3.0 HDD (WD My Passport - WDBMWV0020BRD-NESN) and result was the same (testing method was to plug the HDD and copy a 4GB ISO to it):

On PC: 100-110MBps
On WRT3200acm: 20-22MBps

In openwrt logs are different comparing with previous seagate tests, but they are quite similar to PC logs:

openwrt:

[ 1426.396390] usb 3-1: new SuperSpeed USB device number 3 using xhci-hcd
[ 1426.427313] usb-storage 3-1:1.0: USB Mass Storage device detected
[ 1426.433561] scsi host2: usb-storage 3-1:1.0
[ 1427.507009] scsi 2:0:0:0: Direct-Access     WD       My Passport 0741 1022 PQ: 0 ANSI: 6
[ 1427.515584] scsi 2:0:0:1: Enclosure         WD       SES Device       1022 PQ: 0 ANSI: 6
[ 1427.524905] sd 2:0:0:0: [sda] Spinning up disk...
[ 1428.547146] .
[ 1429.587530] .
[ 1430.627913] .
[ 1431.668297] .
[ 1432.708673] .
[ 1432.710414] ready
[ 1432.714047] sd 2:0:0:0: [sda] 3906963456 512-byte logical blocks: (2.00 TB/1.82 TiB)
[ 1432.722105] sd 2:0:0:0: [sda] Write Protect is off
[ 1432.726918] sd 2:0:0:0: [sda] Mode Sense: 47 00 10 08
[ 1432.727138] sd 2:0:0:0: [sda] No Caching mode page found
[ 1432.732483] sd 2:0:0:0: [sda] Assuming drive cache: write through
[ 1432.752256]  sda: sda1
[ 1432.755564] sd 2:0:0:0: [sda] Attached SCSI disk

PC (debian):

[  115.765532] usb 2-7: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[  115.786215] usb 2-7: New USB device found, idVendor=1058, idProduct=0741, bcdDevice=10.22
[  115.786221] usb 2-7: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[  115.786225] usb 2-7: Product: My Passport 0741
[  115.786229] usb 2-7: Manufacturer: Western Digital
[  115.786232] usb 2-7: SerialNumber: #test
[  115.803061] usb-storage 2-7:1.0: USB Mass Storage device detected
[  115.803197] scsi host6: usb-storage 2-7:1.0
[  115.803258] usbcore: registered new interface driver usb-storage
[  115.804656] usbcore: registered new interface driver uas
[  116.810083] scsi 6:0:0:0: Direct-Access     WD       My Passport 0741 1022 PQ: 0 ANSI: 6
[  116.810406] scsi 6:0:0:1: Enclosure         WD       SES Device       1022 PQ: 0 ANSI: 6
[  116.811598] sd 6:0:0:0: Attached scsi generic sg1 type 0
[  116.812069] scsi 6:0:0:1: Attached scsi generic sg2 type 13
[  116.812835] sd 6:0:0:0: [sdb] Spinning up disk...
[  117.833279] .
[  121.354247] scsi 6:0:0:1: Wrong diagnostic page; asked for 1 got 8
[  121.354257] scsi 6:0:0:1: Failed to get diagnostic page 0x1
[  121.354265] scsi 6:0:0:1: Failed to bind enclosure -19
[  121.354303] ses 6:0:0:1: Attached Enclosure device
[  121.360802] ready
[  121.360934] sd 6:0:0:0: [sdb] 3906963456 512-byte logical blocks: (2.00 TB/1.82 TiB)
[  121.361305] sd 6:0:0:0: [sdb] Write Protect is off
[  121.361306] sd 6:0:0:0: [sdb] Mode Sense: 47 00 10 08
[  121.361532] sd 6:0:0:0: [sdb] No Caching mode page found
[  121.361535] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[  121.370015]  sdb: sdb1
[  121.371505] sd 6:0:0:0: [sdb] Attached SCSI disk

P.D: As you said @mpratt14, kmod-scsi-core was already installed

P.D2: Here are logs of Seagate on debian PC, which also copies the test ISO at 100-110MBps

[  625.883828] usb 2-7: new SuperSpeed Gen 1 USB device number 4 using xhci_hcd
[  625.904653] usb 2-7: New USB device found, idVendor=0bc2, idProduct=3322, bcdDevice= 1.00
[  625.904659] usb 2-7: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[  625.904663] usb 2-7: Product: Expansion Desk
[  625.904667] usb 2-7: Manufacturer: Seagate
[  625.904670] usb 2-7: SerialNumber: #test
[  625.908792] scsi host6: uas
[  625.909510] scsi 6:0:0:0: Direct-Access     Seagate  Expansion Desk   9401 PQ: 0 ANSI: 6
[  625.910433] sd 6:0:0:0: Attached scsi generic sg1 type 0
[  625.910590] sd 6:0:0:0: [sdb] Spinning up disk...
[  626.915772] .............ready
[  639.204575] sd 6:0:0:0: [sdb] 15628053167 512-byte logical blocks: (8.00 TB/7.28 TiB)
[  639.236115] sd 6:0:0:0: [sdb] Write Protect is off
[  639.236121] sd 6:0:0:0: [sdb] Mode Sense: 4f 00 00 00
[  639.236343] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  639.325161]  sdb: sdb1 sdb2 sdb3 sdb4
[  639.326958] sd 6:0:0:0: [sdb] Attached SCSI disk

-Was that a "local" copy or a "remote" copy?
-What does usb-utils tell you?
-What is the story with the esata <> usb in the device page? ( rhetorical... just found the picture... doubt it's a prob )
-Have you verified uboot / boot params are not interfering?

1 Like

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:

lsusb
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

or

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

or

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

lsmod

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: https://www.smallnetbuilder.com/wireless/wireless-reviews/33030-linksys-wrt3200acm-ac3200-mu-mimo-gigabit-wi-fi-router-reviewed?showall=&start=1

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.

https://bugs.openwrt.org/index.php?do=details&task_id=2208

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