12

When I configure NFS and create a file on the client NFS shared dir, I get the following message: permission denied.

My configuration:

configuration nfs server

http://www.server-world.info/en/note?os=CentOS_6&p=nfs&f=1

ss of server setup

configuration nfs client

http://www.server-world.info/en/note?os=CentOS_6&p=nfs&f=2

ss of client setup

where is the problem?

3
  • Those 2 images don't tell much. Can you do a showmount -e server from the client as well the output from mount? – ott-- Jun 12 '13 at 18:36
  • What user are you logged in to the client as? If root, what are your NFS export options on the server? – John Jun 12 '13 at 18:40
  • LEGEND !!!!!! I have been trying to mount a docker NFS volume for two days now no where did I see no_all_squash until here ! Shot bro! – hounded Jan 23 '18 at 21:13
19

You need to run the command on the server after modifying the /etc/exports file:

$ exportfs -a

Also when debugging connectivity issues with NFS you can run the command showmount -e <nfs server> to see what mounts a given server is exporting out.

example

$ showmount -e cobbler
Export list for cobbler:
/cobbler/isos 192.168.1.0/24

services running on nfs clients

You need to make sure that you have the following services running so that the clients can communicate with the NFS server:

$ chkconfig --list|grep rpc
rpcbind         0:off   1:off   2:on    3:on    4:on    5:on    6:off
rpcgssd         0:off   1:off   2:off   3:on    4:on    5:on    6:off
rpcidmapd       0:off   1:off   2:off   3:on    4:on    5:on    6:off
rpcsvcgssd      0:off   1:off   2:off   3:off   4:off   5:off   6:off

As well as this one:

$ chkconfig --list|grep nfs
nfs             0:off   1:off   2:off   3:off   4:off   5:off   6:off
nfslock         0:off   1:off   2:off   3:on    4:on    5:on    6:off

rpcinfo

With the above services running you should be able to check that the client can make remote procedure calls (rpc) to the NFS server like so:

$ rpcinfo -p cobbler
   program vers proto   port  service
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp    807  status
    100024    1   tcp    810  status
    100011    1   udp    718  rquotad
    100011    2   udp    718  rquotad
    100011    1   tcp    721  rquotad
    100011    2   tcp    721  rquotad
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100021    1   udp  60327  nlockmgr
    100021    3   udp  60327  nlockmgr
    100021    4   udp  60327  nlockmgr
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100021    1   tcp  57752  nlockmgr
    100021    3   tcp  57752  nlockmgr
    100021    4   tcp  57752  nlockmgr
    100005    1   udp    750  mountd
    100005    1   tcp    753  mountd
    100005    2   udp    750  mountd
    100005    2   tcp    753  mountd
    100005    3   udp    750  mountd
    100005    3   tcp    753  mountd

mounting and the kernel modules

I see what you wrote in an answer that you then deleted. You should've added that info to the question!

I can see where you were getting stumped now. I don't believe you're suppose to be mounting using:

$ mount -t nfsd ...

that should be:

$ mount t nfs ... 

Try changing that. Also I see where you were ultimately getting stumped. You didn't have the nfs kernel module loaded.

$ modprobe nfs
14
  • ON THE CLIENT I HAVE THIS SITUATION [root@pippa salolas]# showmount -e IPSERVER clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host) – Cocotuna Jun 12 '13 at 20:55
  • 1
    See my updates, make sure those are running. – slm Jun 12 '13 at 20:59
  • 1
    Are the above daemons running? Also it could be a firewall issue. If it's enabled, could you stop it temporarily? /etc/init.d/iptables stop. – slm Jun 13 '13 at 19:33
  • 2
    I'm glad you resolved your issue, and I don't mean this in a mean spirited way but in the future if you're going to participate on this site you have to be more forth coming with information and try not to get frustrated with follow-up questioning. Your comments of "YESSSSS" may come from your frustration, but they can be interpreted as rude to others who are only trying to help you with your problem! I could've helped you with this issue days ago if you'd provided the feedback that I was asking you for multiple times, and yet you finally posted it as an answer and then deleted it at the end. – slm Jun 15 '13 at 17:01
  • 1
    Worth noting: after running exportfs -a you also need to remount the mounted nfs share. Otherwise changes might not apply. – Hi-Angel May 20 '20 at 14:51
-1

What I found is that with Ubuntu 15.04 updated thru the end of April. External USB drives can only be shared via NFS if the drive is mounted to the users home directory, and NOT THE DEFAULT Music/Video folders. Then nobody:nogroup on the server. The fsid=0 for the root of the export must there too. It all works. I can provide samples from the first client, then server.

Client - fstab
 server:/home/userid/MyMusic    /home/clientid/Music   nfs     auto       0       0
 server:/home/userid/MyVideo    /home/clientid/Videos  nfs     auto       0       0

I will post the server section as a separate answer as I do not have access YET to the root directory

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.