mount nfs as another folder on home
I have purchased a WD-Ex2 NAS and am trying to share a folder via nfs with my ubuntu machine.
This folder will be used only by this machine and I want to be able to have execute permissions with my user. I would like it to be treated as one more home folder.
I am mounting the folder as follows
$ sudo cat /etc/fstab
...
#nfs mycloud
192.168.0.151:/nfs/tmp_msigs60 /media/tmp_msigs60 nfs defaults,user,relatime,rw,exec 0 0
but I don't have execute permissions and the owner is user # 501 not my user
I have tried mounting with the following options
192.168.0.151:/nfs/tmp_msigs60 /media/tmp_msigs60 nfs defaults,user,relatime,rw,exec,uid=1000,gid=1000,umask=002 0 0
but when putting uid=1000,gid=1000,umask=002
I get the error:
mount.nfs: an incorrect mount option was specified
Another thing I have tried is to edit /etc/idmapd.conf
and change nobody
and nogroup
for my user, but I have not had any result either
[General]
Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
[Mapping]
Nobody-User = rodrigo
Nobody-Group = rodrigo
Another thing that I have noticed is that the speed of writing and reading starts with high speed, but it decreases considerably while transferring the file in that folder. I do not know what are the recommended parameters to mount it efficiently, I have seen that sometimes buffer sizes are used as parameters
Edit 1 Thanks to @MichaelHampton I have discovered that the file /etc/exports of the server contain the following:
"/nfs/tmp_msigs60" 192.168.0.121(rw,all_squash,sync,no_wdelay,insecure_locks,insecure,no_subtree_check,anonuid=501,anongid=1000)
Edit 2 according to WD support, the nfs they provide do not support asynchronous operations. It does not matter what configuration is put in /etc/exports
Solution 1:
Your problem here is all_squash
, which really doesn't make sense in this context. If all your clients were Windows then it might be useful, as Windows has no real concept of Unix permissions. You should remove that option, along with its related options anonuid
and anongid
. Replace these with no_root_squash
which will allow your Linux client full access to the share. And be sure to figure out, if you can, why the NAS has put these options there and stop it from doing so if possible.