SDB:Mounting to Static Mount Points

Şuraya atla: kullan, ara


Version: 9.3, 10.0, 10.1

Concern

You do not like the automatic mounting of CDs, DVDs, or USB sticks to mount points corresponding to the label of the removable medium, which is performed by default with submount/subfs and HAL since 9.3, or this functionality is undesirable when using software like Wine, CrossOver Office, or Cedega. Therefore, you prefer to mount to a static directory (under /media) without sacrificing the advantages of automounting.


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 and 10.1 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

The following sections present further examples that need to be adapted to your circumstances. You can either configure all devices in one file or use a separate file for every device.

  • Mounting a CD-ROM drive and a CD/DVD writer:
<?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>
        <match key="block.device" string="/dev/hdb">
          <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">dvdrecorder</merge>
          </match>
        </match>
    </device>
</deviceinfo>
  • Mounting a USB stick to a static mount point (this does not work on 10.0 and 10.1):
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
  <device>
     <match key="storage.drive_type" string="disk">
        <match key="storage.bus" string="usb">
          <match key="info.vendor" string="VENDOR">
             <match key="info.product" string="PRODUCT_ID">
              <merge key="volume.policy.desired_mount_point" type="string">MyUSBStick</merge>
            </match>
          </match>
        </match>
     </match>
  </device>
</deviceinfo>

In this example, the following line also needs to be adapted. The required information can be obtained from the output of 'lshal' on the console or the 'hal-device-manager' in KDE/GNOME (install hal-gnome.rpm if necessary). <match key="info.vendor" string="VENDOR"> -> Replace 'VENDOR' with the vendor listed under info.vendor. <match key="info.product" string="PRODUCT"> -> Replace 'PRODUCT' with the product designation listed under info.product. <keyword>subfs,submount,mount,hal,mountpoint,cd,dvd,usb-storage</keyword>