LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-05-2009, 09:45 AM   #1
prof
LQ Newbie
 
Registered: Feb 2009
Location: Italy
Distribution: Slackware 12.2
Posts: 23

Rep: Reputation: 15
HAL rules to automatically mount an external usb hdd?


Hi, I'm working on a backup unit and I'm having some troubles with HAL.
Altough everything works fine with HAL and permissions, only usb pen drives are automatically monted, storage units like an external usb hdd are ignored.

So far, that's what I've done.
First of all, I've set a fixed mount point, because there are some scripts making the backup which need to know the it. I've set /media/toshiba by creating an HAL rules file, called 20-toshiba.fdi, under /etc/hal/fdi/policy/. This is the file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
   <device>
       <match key="volume.uuid" string="3905-12E9">
               <merge key="volume.label" type="string">toshiba</merge>
               <merge key="storage.policy.should_mount" type="bool">true</merge>               
               <merge key="storage.automount_enabled_hint" type="bool">true</merge> <!-- if you want automount this should be true even if it may not be taken into account by the Desktop Environment -->
       </match>
   </device>
</deviceinfo>
This code works fine. But the hdd is not automatically mounted, the directory /media/toshiba is not automatically created. I use kde4 and the directory is only created when the plasmoid says a new device is connected and I do a mouse click.
With usb pen drives all works fine, directories under /media are automatically created.

Is there a rule to solve this problem? The hal reference manual on freedesktop.org has a broken link.

Thanks
Stefano
 
Old 11-05-2009, 11:40 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
My distro (kubuntu 8.04) doesn't seem to use hal any more. I have a feeling that hal is going to be deprecated soon.

On my PC, hal was started at boot, but is not now running.

My /etc/hal/fdi/policy/preferences.fdi just contains the single word false.

So I guess that's why it gave up.

All this stuff is now handled (very elegantly) by udev

May I suggest you take a look at udev ?

For help with udev rules (and a nice overview of what udev is for) please see http://www.reactivated.net/writing_udev_rules.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help, I unmounted external USB HDD, now will not mount thebrainman SUSE / openSUSE 3 12-14-2008 05:07 PM
Force External USB HDD to mount to certain folder predatorz Linux - Hardware 4 06-18-2008 11:26 AM
mount External HDD - USB ruwanindika Fedora 6 02-22-2008 08:10 AM
manual mount - external usb hdd (ubuntu) tripled2006 Linux - General 1 01-15-2007 10:08 AM
External USB HDD, mount problem, wierd behaviour. kniwor Slackware 5 08-18-2006 11:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration