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

John Stumbles sclug at yaph.org.uk
Tue Jun 24 14:17:18 UTC 2008


David Kerrawn wrote:
> /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.

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

You mean walk /sys/block/ to find which sdX/device symlink target 
matches the ID of the device I'm looking for (as in lsusb output)? I 
guess that's straightforward enough (more perl than bash for my skills). 
I just wondered if there was a simple way :-)

-- 
John Stumbles                                       http://yaph.org.uk
:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:



More information about the Sclug mailing list