FS#44565 - [util-linux] `user` mount option does not allow unmount

Attached to Project: Arch Linux
Opened by Dominik Schrempf (dschrempf) - Sunday, 12 April 2015, 22:57 GMT
Last edited by Toolybird (Toolybird) - Friday, 26 May 2023, 06:54 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dave Reisner (falconindy)
Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The `user` mount option does not allow unmounting without root privileges.
Various other users report this problem, however, I could not find a fix for mine.

https://bugs.archlinux.org/task/38908
https://bugs.archlinux.org/task/31624

Additional info:
Name : nfs-utils
Version : 1.3.2-6

Steps to reproduce:
(0. Configure a NFS share)
1. Put an NFS user mount point into /etc/fstab
: alarmpi.local:dom-hd /home/dominik/Music/RaspPi-External nfs noauto,noatime,users 0 0
2. Reload systemd daemon
3. Mount as user
: mount /home/dominik/Music/RaspPi-External
4. Try to umount
: umount /home/dominik/Music/RaspPi-External
umount: /home/dominik/Music/RaspPi-External: umount failed: Operation not permitted

Some sources discuss an /etc/mtab symlink and util-linux.

Best,
Dominik
This task depends upon

Closed by  Toolybird (Toolybird)
Friday, 26 May 2023, 06:54 GMT
Reason for closing:  None
Additional comments about closing:  Old and stale. If this is still a problem worth caring about, please report upstream.
Comment by Karol Błażewicz (karol) - Monday, 13 April 2015, 00:41 GMT
Are you using Arch Linux ARM?
Comment by Dominik Schrempf (dschrempf) - Monday, 13 April 2015, 09:19 GMT
I am sorry, I should have been more specific. No, I am not using Arch Linux ARM. I try to mount an NFS share that is shared by a RaspberryPi which in turn runs Arch Linux ARM.

uname -a
Linux arbeitsbaer 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux
Comment by Doug Newgard (Scimmia) - Tuesday, 14 April 2015, 04:25 GMT
  • Field changed: Summary (`user` mount option does not allow unmount → [util-linux] `user` mount option does not allow unmount)
  • Field changed: Status (Unconfirmed → Assigned)
  • Task assigned to Dave Reisner (falconindy)
Since the others were in util-linux, I'm guessing this is, too.
Comment by Dave Reisner (falconindy) - Tuesday, 14 April 2015, 13:00 GMT
> Since the others were in util-linux, I'm guessing this is, too.
Well, there's a mount helper involved here, so it's possible that it's nfs-utils at fault for not linking to libmount. I was under the impression that this was supposed to be resolved with some recent util-linux (2.25.x maybe).

Can you post /run/mount/utab at the time of the umount failure?
Comment by Dominik Schrempf (dschrempf) - Tuesday, 14 April 2015, 22:09 GMT
My util-linux version is 2.26.1-3.

/run/mount/utab before and after unsuccessful umount shows
SRC=alarmpi.local:dom-hd TARGET=/home/dominik/Music/RaspPi-External ROOT=/ ATTRS=vers=4.1,addr=192.168.1.199,clientaddr=192.168.1.12
Comment by Dave Reisner (falconindy) - Wednesday, 29 June 2016, 11:38 GMT
Is this still valid?
Comment by Dominik Schrempf (dschrempf) - Wednesday, 29 June 2016, 11:42 GMT
Hello,

thanks for following up on this. I found the problem. I had in my /etc/fstab

nfs_server:nfs_share /path/to/mount/dir nfs users,...

With this line, mounting worked perfectly, but the unmount did not!

The correct line is:
nfs_server:/nfs_share /path/to/mount/dir nfs users,...

I never found the problem because mounting worked. Maybe this should be changed in the code, but then it was my fault because the fstab entry was wrong.

Best,
Dominik
Comment by Dave Reisner (falconindy) - Wednesday, 29 June 2016, 12:09 GMT
Is it still the case that with the "bad" entry in fstab that the utab entry is NOT removed after umount? That would be a bug worth reporting upstream.

How does /proc/self/mountinfo show this mount point when mounted without the leading slash in the share name?
Comment by Dominik Schrempf (dschrempf) - Wednesday, 29 June 2016, 12:42 GMT
With the bad entry, the problem still persists. I am not at the machine that has this problem at the moment, however, I believe that the mountinfo file includes the mount point with the leading slash, even for the wrong fstab entry. fusermount -u /path/to/mount/dir complains about a missing entry in /proc/self/mounts. I guess because the entries do not match.
Comment by Dave Reisner (falconindy) - Wednesday, 29 June 2016, 13:22 GMT
fusermount is for FUSE filesystems. If it happens to work for user-tagged mountpoints, I'd call that a coincidence at best. Could you please find out if 'umount' has the same behavior?
Comment by Dominik Schrempf (dschrempf) - Thursday, 07 July 2016, 10:22 GMT
Sorry for the break, I only could access the computer today.

With the bad fstab:
- mount with "mount Music/RaspPi-External" works
- umount with "umount Music/RaspPi-External" gives error: "umount: /home/dominik/Music/RaspPi-External: umount failed: Operation not permitted"
- sudo umount Music/RaspPi-External works

With the good fstab (including /), "umount Music/RaspPi-External" also works.

Fusermount does not work in general, as you anticipated!
- mount with "fusermount Music/RaspPi-External/" gives error: "fusermount: old style mounting not supported"
- umount with "fusermount -uz Music/RaspPi-External/" gives error: "fusermount: entry for /home/dominik/Music/RaspPi-External not found in /etc/mtab"

Edit: I just checked /proc/self/mountinfo with the bad fstab. The entry is
298 80 0:47 / /home/dominik/Music/RaspPi-External rw,nosuid,nodev,noexec,noatime shared:237 - nfs4 blaubaer.local:/dom-hd rw,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.189,local_lock=none,addr=192.168.1.198

I.e., the slash is included although it is not in fstab.
Unmounting with sudo removes the entry in mountinfo.

Loading...