SDB:Conventional Mounting Instead of subfs

From openSUSE


Version: 9.3

Concern

You do not like the automatic mounting of removable media like floppy disks, CDs, and DVDs as well as hotpluggable devices like USB sticks and hard disks, which is performed by default with submount/subfs and HAL since 9.3, or this functionality is unsuitable for you. Therefore, you would like to return to the conventional way of mounting media.

Procedure

As root, create a file with a file name of your liking and the ending .fdi in /usr/share/hal/fdi/95userpolicy/. Example:

noautomount.fdi

Edit the file with an editor of your choice:

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<!-- This .fdi file prevents automount for every media (storage devices)
     e.g. floppy, CD/DVD, USB-Stick, USB-Disk, external hard disk. -->
<deviceinfo version="0.2">
  <device>
     <match key="storage.policy.should_mount" bool="true">
       <merge key="storage.policy.should_mount" type="bool">false</merge>
     </match>
  </device>
</deviceinfo>

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

rchal restart

Finally, edit the file /etc/fstab for floppy, CD, and DVD drives. Change the respective lines (the following example demonstrates the procedure for a DVD drive and a floppy drive) from

/dev/dvd   /media/dvd     subfs   noauto,fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
/dev/fd0   /media/floppy  subfs   noauto,fs=floppyfss,procuid,nodev,nosuid,sync 0 0

to

/dev/dvd   /media/dvd     auto    noauto,ro,user,exec,iocharset=utf8    0 0
/dev/fd0   /media/floppy  auto    noauto,user,exec,sync                 0 0

In this case, submount/subfs will no longer generate the respective directories under /media when a new medium is detected by HAL. If the directories do not yet exist, they must be created manually, e.g. with the following command:

mkdir /media/cdrecorder

Subsequently, media can be mounted in the conventional way, e.g. with the following command:

mount /dev/cdrecorder /media/cdrecorder