Changing a hal /media mount point
Tuesday, November 18th, 2008Lets talk about HAL / Hald
NOTE: If you’re not comfortable editing system config files and using the command line I wouldn’t recommend playing with this yet
What I wanted to achieve: my memory stick reader to mount to a custom mount path.
I used:
- gnome-device-manager
- gnome-terminal
- vim

Edit your /etc/hal/fdi/policy/preferences.fdi and add inside the
<device>
<match key=”block.is_volume” bool=”true”>
<match key=”volume.fsusage” string=”filesystem”>
<match key=”info.parent” string=”/org/freedesktop/Hal/devices/storage_serial_Generic_USB_MS_Reader_058F312D81B1_0_3″>
<merge key=”volume.policy.desired_mount_point” type=”string”>memorystick</merge>
</match>
</match>
</match>
</device>
This is asking hal to match/find my target device via:
1) block.is_volume = true
2) volume.fsusage = filesystem
3) info.parent = /org/freedesktop/Hal/devices/storage_serial_Generic_USB_MS_Reader_058F312D81B1_0_3
In that order
All values can be taken from gnome-device-manager’s property window (see screenshot) having selected the device I wanted to create a policy for. key, Type and Value all map to key, type and value in the merge and match xml tags.
The info.parent property was the most unique item I could find for the memory stick reader so it shouldn’t get confused, having looked at it through gnome-device-manager making sure you’ve gone to View -> Show Properties
After you’ve added the device section to your configuration restart hal /etc/init.d/hal restart
You can create policies for all devices managed by hal, this means; usb disks, memory sticks, mp3 players, cameras, video devices and much much more.
So before you go diving into your fstab - give hal policies a go !
For more info/references:
http://en.opensuse.org/SDB:Mounting_to_Static_Mount_Points
http://people.redhat.com/davidz/hal-spec/hal-spec.html#fdi-policyÂÂ
I found it quite hard to get simple info about doing this so i’ve got no idea about good practice or even if there is a nice gui tool to edit the policies (other than gnome-volume-manager - which doesn’t do this kind of thing) please let me know ![]()
The RIRO Principle Explained.