You are not logged in.

#1 2016-01-03 20:03:33

Hmail
Member
Registered: 2012-03-14
Posts: 14

nfsv4 outside /srv?

Hi,

I am using a vagrant box that mounts a share which is by default mounted via NFSv4. However, the root path of the share is in my home directory. This gives a permission denied error, and I can fix this by placing my content in /srv.

The documentation says: "NFS shares have to reside in /srv" (https://wiki.archlinux.org/index.php/NF … e_mounting) but is there no setting to change this behaviour?

This is the vagrant machine I am working with: https://github.com/Elao/symfony-standard

Last edited by Hmail (2016-01-03 20:04:58)

Offline

#2 2016-01-03 20:20:22

ayekat
Member
Registered: 2011-01-17
Posts: 1,616

Re: nfsv4 outside /srv?

What have you put into your exports file?

Hmail wrote:

The documentation says: "NFS shares have to reside in /srv" (https://wiki.archlinux.org/index.php/NF … e_mounting)

Well, the wiki is not the documentation. smile


pkgshackscfgblag

Offline

#3 2016-01-03 20:23:34

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: nfsv4 outside /srv?

^ this. I share directories not in /srv, and it works. Post your /etc/exports file.

The nfs wiki page says this:

NFS needs to see the list of shares (referred to as "exports" from here on out), which are defined in /etc/exports in order to serve-up the content. This can be any directory on the file system.

Offline

#4 2016-01-03 21:25:08

Hmail
Member
Registered: 2012-03-14
Posts: 14

Re: nfsv4 outside /srv?

This is the exports line that does work:

"/srv/documents/documents" 172.28.128.5(rw,no_subtree_check,all_squash,anonuid=1000,anongid=100,fsid=1568133506)

And this is the one that gives a permission denied error:

"/home/henk/documents2" 172.28.128.6(rw,no_subtree_check,all_squash,anonuid=1000,anongid=100,fsid=755860892)

As far as I can see, nothing different except the path. The client executes this command:

mount -o 'nolock,actimeo=1,fsc' 172.28.128.3:'/home/henk/documents2' /srv/app/symfony

And when I run it in verbose mode I get this:

documents2# mount -vvvv -o 'nolock,actimeo=1,fsc' 172.28.128.3:'/home/henk/documents2' /srv/app/symfony
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: no type was given - I'll assume nfs because of the colon
mount: spec:  "172.28.128.3:/home/henk/documents2"
mount: node:  "/srv/app/symfony"
mount: types: "nfs"
mount: opts:  "nolock,actimeo=1,fsc"
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "172.28.128.3:/home/henk/documents2"
mount: external mount: argv[2] = "/srv/app/symfony"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw,nolock,actimeo=1,fsc"
mount.nfs: timeout set for Sun Jan  3 21:22:16 2016
mount.nfs: trying text-based options 'nolock,actimeo=1,fsc,vers=4,addr=172.28.128.3,clientaddr=172.28.128.6'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 172.28.128.3:/home/henk/documents2

I can mount it with:

documents2# mount -vvvv -o 'vers=3,nolock,actimeo=1,fsc' 172.28.128.3:'/home/henk/documents2' /srv/app/symfony

Or, when the nfs directory is in /srv, I can mount it without specifing version 3. I don't really care which version this is, it is a virtual box that corresponds with my machine, so as long as it works I don't care, but the commands and files are created by scripts. The Archlinux wiki ( wink ) is the only source I found that says that nfsv4 needs to be mounted from /srv, so that's why I came to this conclusion.

Offline

#5 2016-01-03 22:15:20

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,415

Re: nfsv4 outside /srv?

You specified userid and groupid and that would be permissions that would require matching arguments on the mount side.  Otherwise, root would be able to mount it.  Normally, if it doesn't have permission, it just acts normally.  But when you specify it on the mount or in exports, it changes the behaviour.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB