mounting via UUID behaves strange in kubuntu feisty

Bug #94848 reported by modeger
This bug report is a duplicate of:  Bug #99437: umount: mount disagrees with the fstab. Edit Remove
6
Affects Status Importance Assigned to Milestone
Ubuntu
New
Undecided
Unassigned

Bug Description

I am running Kubuntu feisty and these are my problems when I try to mount my external hdd via UUID:

fstab line following:
UUID=bd1deba5-89d8-429d-b267-9374224aa3d5 /media/usb-hdd-500G_2-xfs xfs noauto,defaults,user 0 1

1.:
When mounting my external hard drive from konsole, with parameters as given in fstab, it works. Nevertheless unmounting fails afterwards:

mo@moritz:~$ mount /media/usb-hdd-500G_2-xfs/
mo@moritz:~$ umount /media/usb-hdd-500G_2-xfs/
umount: /media/usb-hdd-500G_2-xfs mount disagrees with the fstab

With sudo, it does unmount it; it should do it without as well since I gave "user" option in fstab.

2.:
I am running KDE, but when connecting the drive it does not pop up with anything, like it did in edgy, neither do I get a Desktop symbol for it.
When I mount it with "$ mount /media/usb-hdd-500G_2-xfs/" I get the Desktop symbol. If I then right click on it to say "Safely remove" I get:

Error - kio_media_mounthelper
----------------------------------------
Unfortunately, the device system:/media/sdb2 (/dev/sdb2) named '484G Media' and currently mounted at /media/usb-hdd-500G_2-xfs could not be unmounted. Unmounting failed due to the following error:
Device to unmount is not in /media/.hal-mtab so it is not mounted by HAL

This is true, when I check /media/.hal-mtab I find an empty file.

3.:
kwikdisk fails to mount the drive, saying

ERROR - Kwikdisk
------------------------
Called: mount UUID=bd1deba5-89d8-429d-b267-9374224aa3d5
mount: can't find UUID=bd1deba5-89d8-429d-b267-9374224aa3d5 in /etc/fstab or /etc/mtab

which is a lie since it is in there.

when I mount it via konsole, kwikdisk again fails to unmount it, saying:

ERROR - Kwikdisk
------------------------
Called: umount /dev/sdb2
umount: /dev/sdb2 mount disagrees with the fstab

I do think that all this is strange and I hope that it is not due to any configuration errors from my side, but since I am quite sure it isn't I decided to file it as a bug.

The same applies for two other partitions, one on this drive, it is fat32, and one fat32 on another one. I guess it is connected to the UUID thing since all my other, non UUID mounts work.

Revision history for this message
modeger (moritzdeger) wrote :

I forgot to mention, I upgraded from edgy to feisty fawn Herd 5,
all current updates are done and kernel version is 2.6.20-12-generic.

Revision history for this message
Júlio Alexandrino (alexandrino) wrote :

Probably related to bug #99437 and bug #71609 .

Revision history for this message
Frederick Reeve (cylix) wrote :

All three bugs on this are from the same source. This is the fix. I am attaching this patch to all three. I have been using it for a while, its fine. The attached patch should be applied to the src-dep of util-linux. For those of you who want this fix now follow these instructions:

Modify your source.list so you have so the dep-src for the main repository enabled and copy the patch into /tmp. Then run the following commands:

$ sudo apt-get update
$ sudo apt-get install build-essential
$ sudo apt-get build-dep mount
$ cd /tmp
$ apt-get source mount
$ cd util-linux-2.12r
$ ./debian/rules patch
$ patch -Np1 -i ../util-linux_user_mount.patch
$ ./configure
$ make lib
$ make -C mount
$ sudo chown root:root mount/umount
$ sudo chmod 4755 mount/umount
$ sudo mv mount/umount /bin

now you should be able to unmount you drive that was user mounted using a uuid.

As a note to the user above if you are going to have an external drive auto mountable by uuid or label with an fstab entry you should never us the "defaults" option. This allows suid and dev files to work on the drive. From as security standpoint anyone who can look at the fstab can now grab your uuid or lable and set it up on a drive they have. Thats bad because then all they have to do is static link a program that makes them root and suid it and they have you system. I recommend the following options for external drives: rw,exec,noauto,user. Of course for even more security you drop the exec. Anyway hope this helps out and I hope this fix will be in the next few updates.

Revision history for this message
Frederick Reeve (cylix) wrote :

It may also be noted that the options I gave above are only for preventing getting root access. If you want to protect data that diff. It also may not be desirable to let users mount the drive.

Anyway enough said. You can go around in circles about this stuff.

Revision history for this message
Stefan Fleiter (stefan-fleiter) wrote :

The problem from part 1. is fixed in gutsy.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.