Hello Rodolfo,
That works!

After reading some documentation, I have found that pluralisation of anything means that the search looks for matches further up the tree. The match does not have to be on the local node. So ATTR matches this node and ATTRS matches up the tree. Same for DEVICE and DEVICES.

Your description of the relationship between HAL and UDEV makes sense.

A small issue I have now is that when I remove and reinsert the TOSHIBA device, df reports the file system is mounted twice. It's still usable though.

When the device is removed, it does cause /dev/toshiba1 and /mnt/toshiba1to be removed, thus leaving /mnt/thoshiba1 high and dry.

It seems there needs to be a remove event triggered to perform the umount.

Thanks and regards,
Chris.

Rodolfo Martínez wrote:
Hi Chris,

As with almost any other software, developers will ask you to test the
latest version. I think HAL reads the gconf configuration correctly
since 5.14. Anyway, don't spend too much time with HAL; it is
deprecated.


udev is a device manager. It creates the files (device nodes) in the
/dev/ directory and doesn't care what you do with the device. For
example, it creates the /dev/sdb* devices and that's it. With udev you
can setup the permission for the *device node*, but you cannot specify
how to mount the device.

hal is intermediate/extra layer between the physical devices (/dev/*)
and the applications that allows the applications to use the hardware
without knowing anything about the physical device.


This is how I would achieve what you want to do:
1. Create a udev rule to rename the block device.
2. Specify the mount options in the /etc/fstab using the new device name.


1. The udev rule:
Create the file /etc/udev/rules.d/99-usb.rules with the following lines:
KERNEL=="sd?", BUS=="usb", ATTRS{serial}=="0220787042A168B4", NAME="toshiba"
KERNEL=="sd?1", BUS=="usb", ATTRS{serial}=="0220787042A168B4", NAME="toshiba1"


2. The mount options:
Add the following line to the /etc/fstab file
/dev/toshiba1  /mnt/toshiba1  vfat
defaults,user,noauto,uid=1000,gid=1004,noatime  0 0

and create the directory /mnt/thoshiba1

From now on, it doesn't matter who mounts the device, it will be
mounted under /mnt/toshiba1 with the desired options.

BTW, what/why is there a difference between SUBSYSTEM and SUBSYSTEMS?


SUBSYSTEMS is plural :P

Not sure, I have never used SUBSYSTEMS.
[rmt...@amartir01 ~]$ grep SUBSYSTEMS /etc/udev/rules.d/*
[rmt...@amartir01 ~]$

Rodolfo Martínez

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to