LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-21-2022, 03:51 PM   #1
fido_dogstoyevsky
Member
 
Registered: Feb 2015
Location: Victoria, Australia
Distribution: Slackware 15
Posts: 490
Blog Entries: 2

Rep: Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576
Can't unmount NFS as normal user after hardware and Slackware upgrade


Recently upgraded hardware and did a full installation of Slackware 15.

I'm using a network file server with the same settings as I was with Slackware 14.2, which functions the same as before except that now I can only unmount it as root. I can mount it as a normal user as I could before; but if I try to unmount it as a normal user I get the error message
Code:
 umount.nfs: You are not permitted to unmount /media/pinotgrigio_server
I'm using the same fstab entry as before
Code:
10.1.1.80:/home/Tosh3TB/shared_files  /media/pinotgrigio_server  nfs  noauto,user,defaults  0 0
According to man fstab I shouldn't need to unmount as root. Am I looking in the wrong place for the problem?
 
Old 02-21-2022, 07:15 PM   #2
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,363

Rep: Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078
Hi,

FWIR,

If you mount NFS with the "user" option, the user who mounted it will be written to /run/mount/utab
Mount specifications are written in /etc/mtab by the kernel¹ (and there is no "user" information).

When umounting NFS, the content of /etc/fstab is irrelevant
The information needed is in /etc/mtab (/proc/mounts) and /run/mount/utab

And regular users are not allowed to write inside /etc/mtab

It's probably a bit simplistic, but I couldn't find the detailed information in which it was explained

¹: I guess

Last edited by marav; 02-21-2022 at 07:22 PM.
 
2 members found this post helpful.
Old 02-21-2022, 07:58 PM   #3
fido_dogstoyevsky
Member
 
Registered: Feb 2015
Location: Victoria, Australia
Distribution: Slackware 15
Posts: 490

Original Poster
Blog Entries: 2

Rep: Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576
Thank you, gives me something to look up.

Switching to root to unmount isn't causing me any urgent problems, but not understanding why is really irritating.
 
Old 02-22-2022, 03:54 AM   #4
jwoithe
Member
 
Registered: Oct 2019
Posts: 73

Rep: Reputation: 88
There is further information in a thread I created in May 2021 on this issue:
(Current) Users cannot unmount NFS volume with fstab "users" option

The practical result is that there is no fix that I am aware of. As explained in the above thread, the altered behaviour is a consequence of the way the "users" option is tracked in the case of NFS mounts, and the switch of /etc/mtab from a file (which "mount" could write directly) to a symlink pointing to /proc/mounts (which "mount" has no control over).

The workaround I ultimately adopted was the use of sudo with the appropriate umount command.

Last edited by jwoithe; 02-22-2022 at 03:57 AM.
 
1 members found this post helpful.
Old 02-22-2022, 12:34 PM   #5
fourtysixandtwo
Member
 
Registered: Jun 2021
Location: Alberta
Distribution: Slackware...mostly
Posts: 317

Rep: Reputation: 209Reputation: 209Reputation: 209
You could always configure the automounter instead.
 
1 members found this post helpful.
Old 02-22-2022, 12:59 PM   #6
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
I use nfs to share my users home directory across many cloud-based virtual machines all on the same openvpn created subnet (tun0).

On the nfs server, in my /etc/exports file I defined userid and groupid, like this:

Code:
/nfs/home/me 10.0.0.0/24(rw,all_squash,no_subtree_check,anonuid=2345,anongid=2345)
Even though it's a private subnet, above, I chose arbitrary username, subnet, uid and gid, for illustartive purposes, because I'm not expert enough on security to know if leaking such info could be exploited.

However, since user's shared home directory is what the user logs in to when accessing these remote machines over ssh, I can't test unmounting as regular user, because the directory is in use. But I can say that before I explicitly defined uid and gid, my user couldn't write, even though I had rw specified.
 
1 members found this post helpful.
Old 02-22-2022, 02:00 PM   #7
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,791

Rep: Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470
Quote:
Originally Posted by jwoithe View Post
the altered behaviour is a consequence of the way the "users" option is tracked in the case of NFS mounts, and the switch of /etc/mtab from a file (which "mount" could write directly) to a symlink pointing to /proc/mounts (which "mount" has no control over).
If you remove the symbolic link /etc/mtab, rc.S will make it a file. Or if you have an old install like I have, there has never been a link, so it still is a file.
 
1 members found this post helpful.
Old 02-22-2022, 03:57 PM   #8
jwoithe
Member
 
Registered: Oct 2019
Posts: 73

Rep: Reputation: 88
Quote:
Originally Posted by fourtysixandtwo View Post
You could always configure the automounter instead.
True, in some situations. In my case the automounter could not be used because the volume being mounted was not always available and this caused other issues. For many others though it could be a viable solution. It really depends on why ordinary users - as opposed to the system - need to do the mount/umount in each specific situation.
 
Old 02-22-2022, 04:16 PM   #9
jwoithe
Member
 
Registered: Oct 2019
Posts: 73

Rep: Reputation: 88
Quote:
Originally Posted by Petri Kaukasoina View Post
If you remove the symbolic link /etc/mtab, rc.S will make it a file. Or if you have an old install like I have, there has never been a link, so it still is a file.
Forcing /etc/mtab back to a file is certainly an option. However, there are good reasons why /etc/mtab was changed to a symlink in (from what I've heard) pretty much all distributions (with Slackware being one of the last I think). Among other things, it makes the use of a read-only root filesystem easier and I believe the symlink also simplifies the use of namespaces. If none of the related issues are of concern or relevant, shifting /etc/mtab back to a file could work. However, since most distributions and packages are now assuming /etc/mtab is a symlink to /proc/mounts, there may come a time where a /etc/mtab file causes trouble. This was the primary reason I stuck with the symlink and came up with a solution which worked in my situation: it will prevent things breaking unexpectedly at some point in the future when it won't be possible to quickly get things going again by reverting to a file while a fix is devised.
 
Old 02-22-2022, 08:30 PM   #10
fido_dogstoyevsky
Member
 
Registered: Feb 2015
Location: Victoria, Australia
Distribution: Slackware 15
Posts: 490

Original Poster
Blog Entries: 2

Rep: Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576
Thanks everybody for your suggestions, Ive looked where I'd never have otherwise thought of.

It looks like the easiest way for me is to keep unmounting as root, all the alternatives carry the risk of unexpected consequences some random time in the future. On the plus side, I've learned quite a bit.

Marking the thread as solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't unmount -- oops, can't fsck after unmount upnort Slackware 4 05-18-2019 11:41 AM
shutdown tumbleweed: failed to unmount /home; failed to unmount /var JZL240I-U Linux - Software 3 04-03-2017 07:23 AM
Missing unmount and unmount.cifs johnmccarthy Linux - Newbie 3 11-19-2011 07:01 AM
Can't unmount NFS. Remote NFS system was down. PeteRossi Linux - Software 3 10-05-2003 02:23 PM
command 'unmount' not found - how can i unmount??? GloVe Linux - General 1 10-04-2003 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration