LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   Static mount points in opensuse 10.2 (http://www.linuxquestions.org/questions/suse-novell-60/static-mount-points-in-opensuse-10-2-a-516816/)

sgmeunier 01-06-2007 02:01 AM

Static mount points in opensuse 10.2
 
I want to configure hal to mount to a static mount point. I've tried doing it the way that it is done in 10.1 (via a file mountpoints.fdi in /usr/share/hal/fdi/policy/95userpolicy/) but that doesn't seem to work. All my searches have come up empty this far. If anyone knows how to do this, an answer would be greatly appreciated since dynamic mount points really irritate me.

sgmeunier 01-15-2007 04:12 PM

I decided to delete the file I created (mountpoints.fdi) and try it again. This time it worked like it was supposed to. There might have been a typo in the original file to prevent it from working, although I didn't pick up on one. At least it works now...

TomalakBORG 01-15-2007 07:12 PM

sgmeunier - what did you do exactly? I am curious as to how I can get /dev/sda1 to automount to /media/filevault every single time - it's an external hard drive that never leaves this machine.

What about autofs? I was looking at /etc/auto.master and auto.misc but couldn't get anything to work. Thanks in advance!

Bill

pajoe 01-30-2007 05:52 AM

could you post a copy of the file you created?
 
Quote:

Originally Posted by sgmeunier
I want to configure hal to mount to a static mount point. I've tried doing it the way that it is done in 10.1 (via a file mountpoints.fdi in /usr/share/hal/fdi/policy/95userpolicy/) but that doesn't seem to work. All my searches have come up empty this far. If anyone knows how to do this, an answer would be greatly appreciated since dynamic mount points really irritate me.


Could you post your copy, I am having trouble as well and I suspect it is where I enter the mount in the merge key


/usr/share/hal/fdi/policy/95userpolicy/mountpoints.fdi

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<!-- optical drives -->
<match key="block.device" string="/dev/hdc">
<match key="volume.is_disc" bool="true">
<merge key="volume.policy.should_mount" type="bool">true</media/cdrom>
<merge key="volume.policy.desired_mount_point" type="string">cdrom</media/cdrom>
</match>
</match>
</device>
</deviceinfo>


*********************

Procedure

As root, create a file with a file name of your liking and the ending .fdi in in /usr/share/hal/fdi/95userpolicy/. (For 10.0 this is /usr/share/hal/fdi/policy/95userpolicy/.) Example:

mountpoints.fdi

Edit the file with an editor of your choice, e.g. for a CD-ROM drive:

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<!-- optical drives -->
<match key="block.device" string="/dev/hdc">
<match key="volume.is_disc" bool="true">
<merge key="volume.policy.should_mount" type="bool">true</merge>
<merge key="volume.policy.desired_mount_point" type="string">cdrom</merge>
</match>
</match>
</device>
</deviceinfo>

Adapt the following lines to your system values:

<match key="block.device" string="/dev/hdc">

-> Replace /dev/hdc with the address of your CD-ROM drive.

<merge key="volume.policy.desired_mount_point" type="string">cdrom</merge>

-> Enter the mount point you desire.

After customizing the file, execute the following command as root:

rchal restart




Thanks in advance


joe

inigo 02-13-2007 06:56 PM

Problem solved for 10.2
 
Hi everybody,

I think I found the problem, or rather the two problems:
  1. As mentioned elsewhere, the mountpoint you are going to use should not exist: Make sure there is no directory with that name. In my example below, it's /media/dvd.
  2. The fdi file mentioned before had an SGML comment in the first line. While this worked for SuSE <=10.1, this causes
    problems in 10.2, making HAL quietly ignore automounts altogether...
Here is my version of the fdi file (to mount DVDs to the static mount point /media/dvd - adjust for your own use), save it as /usr/share/hal/fdi/*/95-userpolicy.fdi (where * can be either 10osvendor, or maybe more appropriately 20thirdparty):
Code:

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
    <device>
        <!-- optical drives -->
        <match key="block.device" string="/dev/sr0">
          <match key="volume.is_disc" bool="true">
            <merge key="volume.policy.should_mount" type="bool">true</merge>
            <merge key="volume.policy.desired_mount_point" type="string">dvd</merge>
          </match>
        </match>
    </device>
</deviceinfo>

After restarting HAL with 'rchal restart', it should work!

Cheers! :cool:

pajoe 02-14-2007 05:08 AM

nice work inigo, thanks


All times are GMT -5. The time now is 11:07 PM.