Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB storage not accessible #70

Closed
akuropka opened this issue Nov 7, 2021 · 9 comments · Fixed by #72
Closed

USB storage not accessible #70

akuropka opened this issue Nov 7, 2021 · 9 comments · Fixed by #72
Labels
hardware Incompatible device or hub

Comments

@akuropka
Copy link

akuropka commented Nov 7, 2021

System:
Ubuntu 20.04.3 LTS (Ubuntu package from MS store)
5.10.60.1-microsoft-standard-WSL2+
linux-tools-5.4.0-77-generic.

I am trying to atach a usb flash drive with usbipd wsl attach --busid 1-4 which works without error.
I can see the device with lsusb:

Bus 002 Device 007: ID 0781:5588 SanDisk Corp. USB Extreme Pro

However, it is not visible with lsblk, sda-sdc are the virtual wsl disks:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 256G 0 disk
sdb 8:16 0 344.9M 1 disk
sdc 8:32 0 256G 0 disk /

In dmesg I can see that it is recognized but further data cannot be obtained:

[ 21.411126] scsi 1:0:0:0: Direct-Access SanDisk Extreme Pro 0 PQ: 0 ANSI: 6
[ 21.417819] sd 1:0:0:0: Attached scsi generic sg3 type 0
[ 22.717096] sd 1:0:0:0: [sdd] 250085376 512-byte logical blocks: (128 GB/119 GiB)
[ 58.314707] sd 1:0:0:0: [sdd] Write Protect is off
[ 58.320474] sd 1:0:0:0: [sdd] Mode Sense: 43 00 00 00
[ 58.404468] sd 1:0:0:0: [sdd] Asking for cache data failed
[ 58.407954] sd 1:0:0:0: [sdd] Assuming drive cache: write through
[ 58.411175] sd 1:0:0:0: [sdd] Read Capacity(10) failed: Result: hostbyte=0x07 driverbyte=0x00
[ 58.415419] sd 1:0:0:0: [sdd] Sense not available.
[ 58.417811] sd 1:0:0:0: [sdd] 0 512-byte logical blocks: (0 B/0 B)
[ 58.420867] sd 1:0:0:0: [sdd] Attached SCSI removable disk

The first three lines indicate everything works normal but after that nothing happens for a long time while errors come up later.

[ 54.092721] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 55.473518] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 56.853262] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 58.243539] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 58.385384] usb 2-1: USB disconnect, device number 2
[ 59.894291] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 61.284380] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 61.321844] usb usb2-port1: attempt power cycle
[ 62.774217] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 64.164460] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 64.202258] usb usb2-port1: unable to enumerate USB device

I tried with two different flash drives but the result is the same.
There's no cable involved as well as no external power supply possible, both by design.

Attached is the full dmesg log with USBIP dump messages:
dmesg.txt

Maybe someone has an idea? Thank you very much!

@dorssel
Copy link
Owner

dorssel commented Nov 7, 2021

Thx for the report and the dump.

After device recognition (which ends at timestamp 23.506548), thing fail (or rather: stall). This is right after a SEND request, probably to access actual disk content for the first time. After that it is just repeated port resets.

What I notice is: super_speed. That means either USB 3.0 or 3.1. I must admit, I only tested that with my single USB 3 device I have available (a Kingston USB flash drive). So it could very well be that not all of the USB 3 standard is covered. What does not help either is that the USB 2.0 standard is available online, but the USB 3 standard is not...

If you want your device working ASAP, you could try plugging it in a USB 2.0 port, or add a USB 2.0 hub between your USB 3 port and the device.

To debug the USB 3.0 side of things: I am interested in a TRACE log of usbipd-win, as explained in https://github.com/dorssel/usbipd-win/wiki/Troubleshooting.

@dorssel dorssel added the hardware Incompatible device or hub label Nov 7, 2021
@akuropka
Copy link
Author

akuropka commented Nov 7, 2021

I tested the USB 2 port as well but the result is the same. I will do some further testing with other devices...

Attached the trace log for reference.
usbipd_trace.txt

@dorssel
Copy link
Owner

dorssel commented Nov 7, 2021

Thx.

USBSUP_XFER_UNDERRUN -> EREMOTEIO -> 0

That's the error. I will look into it to find out when/why/how such an error can occur.

@akuropka
Copy link
Author

akuropka commented Nov 7, 2021

Thank you very much... I appreciate your support!

@dorssel dorssel mentioned this issue Nov 7, 2021
@dorssel
Copy link
Owner

dorssel commented Nov 7, 2021

Hi, I fixed a bug that may just solve your issue. Would you be willing to try the MSI from this PR: https://github.com/dorssel/usbipd-win/actions/runs/1432468492?

You would have to uninstall usbipd-win, and then install this MSI. It is not signed yet (but the drivers are).

@akuropka
Copy link
Author

akuropka commented Nov 8, 2021

Hi @dorssel,
the fix works like a charm. 👍
Everything perfect... great perfomance and runs stable from what I can judge for the moment.

One sidenote for your wsl-wiki since you suggest enabling some features in the kernel and this here is about storage:
By default CONFIG_USB_STORAGE is not set which will result in USB storage devices won't be accessible in Linux.
The same applies for CONFIG_EXFAT_FS and CONFIG_NTFS_FS which may be useful if someone wants to access exFAT or NTFS drives.

Have a good day! 👋

@dorssel
Copy link
Owner

dorssel commented Nov 8, 2021

Forwarding the suggestion to the WSL team: @benmcmorran.

Please note that you now have a non-release version running that reports itself as 1.1.2.
Don't forget to do another uninstall/install cycle once the official release comes out...

@akuropka
Copy link
Author

akuropka commented Nov 8, 2021

Btw upgrade did work without uninstall as well... just fyi (forgot to uninstall first on the second device).

@dorssel
Copy link
Owner

dorssel commented Nov 8, 2021

Yeah, I always forget that a PR build is already on the next version. When you go to release 1.1.2, you will have to uninstall or else the installer thinks you are trying to go from 1.1.2 to 1.1.2 (which won't work).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hardware Incompatible device or hub
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants