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

Alex Butcher lug at assursys.co.uk
Tue Jun 24 17:17:47 UTC 2008


On Tue, 24 Jun 2008, John Stumbles wrote:

> 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 :-)

That's what udev is for. :-)

Best Regards,
Alex.
-- 
Alex Butcher, Bristol UK.                           PGP/GnuPG ID:0x5010dbff

"[T]he whole point about the reason why I think it is important we go for
identity cards and an identity database today is that identity fraud and
abuse is a major, major problem. Now the civil liberties aspect of it, look
it is a view, I don't personally think it matters very much."
  - Tony Blair, 6 June 2006 <http://www.number-10.gov.uk/output/Page9566.asp>



More information about the Sclug mailing list