5

One of my (several) USB drives are reporting this error in dmesg

usb 5-1: device descriptor read/8, error -110

How do I find out the /dev/sdX name of all my USB devices?

In reverse: How do I find out the USB number of a device, given it's /dev/sdX name?

UPDATE: Many excellent answers given here. I would expect this information to be in a standard tool like lsusb, though sadly it's not (yet). I'm choosing to award @sudodus, as his response best seems to answer getting the Name of All Drives.

ANSWER:

To generate more clear output, I suggest this somewhat longer command

find /sys/ -name dev -path '*usb*block*' | grep -v "sd../" | grep -Po "\/usb.*\/sd."
3
  • Assuming your system is running udev, does this simple trick (from superuser) ouput what you are looking for ? for devlink in /dev/disk/by-id/usb*; do readlink -f ${devlink}; done
    – MC68020
    Sep 11, 2022 at 7:12
  • 1
    Maybe the output of find /sys/ -name dev -path '*usb*block*' can help you.
    – sudodus
    Sep 11, 2022 at 11:35
  • @MC68020 It outputs all my USB devices as /dev/sdX, but it doesn't say which number they are. dmesg uses USB numbers to report errors.
    – Rucent88
    Sep 11, 2022 at 18:15

3 Answers 3

3

Find this device in sysfs

# cd /sys/bus/usb/devices/5-1

Find all block devices assigned to it

# find . -name dev -path '*block*'
./5-1:1/.../block/sdc/sdc2/dev
./5-1:1/.../block/sdc/dev
./5-1:1/.../block/sdc/sdc1/dev

2
  • I was not able to find /sys/bus/usb/devices/5-1, and did not find dev under any of /sys/bus/usb/devices/*. I have about 7 USB drives plugged into my system
    – Rucent88
    Sep 9, 2022 at 9:58
  • how is device detected in dmesg?
    – andreoss
    Sep 9, 2022 at 21:37
3

I am afraid whatever good answer to your question as worded in the title won't help you solve your precise problem since the error you report :

usb 5-1: device descriptor read/8, error -110

is the result of a fatal failure from the kernel to correctly identify the said usb device. Therefore the impossibility to attach whatever appropriate driver and consequently populate the /sys tree. Don't look for any /dev/sd* corresponding entry, there just cannot be any!

USB error -110 means "Timeout expired before the transfer completed". The number of possible causes for that is just... immense.
However, considering you write having 7 USB drives plugged into your system, not to mention possibly other usb devices such as keyboard, mouse, webcam... the most probable is that the host cannot provide enough power to the device.

In order to confirm, the best way to proceed is to unplug all your usb devices (not only the drives since, at the end of the day we get no information telling that the associated device is a drive) and plug them one after another while watching your dmesg.
Of course, unless you actually get one particuarily demanding device, you understand that the culprit will not be one device in particular but the cumul of them.

1
+100

I did some testing with USB mass storage devices (USB pendrives and USB connected SSDs) in my computer and think the output of

find /sys/ -name dev -path '*usb*block*'

can help you match the USB number of a device with its /dev/sdX name.


Another method is to match lsblk and lsusb command lines and to identify them via 'model/product' and 'serial' tags,

lsblk -do name,model,serial,hotplug|grep -e HOTPLUG$ -e 1$

sudo lsusb -v |grep -i -e '^BUS .* Device' -e product -e serial

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .