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
Opened by Dominik Schrempf (dschrempf) - Sunday, 12 April 2015, 22:57 GMT
Last edited by Toolybird (Toolybird) - Friday, 26 May 2023, 06:54 GMT
|
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.
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.
uname -a
Linux arbeitsbaer 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux
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?
/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
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
How does /proc/self/mountinfo show this mount point when mounted without the leading slash in the share name?
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.