External hard drives through usb-c hub undetected

Here is what I did and the results:

Set of steps 1:

  1. Connect my external hard drives to the usb-c hub
  2. Connect my usb-c hub to the usb-c port of my laptop

Results:

  • Qubes OS 4.1: does not work
  • Qubes OS 4.0: works [1]
  • Arch Linux Live USB 2023-05-03: works
  • Arch Linux Live USB 2021-06-01: works

Set of steps 2:

  1. Connect my usb-c hub to the usb-c port of my laptop
  2. Connect my external hard drives to the usb-c hub

Results:

  • Qubes OS 4.1: does not work

Set of steps 3:

  1. Connect each of my external hard drive, one at a time, directly to the only usb port left on the laptop

Results:

  • Qubes OS 4.1: works

What should I so Qubes can detect my external hard drives through the hub?

[1]: works means: The hard drives show up in when I do lsblk, lsusb (in sys-usb for Qubes OS)

Check the logs in sys-usb.
Execute in sys-usb terminal:
journalctl -f
Then connect your hub+drive. Save the log output.
Connect your drive directly. Save the log output.
Compare the logs and see if there’re any errors/warnings or differences in USB drive init.

Here is what I did and the results:

Set of steps 1:

  1. Do sudo journalctl -f | tee hub_drive.txt
  2. Connect the hub+drive to the usb-c port

Result:
Here is the relevant part of hub_drive.txt:

...
May 10 19:06:37 sys-usb kernel: usb 2-7: new high-speed USB device number 8 using xhci_hcd
May 10 19:06:37 sys-usb kernel: usb 2-7: New USB device found, idVendor=05e3, idProduct=0610, bcdDevice=92.26
May 10 19:06:37 sys-usb kernel: usb 2-7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
May 10 19:06:37 sys-usb kernel: usb 2-7: Product: USB2.0 Hub
May 10 19:06:37 sys-usb kernel: usb 2-7: Manufacturer: GenesysLogic
May 10 19:06:37 sys-usb kernel: hub 2-7:1.0: USB hub found
May 10 19:06:37 sys-usb kernel: hub 2-7:1.0: 4 ports detected

Set of steps 2:

  1. Do sudo journalctl -f | tee drive.txt
  2. Connect the drive directly to the usb-c port

Result:
Here is the relevant part of drive.txt:

...
May 10 19:05:21 sys-usb kernel: usb 3-1: new SuperSpeed USB device number 3 using xhci_hcd
May 10 19:05:21 sys-usb kernel: usb 3-1: New USB device found, idVendor=0bc2, idProduct=3322, bcdDevice= 1.00
May 10 19:05:21 sys-usb kernel: usb 3-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
May 10 19:05:21 sys-usb kernel: usb 3-1: Product: Expansion Desk
May 10 19:05:21 sys-usb kernel: usb 3-1: Manufacturer: Seagate
May 10 19:05:21 sys-usb kernel: usb 3-1: SerialNumber: NA8E5LHZ
May 10 19:05:21 sys-usb kernel: scsi host2: uas
May 10 19:05:21 sys-usb kernel: scsi 2:0:0:0: Direct-Access     Seagate  Expansion Desk   9401 PQ: 0 ANSI: 6
May 10 19:05:21 sys-usb kernel: sd 2:0:0:0: Attached scsi generic sg0 type 0
May 10 19:05:21 sys-usb kernel: sd 2:0:0:0: [sda] Spinning up disk...
May 10 19:05:21 sys-usb mtp-probe[1528]: checking bus 3, device 3: "/sys/devices/pci0000:00/0000:00:06.0/usb3/3-1"
May 10 19:05:21 sys-usb mtp-probe[1528]: bus: 3, device: 3 was not an MTP device
May 10 19:05:21 sys-usb mtp-probe[1550]: checking bus 3, device 3: "/sys/devices/pci0000:00/0000:00:06.0/usb3/3-1"
May 10 19:05:21 sys-usb mtp-probe[1550]: bus: 3, device: 3 was not an MTP device
May 10 19:05:33 sys-usb kernel: ............ready
May 10 19:05:33 sys-usb kernel: sd 2:0:0:0: [sda] 7814037167 512-byte logical blocks: (4.00 TB/3.64 TiB)
May 10 19:05:33 sys-usb kernel: sd 2:0:0:0: [sda] Write Protect is off
May 10 19:05:33 sys-usb kernel: sd 2:0:0:0: [sda] Mode Sense: 4f 00 00 00
May 10 19:05:33 sys-usb kernel: sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
May 10 19:05:33 sys-usb kernel: sd 2:0:0:0: [sda] Optimal transfer size 33553920 bytes
May 10 19:05:33 sys-usb kernel:  sda: sda1
May 10 19:05:33 sys-usb kernel: sd 2:0:0:0: [sda] Attached SCSI disk

From the logs, my hub manufacturer is GenesysLogic. I searched genesys logic linux hub external hard drive and I have found a post[1] regarding a problem very similar to mine. In that post, the problem occurred on Arch Linux. They fixed it by adding usbcore.autosuspend=-1 to GRUB_CMDLINE_LINUX and update grub.cfg. I tried to do the same thing in Qubes, but I still cannot make it work.

Here is what I did and the result:

  1. Read usb-qubes doc and readapt the steps to my case
  2. Add usbcore.autosuspend=-1 to GRUB_CMDLINE_LINUX in dom0:/etc/default/grub
  3. Run in dom0: grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg since there is no grub.cfg in /boot/grub2
  4. Reboot
  5. Do cat /sys/module/usbcore/parameters/autosuspend in dom0

Result:
I get -1 as planned

  1. Do sudo qubesctl state.sls qvm.sys-usb
  2. Restart sys-usb
  3. Do cat /sys/module/usbcore/parameters/autosuspend in sys-usb

Result:
I get 2 instead of -1

  1. Do sudo journalctl -f
  2. Insert the hub+drive

Result:
It shows the same output above (hub_drive.txt)

  1. Manually add usbcore.autosuspend=-1 in grub.cfg in the template vm used by sys-usb
  2. Shutdown the template vm
  3. Restart sys-usb
  4. Do cat /sys/module/usbcore/parameters/autosuspend in sys-usb

Result:
I get 2 instead of -1

  1. Do sudo journalctl -f
  2. Insert the hub+drive

Result:
It shows the same output above (hub_drive.txt)

  1. Unplug the hub
  2. Do sudo sh -c 'echo "-1" > /sys/module/usbcore/parameters/autosuspend' in sys-usb
  3. Do cat /sys/module/usbcore/parameters/autosuspend in sys-usb

Result:
I get -1 as expected

  1. Do sudo journalctl -f
  2. Insert the hub+drive

Result:
It shows the same output above (hub_drive.txt). It didn’t work in the Arch Linux post[1] either.

  1. Clone sys-usb to sys-usb-clone-1
  2. Shutdown sys-usb
  3. Delete sys-usb
  4. Do sudo qubesctl state.sls qvm.sys-usb
  5. Start a fresh new sys-usb
  6. Do cat /sys/module/usbcore/parameters/autosuspend in sys-usb

Result:
I get 2 instead of -1

  1. Do sudo journalctl -f
  2. Insert the hub+drive

Result:
It shows the same output above (hub_drive.txt)

Questions:

  1. Am I on the right track with the solution on the Arch Linux Forum[1]?
    1.1. If yes, how do I set correctly usbcore.autosuspend=-1 in Qubes OS?
    1.2. If no, what should I do to make the Qubes OS detect the drive through th hub?

[1]: Arch Linux forum post: ([solved]My USB 3 hub doesn't see my USB 3 external hard drives anymore / Kernel & Hardware / Arch Linux Forums)

Do you have this problem only for your external hard drive or for any USB device connected to this hub?

You can add kernel options in kernelopts for sys-usb in Qube Settings or in dom0 terminal:
qvm-prefs <vm name> kernelopts "<kernel options>"

Using qvm-prefs do indeed set /sys/module/usbcore/parameters/autosuspend to -1 at boot. The drive is still undetected. sudo journalctl -f still shows the same message as in hub_drive.txt.

The hub works for my keyboard, mouse, microsd reader, usb stick. Any hard drive with spinning platter does not work, either 2.5in or 3.5in + external power. The journalctl -f output is still the same (hub_drive.txt).

I can suggest to test this with Fedora/Debian (what do you have for sys-usb template) Live USB and see if it’ll work there.
If it won’t work there then search for differences between Fedora/Debian and Arch.