GNOME Bugzilla – Bug 335700
gnome-mount can't handle mount points listed in /etc/fstab
Last modified: 2006-06-18 22:06:23 UTC
Please describe the problem: I just upgraded to gnome 2.14: gnome-volume-manager 1.5.15 gnome-vfs 2.14.0 gnome-mount 0.4 and now automounting cds/dvds (or manual mounting through icons in Computer) doesn't work when my dvd reader and cd-burner are listed in /etc/fstab, with normal permissions that allow mounting by common user (noauto,ro,user): I only get a message telling me that I haven't the needed privileges. If I remove those entries from fstab auto/manual mounting works again, but volumes are mounted to a directory with the cd label name, and I need fixed mount points for other applications (I don't use just gnome) IMHO this behaviour is wrong, gnome-mount should use the settings defined in fstab, just like pmount does, and create new mount-points when there aren't previous settings. definining mount-points in fstab is a standard policy in every linux system out there, and gnome-mount forces the users to change defaults that many other programs take for granted Steps to reproduce: 1. insert a cd with gnome-volume-manager enabled (configured to use gnome-mount) 2. wait for automount to start 3. read the error message Actual results: gnome can't mount the cd/dvd Expected results: gnome should mount the cd/dvd to /media/cdrom (or to what is set in /etc/fstab) Does this happen every time? yes Other information:
> IMHO this behaviour is wrong, gnome-mount should use the settings defined in > fstab, just like pmount does, and create new mount-points when there aren't > previous settings. This needs to be fixed, yes - gnome-mount should just try to call mount(1) on behalf of the user instead of trying to mount via hal in the event the device is actually listed in the /etc/fstab file. Btw, this behaviour is intended as otherwise we would violate system policy. Give me a few days and I'll fix it in CVS.
thank you, above all I'm happy to see that this isn't a deliberate policy. :)
What is the status of this bug? For me it doesn't mount when I have the fstab entry with the same privileges error. But without the fstab entry it also doesn't work with just "Cannot mount volume" error, no reason given.
This problem also occurs for my regular partitions too, not only for CDs/DVDs. It doesn't matter if the partition has ext3, FAT32 or NTFS filesystem. For example, I have these entries in my /etc/fstab: ===== $ grep dane /etc/fstab /dev/sdb1 /mnt/dane vfat users,noatime,nodiratime,shortname=mixed,iocharset=utf8,codepage=852,umask=0 0 0 $ grep winxp /etc/fstab /dev/sda1 /mnt/winxp ntfs noauto,users,noatime,iocharset=utf8,umask=0 0 0 ===== After clicking on the corresponding icon in the drivemount_applet2 and selecting mount 'Mount DANE' gnome-mount displays: ===== Error Cannot mount volume You are not privileged to mount the volume 'DANE'. ===== I can confirm that this message comes from gnome-mount by looking in the gnome-system-monitor (after closing the message, process named gnome-mount disappears). Additionally, a 'Mounting error' box pops up in the background, with empty message and 'OK' button. However, doing this as a regular user in gnome-terminal: ===== $ mount /mnt/dane $ mount /mnt/winxp ===== does what it should, additionally displaying a Nautilus window with the contents of mounted partitions. Unmounting works similarly: ===== Error Cannot unmount volume You are not privileged to unmount the volume 'DANE'. ===== But this works fine: ===== $ umount /mnt/dane ## ok $ umount /mnt/winxp ## ok ===== Versions of the respective packages: gnome-volume-manager-1.5.15-r1 gnome-vfs-2.14.1 gnome-mount-0.4-r2 I'm using Gentoo on an x86 machine.
Looking in the gnome-mount-0.4/src/gnome-mount.c I've found out that it also depends on some other packages, so here are their versions: udev-090 hal-0.5.7-r2 dbus-0.61-r1
Mounting manually from the terminal via gnome-mount gives such errors: $ gnome-mount -v -t -d /dev/sda1 gnome-mount 0.4 ** (gnome-mount:10898): DEBUG: Mounting /org/freedesktop/Hal/devices/volume_uuid_24F442BFF44292CA with mount_point='WINXP_NEW', fstype='', num_options=0 ** (gnome-mount:10898): WARNING **: Mount failed for /org/freedesktop/Hal/devices/volume_uuid_24F442BFF44292CA org.freedesktop.Hal.Device.Volume.PermissionDenied : /dev/sda1 found in /etc/fstab $ gnome-mount -v -t -d /dev/sdb1 gnome-mount 0.4 ** (gnome-mount:10935): DEBUG: Mounting /org/freedesktop/Hal/devices/volume_uuid_4229_7E96 with mount_point='DANE', fstype='', num_options=2 ** (gnome-mount:10935): DEBUG: option='shortname=winnt' ** (gnome-mount:10935): DEBUG: option='uid=1000' ** (gnome-mount:10935): WARNING **: Mount failed for /org/freedesktop/Hal/devices/volume_uuid_4229_7E96 org.freedesktop.Hal.Device.Volume.PermissionDenied : /dev/sdb1 found in /etc/fstab Commenting out /dev/sdb1 in /etc/fstab *ALLOWS* proper mounting and unmounting via drivemount_applet2, however several problems arise: * partition is mounted in (not so much) surprising place: /media/<volume-label> $ mount -l | grep /dev/sdb1 /dev/sdb1 on /media/DANE type vfat (rw,noexec,nosuid,nodev,shortname=winnt,uid=1000) [DANE] * mount options differ from the desired ones, and as per (now commented) /etc/fstab entry they should be: $ mount -l | grep /dev/sdb1 /dev/sdb1 on /mnt/dane type vfat (rw,noexec,nosuid,nodev,noatime,nodiratime,shortname=mixed,iocharset=utf8,codepage=852,umask=0) [DANE] * manual mount/umount from terminal is no longer possible: $ umount /media/DANE umount: /media/DANE is not in the fstab (and you are not root) $ umount /dev/sdb1 umount: /dev/sdb1 is not in the fstab (and you are not root) $ mount /dev/sdb1 mount: can't find /dev/sdb1 in /etc/fstab or /etc/mtab $ mount /mnt/dane mount: can't find /mnt/dane in /etc/fstab or /etc/mtab This behaviour is consistent with hal operations, but is *NOT* desired... :-(
(In reply to comment #1) > > IMHO this behaviour is wrong, gnome-mount should use the settings defined in > > fstab, just like pmount does, and create new mount-points when there aren't > > previous settings. > > This needs to be fixed, yes - gnome-mount should just try to call mount(1) on > behalf of the user instead of trying to mount via hal in the event the device > is actually listed in the /etc/fstab file. Btw, this behaviour is intended as > otherwise we would violate system policy. > > Give me a few days and I'll fix it in CVS. > Can we get an update on the status? This is a real PITA on a machine running multiple desktop environments/window managers.
Take a look at GNOME CVS, no change on gnome-mount for two months: http://cvs.gnome.org/viewcvs/gnome-mount/
Hello, I hope this Bug will be fixed soon. Sorry, but this is simply breaking some traditional Unix-Standards. And, for the most user the functionality of shell is more important, than the functionality of the desktop-enviroment. Shell > Gnome I don't want remove the entriy form fstab, and I can't remove the entriy from my fstab.
(In reply to comment #9) > I don't want remove the entriy form fstab, and I can't remove the entriy from > my fstab. As I've mentioned in comment #6, gnome-mount doesn't override hal actions. It is hal who is suspected ATM: > ** (gnome-mount:10935): WARNING **: Mount failed for > /org/freedesktop/Hal/devices/volume_uuid_4229_7E96 > org.freedesktop.Hal.Device.Volume.PermissionDenied : /dev/sdb1 found in > /etc/fstab So, maybe it's just a matter of writing/changing a couple of hal rules? The gnome-mount just uses what hal is sending to it. It doesn't work against it. But there could and should be some more insight behind it. For example, pmount works pretty well with the *ehm* K-environment. At least it respects the fstab entries and handles them right. All in all it's the current course with the (kernel + udev + hal + dbus) combo. Newer hal versions just forward via dbus notifications about mount events to the user level programs. In case of Gnome it's gnome-mount. Obviously, this program needs some love (and developers time) to gain more features and be useful enough. But lack of changes is frustrating, to say the least.
:( I know nothing about writing hal-rules, I just can offer the information that I'am running hal-0.5.7-r2
Created attachment 67502 [details] [review] patch to run mount/umount/eject if device listed in fstab Here's a patch to fix this. Patch is against gentoo's gnome-mount-0.4-r3. I have not exhaustively tested this, but it seems to do the job for me.
Created attachment 67521 [details] [review] revised patch This version deals with nodes in /dev that are symlinks.
Hi, thanks for the patch. I committed a slighty different patch that I already had sitting in my tree: http://cvs.gnome.org/viewcvs/gnome-mount/src/gnome-mount.c?r1=1.18&r2=1.19&makepatch=1&diff_format=u that also takes care of error handling and LABEL=, UUID= etc. Please reopen if there are additional issues. Thanks.