The Thursday 2005-05-12 at 20:01 -0500, JB wrote:
I can expand on the above a bit, I have just disabled automounting of the cdrom and floppy on my PC - just ask, I'm about to close for the day.
The little local documentation there is is in "/usr/share/doc/packages/hal/". Specs, not user doc. Follow the advice in the SDB article (as mentioned yesterday) "http://portal.suse.com/sdb/en/2005/05/dkukawka_subfs_nomount.html". Create the file (as root) '/usr/share/hal/fdi/95userpolicy/noautomount.fdi. Mine contains (warning: your MUA might wrap long lines): <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> <!-- This .fdi file prevent automount for every media (storage devices) e.g. floppy, CD/DVD, USB-Stick, USB-Disk, external harddisk. --> <deviceinfo version="0.2"> <device> <match key="block.device" string="/dev/hdc"> <match key="storage.policy.should_mount" bool="true"> <merge key="storage.policy.should_mount" type="bool">false</merge> </match> </match> <match key="block.device" string="/dev/hdd"> <match key="storage.policy.should_mount" bool="true"> <merge key="storage.policy.should_mount" type="bool">false</merge> </match> </match> <match key="block.device" string="/dev/fd0"> <match key="storage.policy.should_mount" bool="true"> <merge key="storage.policy.should_mount" type="bool">false</merge> </match> </match> </device> </deviceinfo> The customization line that the SDB article omits is: <match key="block.device" string="/dev/hdc"> I have added two sections, for my other cdrom and floppy: <match key="block.device" string="/dev/hdd"> <match key="block.device" string="/dev/fd0"> To see the list of parameters and their values, use the command: lshal |less In my system, it dumps 55 devices. I'll try to explain what each block does - what I think it does, I haven't seen any user documentation. There is no mention at all of the word "hal" in the whole SuSE admin book - I know, I grepped :-/ <match key="block.device" string="/dev/fd0"> <match key="storage.policy.should_mount" bool="true"> <merge key="storage.policy.should_mount" type="bool">false</merge> </match> </match> First, it tries to locate or identify the device, by matching the string "/dev/fd0": <match key="block.device" string="/dev/fd0"> ^^^^^^^^^^^^ ^^^^^^ ^^^^^^^^\ \ \ ---- variable value \ variable name \ variable type In that section, it then locates the key that says to mount, and changes (merges) it to false. Simple... and complex. It might be fine for people that are programmers, or programmers at soul, not developed. For a plain user, it might be difficult. If SuSE is intent on using this method, they should develop tools to configure this beast. Well, after doing your changes (I used mcedit, it has syntax colouring), don't forget the advice in the sdb article: edit the fstab. To apply the changes, restart hal (rchal restart). Check with the command "mount" what is mounted: umount the floppy if it still shows. There is a bug: with every hal restart, it mounts again the floppy device. Mine apeared four times before I noticed, each with its own directory in /media. For comparison, here is what 'lshal' says about my floppy now: udi = '/org/freedesktop/Hal/devices/legacy_floppy_0' block.storage_device = '/org/freedesktop/Hal/devices/legacy_floppy_0' (string) storage.policy.desired_mount_point = 'floppy' (string) storage.policy.mount_filesystem = 'auto' (string) storage.policy.should_mount = false (bool) <--------------««« info.udi = '/org/freedesktop/Hal/devices/legacy_floppy_0' (string) info.category = 'storage' (string) info.capabilities = 'block storage' (string) info.parent = '/org/freedesktop/Hal/devices/computer' (string) storage.model = 'Floppy Drive' (string) storage.vendor = '' (string) storage.physical_device = '/org/freedesktop/Hal/devices/computer' (string) storage.no_partitions_hint = true (bool) storage.automount_enabled_hint = false (bool) storage.media_check_enabled = false (bool) storage.removable = true (bool) storage.hotpluggable = false (bool) storage.drive_type = 'floppy' (string) storage.bus = 'platform' (string) block.have_scanned = false (bool) block.no_partitions = true (bool) block.minor = 0 (0x0) (int) block.major = 2 (0x2) (int) block.is_volume = false (bool) block.device = '/dev/fd0' (string) <----------------««« info.vendor = '' (string) info.product = 'Legacy Floppy Drive' (string) storage.legacy_floppy.number = 0 (0x0) (int) platform.linux.sysfs_path = '/sys/devices/platform/floppy.0' (string) linux.sysfs_path_device = '/sys/devices/platform/floppy.0' (string) linux.sysfs_path = '/sys/devices/platform/floppy.0' (string) info.bus = 'platform' (string) Notice that, although told not to mount, it still checks the drives. For example, in my dvd drive I have the SuSE install dvd, not mounted. But it shows: udi = '/org/freedesktop/Hal/devices/block_SU930.001' volume.policy.desired_mount_point = 'SU930.001' (string) ... volume.policy.should_mount = true (bool) ... volume.label = 'SU930.001' (string) ... block.device = '/dev/hdc' (string) That is not the drive, but the media. It has accessed it at some time The drive itself has another entry, which is the one I modified: udi = '/org/freedesktop/Hal/devices/block_HL-DT-ST DVDRAM GSA-4160B-K3448VG1350' ... storage.policy.mount_filesystem = 'auto' (string) storage.policy.should_mount = false (bool) ... block.device = '/dev/hdc' (string) Maybe I should change the 'auto' thing above. :-? On a related note, the links to the cdrom devices are defined in "/etc/udev/rules.d/20-cdrom.rules". Even if you create the links manually, they are modified again on each boot to what Yast though once they should be: # cdrom links generated by YaST2 # BUS="ide", ID="1.0", SYSFS{removable}="1", SYMLINK="dvdrecorder dvdram dvd" BUS="ide", ID="1.1", SYSFS{removable}="1", SYMLINK="cdrecorder cdrom" # El yast lo hizo mal. #BUS="ide", ID="1.0", SYSFS{removable}="1", SYMLINK="dvdram cdrom " #BUS="ide", ID="1.1", SYSFS{removable}="1", SYMLINK="dvd" I hope to have clarified things a bit. -- Cheers, Carlos Robinson