[Solved] NFS server not exporting host present in /etc/exports

user216423 Asks: NFS server not exporting host present in /etc/exports
I have a NFS server running on CentOS 7.2 and I have a problem with one (path/client host) declared in my /etc/exports that should be exported and that is not…

My /etc/exports file :

Code:
/mnt/data/ host1(rw,all_squash,anonuid=1001,anongid=1001)
/mnt/data/ host2(rw,all_squash,anonuid=1001,anongid=1001)
/mnt/data/ host3(rw,all_squash,anonuid=1001,anongid=1001)
/mnt/data/ host3(rw,all_squash,anonuid=1001,anongid=1001)

I restarted my nfs server and do exportfs -a so the output of cat /var/lib/nfs/etab is correct:

Code:
/mnt/data   host1(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=1001,anongid=1001,sec=sys,rw,secure,root_squash,all_squash)
/mnt/data   host2(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=1001,anongid=1001,sec=sys,rw,secure,root_squash,all_squash)
/mnt/data   host3(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=1001,anongid=1001,sec=sys,rw,secure,root_squash,all_squash)
/mnt/data   host4(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=1001,anongid=1001,sec=sys,rw,secure,root_squash,all_squash)

But when I run showmount -e it does not show me host1 :

Code:
/mnt/data host2 host3 host4

And actually I could not mount /mnt/data from host1 :

Code:
[root@host1 ~]# mount -a
mount.nfs: access denied by server while mounting nfs-server:/mnt/data/

Whereas the mount is OK from host2,3 and 4.

PS :For information :

  • host1…hostn can see and ping the NFS server
  • SElinux has been deactivated for tests
  • No firewall neither on server nor on client (VM are clones one from each other)

Edit:

Thanks for your responses.

strace does not show much things:

Code:
stat("/run", {st_mode=S_IFDIR|0755, st_size=960, ...}) = 0
stat("/run/mount/utab", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
getcwd("/root", 4095)                   = 6
readlink("/root/nfs-server:", 0x7ffe3a9ee090, 4096) = -1 ENOENT (No such file or directory)
readlink("/mnt", 0x7ffe3a9edf70, 4096)  = -1 EINVAL (Invalid argument)
readlink("/mnt/data", 0x7ffe3a9edf70, 4096) = -1 EINVAL (Invalid argument)
stat("/sbin/mount.nfs", {st_mode=S_IFREG|S_ISUID|0755, st_size=113400, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fd1b08f6b50) = 51633
wait4(-1, mount.nfs: access denied by server while mounting nfs-server:/mnt/data/
[{WIFEXITED(s) && WEXITSTATUS(s) == 32}], 0, NULL) = 51633
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=51633, si_status=32, si_utime=0, si_stime=0} ---
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

What I see about running services on host1 side is that no nfsv4.0-svc service is running :

Code:
[root@host1 ~]# ps -aux --forest | grep nfs
root      1199  0.0  0.0      0     0 ?        S<   Feb15   0:00  _ [nfsiod]

whereas it is running on other hosts that succeed in mounting /mnt/data

Code:
[root@host2 ~]$ ps -ef | grep nfs
root      1296     2  0 févr.15 ?     00:00:00 [nfsiod]
root      1302     2  0 févr.15 ?     00:00:00 [nfsv4.0-svc]

But I don’t know if it is a cause or a consequence (i.e. nfsv4.0-svc is running because the mount succeed…) : could it be the source of the pb ?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.