[TriLUG] finding udev renamed flashkeys

Matt Pusateri mpusateri at wickedtrails.com
Sun Apr 12 11:57:00 EDT 2009


On Apr 12, 2009, at 11:11 AM, Joseph Mack NA3T wrote:

> udev is a bit of a mystery to me (like taxes).
>
> I need to know whether a flashkey is mounted and if so where.
>
> To see if there's one plugged in, I look in /proc/partitions. If so  
> I see /dev/sda*
>
> My udev rules will translate this to /dev/pny* (say)
> and my automount rules will mount it at /pny (say).
>
> I would like to be able to look somewhere to see what disks are on  
> the machine. Currently I'm looking in /proc/partitions (or /proc/ 
> diskstats) and find sda*. I need to be able to connect that to the  
> udev'ed name (/dev/pny*) which appears in the mount table. However  
> there's no connection (that I can find, eg in /sys) to connect /dev/ 
> sda* and /dev/pny* (except the device major and minor numbers).
>
> One solution that would work would be if the flashkey showed up in / 
> proc/partitions as /dev/pny*
>
> Any suggestions?
>
> thanks Joe
>

I would expect when you plugged it in, that you would see it show up  
in dmesg or in syslog.  lsusb should show you the device information  
that you could use to put it in udev rules show it shows up in the  
same place every time.


Matt P.



More information about the TriLUG mailing list