Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nfs and systemd : mounting as users but unmounting not
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Sun Oct 20, 2013 5:26 pm    Post subject: nfs and systemd : mounting as users but unmounting not Reply with quote

A few weeks ago I switched to systemd.

In the fstab mounting is alowed to normal user:
Code:
n.n.n.n:/fotos   /marvin/fotos   nfs   noauto,user      0 0


Code:
~$ mount /marvin/fotos/


~$ umount /marvin/fotos/
umount: /marvin/fotos: umount failed: operation not permitted


Do I miss another mount option ?
The same configuration worked with openrc by now .

Any hints are appreciated.
Back to top
View user's profile Send private message
croutch
n00b
n00b


Joined: 04 Aug 2012
Posts: 31
Location: göteborg

PostPosted: Mon Oct 21, 2013 4:15 am    Post subject: Reply with quote

Maby is what you looking for?

https://bbs.archlinux.org/viewtopic.php?pid=1260240#p1260240

croutch
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Mon Oct 21, 2013 5:18 pm    Post subject: Reply with quote

croutch wrote:
Maby is what you looking for?

https://bbs.archlinux.org/viewtopic.php?pid=1260240#p1260240

croutch


Hi croutch,

thanks for the archlinux-alternative.
As fas as I understand that thread it doesn't refer on gentoo and offers a non-systemd solution.
This is what I already have and use with the alternative system start via openrc .

Is there really no simple mount/unmount solution for systemd without stumbling across this permission-denied-problem ?
To be honest I don't need/want any automount possibilty
the

The umount command from the script in
https://bbs.archlinux.org/viewtopic.php?pid=1260240#p1260240

gives me

Code:

~$ umount -l -f /marvin/mucke/
umount: only root can use "--force" option

~$ umount -l  /marvin/mucke/
umount: /marvin/mucke: umount failed: operation not permitted


I would like to be able to unmount as a regular user.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5227
Location: France, Old Europe

PostPosted: Tue Oct 29, 2013 6:29 am    Post subject: Reply with quote

Can you umount a non nfs partition as user?
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.

AthlonXP-M on A7N8X @ 2.6/2.4GHz (winter/summer)
2.6.32-hh1 : portage ~x86
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Tue Oct 29, 2013 7:30 am    Post subject: Reply with quote

Gentree wrote:
Can you umount a non nfs partition as user?


With openrc it worked as expected.
I used a write-protected sdcard for the test.
After inserting it was not automounted.

Now with sytemd:

Inserting the sdcard:

Code:
Oct 29 08:21:39 arthur kernel: sd 6:0:0:1: [sdf] 15556608 512-byte logical blocks: (7.96 GB/7.41 GiB)
Oct 29 08:21:39 arthur kernel: sd 6:0:0:1: [sdf] Write Protect is on
Oct 29 08:21:39 arthur kernel: sd 6:0:0:1: [sdf] Mode Sense: 03 00 80 00
Oct 29 08:21:39 arthur kernel: sd 6:0:0:1: [sdf] No Caching mode page present
Oct 29 08:21:39 arthur kernel: sd 6:0:0:1: [sdf] Assuming drive cache: write through
Oct 29 08:21:39 arthur kernel: sd 6:0:0:1: [sdf] No Caching mode page present
Oct 29 08:21:39 arthur kernel: sd 6:0:0:1: [sdf] Assuming drive cache: write through
Oct 29 08:21:39 arthur kernel: sdf: sdf1


Check per 'mount' it is not automounted as well.

mounting
Code:

~$ mount /mnt/mp3playerVorne/
mount: /dev/sdf1 is write-protected, mounting read-only
mount
/dev/sdf1 on /mnt/mp3playerVorne type vfat (ro,nosuid,nodev,noexec,relatime,uid=1000,gid=4244,fmask=0022,dmask=0022,codepage=850,iocharset=utf8,shortname=mixed,errors=remount-ro,user=mpcww)


permissions
Code:
~$ ls -ld /mnt/mp3playerVorne/
drwxr-xr-x 8 mpcww mpcww 4096  1. Jan 1970  /mnt/mp3playerVorne/


unmounting:
Code:

~$ umount /mnt/mp3playerVorne/
[mpcww@arthur 2013-10-29 08:24:32:CET T2:L:2:C506]


It works as expected, so a regular user can mount / umount an usb device, but not a nfs-partition.

fstab settings I use
( first usbdevice, second nfs-device)

Code:

/dev/sdf1               /mnt/mp3playerVorne  vfat               iocharset=utf8,codepage=850,noauto,rw,user
192.168.3.25:/mucke     /marvin/mucke   nfs                noauto,user             0 0


Good hint, to check and compare that !
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5227
Location: France, Old Europe

PostPosted: Tue Oct 29, 2013 8:38 am    Post subject: Reply with quote

That is what I suspected, so you maybe need to be looking at nfs permissions, rather than mount itself.

Mount reported the error but it may not be the origin of the error.

Perhaps look at /etc/exports

Try grepping dmesg and /var/log/messages for "nfs"
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.

AthlonXP-M on A7N8X @ 2.6/2.4GHz (winter/summer)
2.6.32-hh1 : portage ~x86
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Tue Oct 29, 2013 9:44 am    Post subject: Reply with quote

Yes, your right, it is not a systemd/openrc-issue .

Gentree wrote:

Perhaps look at /etc/exports
Try grepping dmesg and /var/log/messages for "nfs"


As root I can umount the nfs mounted as normal user.

The server is qnap-nas and its /etc/exports has configured in this case.
Code:
"/share/HDA_DATA/fotos" 192.168.1.20(rw,async,no_root_squash,insecure) 192.168.3.15(rw,async,no_root_squash,insecure)


On the server /var/log/messages is empty. :(

On the client I find just these entries:
Code:
Oct 29 07:59:52 arthur kernel: Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Oct 29 07:59:52 arthur systemd[1]: Starting NFS server...
Oct 29 07:59:52 arthur systemd[1]: Starting NFSv2/3 Network Status Monitor Daemon...
Oct 29 07:59:52 arthur rpc.statd[18139]: Running as root.  chown /var/lib/nfs to choose different user
Oct 29 07:59:52 arthur systemd[1]: Started NFSv2/3 Network Status Monitor Daemon.
Oct 29 10:11:01 arthur kernel: NFS: Registering the id_resolver key type
Oct 29 10:24:37 arthur kernel: nfsd: last server has exited, flushing export cache
Oct 29 10:25:39 arthur kernel: RPC: Registered tcp NFSv4.1 backchannel transport module.
Oct 29 10:25:40 arthur rpc.statd[18060]: Running as root.  chown /var/lib/nfs to choose different user
Oct 29 10:31:41 arthur kernel: NFS: Registering the id_resolver key type


Quote:
arthur mpcww # dmesg | grep -i nfs
[ 5.688075] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 384.396136] NFS: Registering the id_resolver key type
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 2623
Location: de

PostPosted: Tue Oct 29, 2013 9:44 am    Post subject: Reply with quote

I had this problem too. The solution is easy but it's only a workaround with ugly side-effects.

Systemd wants to have /etc/mtab as a symlink to /proc/self/mounts. Because /etc/mtab keeps older entries even after a reboot. But setting the symlink causes the umount problem. So just revert /etc/mtab to an ordinary file and you'll be able to unmount nfs-partitions again as a user.

Code:
rm /etc/mtab
cat /proc/self/mounts > /etc/mtab


The side-effect is, that the output of mount contains some mount entries up to 20 times. Haven't noticed any unwanted behaviour yet.


Last edited by musv on Mon Nov 04, 2013 11:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5227
Location: France, Old Europe

PostPosted: Tue Oct 29, 2013 10:31 am    Post subject: Reply with quote

Code:
Oct 29 10:25:40 arthur rpc.statd[18060]: Running as root.  chown /var/lib/nfs to choose different user


perhaps that's where to look. no time now.
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.

AthlonXP-M on A7N8X @ 2.6/2.4GHz (winter/summer)
2.6.32-hh1 : portage ~x86
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Sun Nov 03, 2013 1:07 pm    Post subject: Reply with quote

Gentree wrote:
Code:
Oct 29 10:25:40 arthur rpc.statd[18060]: Running as root.  chown /var/lib/nfs to choose different user


perhaps that's where to look. no time now.


At the first glance that seemed really compelling.
But today I did a mount / unmount with another gentoo-client machine.

The difference: no gnome3 an systemd-use flag.
I don't see a clear relationship.
But in the past weeks I observerd some strange side effects while running the instable setup with systemd and gnome3, even if I booted that machine with openrc (for example calibre couldn't detect ereader plugged in due to dependies between udisk and the systemd use flag, do booted with openrc it didn't work any more).

I just decided to get rid of systemd and gnome3.

Anyway, thanks for your support and figuring out some possibilities.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2277
Location: Canada

PostPosted: Sun Nov 03, 2013 8:03 pm    Post subject: Reply with quote

Should not the mount option be be 'users' with 's' rather than 'user' to allow unmounting ? (man mount says 'user' allows only to mount but not unmount)
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Sun Nov 03, 2013 9:16 pm    Post subject: Reply with quote

I think they mean "users" is necessary if you want a different user to umount.
If the user mounts and unmounts it doesn't matter.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum