[svlug] USB question
Brian J. Tarricone
bjt23 at cornell.edu
Tue Mar 29 13:38:38 PST 2005
I. Craig Nichols wrote:
>I'm having a hard time finding the answer to this, so I thought I'd try
>Does anyone know a way to ask a linux system which device node
>(/dev/sd*, /dev/USBtty*, etc.) is mapped to which USB device?
>I know the kernel must be keeping this information somewhere. How do I
>look at it?
If you're using a 2.6 kernel, you can poke around in /sys, though it
might take some work to figure things out. Also, often dmesg output (or
your syslog) will tell you, but the format of the information will
usually be different for different types of devices.
I think it would be helpful if you told us what you wanted to do. If
you simply want a way to know, for example, which device your iPod is
after you plug it in, you can write some custom udev rules (assuming
you're using udev, and not devfs or a static /dev) such that it will
always appear as /dev/ipod. Googling "custom udev rules" would probably
tell you what you need to know, in that case.
Otherwise, I don't think there's an easy (automated) way to figure this
info out. Also note that some USB devices (most digital cameras, for
example) don't create/use entries in /dev at all, but have nodes in
/proc/bus/usb (usually they're accessed via some app that uses libusb).
More information about the svlug