[sclug] How to find which /dev/xxx a usb device is on? (No UUID required)

David Kerrawn sclug at kerrawn.co.uk
Tue Jun 24 10:48:01 UTC 2008


/sys/block contains a list of block devices.
/sys/block/$drive/device is a symlink to the "actual device"
In this symlink there is the USB device info eg: 4-4 which ties in with the
output from lsusb.
In the stuff below the "Transcend Information, Inc." Is my USB memory stick.

User:/sys/block/sdc$ ls -la
total 0
drwxr-xr-x  6 root root    0 2008-06-24 11:32 .
drwxr-xr-x 38 root root    0 2008-06-24 11:32 ..
-r--r--r--  1 root root 4096 2008-06-24 11:36 capability
-r--r--r--  1 root root 4096 2008-06-24 11:32 dev
lrwxrwxrwx  1 root root    0 2008-06-24 11:32 device ->
../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.0/host5/target5:0:0/5:0
:0:0
drwxr-xr-x  2 root root    0 2008-06-24 11:36 holders
drwxr-xr-x  3 root root    0 2008-06-24 11:36 queue
-r--r--r--  1 root root 4096 2008-06-24 11:32 range
-r--r--r--  1 root root 4096 2008-06-24 11:32 removable
drwxr-xr-x  3 root root    0 2008-06-24 11:32 sdc1
-r--r--r--  1 root root 4096 2008-06-24 11:36 size
drwxr-xr-x  2 root root    0 2008-06-24 11:36 slaves
-r--r--r--  1 root root 4096 2008-06-24 11:36 stat
lrwxrwxrwx  1 root root    0 2008-06-24 11:32 subsystem -> ../../block
--w-------  1 root root 4096 2008-06-24 11:36 uevent
User:/sys/block/sdc$ lsusb
Bus 004 Device 004: ID 1307:0163 Transcend Information, Inc.
Bus 004 Device 003: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640
USB-2.0 "TetraHub"
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 004: ID 413c:2500 Dell Computer Corp. DRAC4 Remote Access
Card
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000

You should be able to work out the rest from there.

Davek.




More information about the Sclug mailing list