Unique names for UMS devices in /media/

Derek Broughton news at pointerstop.ca
Thu Feb 15 18:38:28 UTC 2007


John Dangler wrote:

> On Thu, 2007-02-15 at 12:12 +1300, Tom Eastman wrote:
>> Hey guys,
>> 
>> I have several different USB Mass Storage devices (cameras, MP3 players,
>> memory sticks and removable hard drives).  All of them are correctly
>> mounted in /media/ as 'usbdisk' or something similar.
>> 
>> What I would like, though, is for each one to have its own directory
>> name.  For example, my mp3 player to come up as '/media/iriver' and my
>> camera to come up as /media/fujifilm' or something like that.
>> 
>> I know this can be done on some level, but I'm not sure how deep I have
>> to go.  Whether it's something to do with HAL, or udev, or somewhere
>> else.
>> 
>> What do I need to do to get this working?
> If I'm not mistaken, it may be as simple as creating the mount point
> with the name you want, and then use mkdev (or some other dev utility)
> to setup the name and associate with the mount point.

You'd be very mistaken, I'm afraid - mkdev isn't much use (directly) these
days, as udev creates and deletes these devices as they're hotplugged.

udev rules (/etc/udev/rules.d/*.rules) allow you to specify all sorts of
identifying information that can be used to name a /dev symlink.  However,
on my KDE desktop, istr that just renaming the device in the "properties"
dialog for the icon would persist.
-- 
derek





More information about the ubuntu-users mailing list