[ale] persistent mount points on removable devices

Joe Bayes jbayes at spoo.mminternet.com
Sat Feb 5 14:30:37 EST 2005


Jay Loden typeth:

>I would like to know if there is a way for me to 
>plug in my iPod, for example, and have it mount /mnt/iPod, or plug in my 
>external drive and have it mount '/mnt/maxtor' or what have you. 

As best I can tell (and someone please correct me if I'm wrong) FC3
uses a combination of udev and hal to do this. You can write a udev
rule to recognize any specific drive and give it its own unique
node. For example, I made a file named
/etc/udev/rules.d/10-stick.rules which contains the following:

BUS="usb", SYSFS{serial}="09A14A414303BB72", KERNEL="sd?1", NAME="stick"

So anything which appears on the USB bus with the above serial number
(it's my flash memory stick) and wants to be named /dev/sd?1 will
instead have the device /dev/stick.

(I found the serial number by doing a "udevinfo -q path -n /dev/sda1",
then "udevinfo -a -p <path returned by last command>")

When I plug in the drive, I believe it's hal that adds a line to my
fstab:

/dev/stick              /media/KINGSTON         vfat    pamconsole,exec,noauto,iocharset=utf8,noatime,sync,managed 0 0

So a user can just plug in the drive, "mount /media/KINGSTON", and it works.

My questions are:

(1) Am I correct in my understanding so far?
(2) Where do I tell hal that I want the drive to be mounted onto
    /mnt/stick, not /media/KINGSTON?

I hope the above is helpful.

Joe
--
Joe Bayes -- jbayes at spoo.mminternet.com



More information about the Ale mailing list