PDA

View Full Version : NFS mount fails "reason by server: No such file or directory" , but dir exists!


thrombomodulin
2007-08-25, 07:17 PM CDT
Hello,

On Fedora 7, I attempted to setup NFS4 between two hosts which didn't work. So, I tried to use NFS with server and client on the same host. I followed the instructions at this address quite exactly.

http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration

I suspect the example mount command given there might have left off ":/export", so I tried it both ways. Regardless, the same error always occurs. Thanks in advance for any help.

Regards,
Pete

P.S. SELinux is in permissive mode.


[root@homepc ~]# mkdir /export
[root@homepc ~]# chmod a+rwxt /export
[root@homepc ~]# echo test > /export/testfile.txt
[root@homepc ~]# cat /etc/exports
/export 127.0.0.1(ro) 192.168.1.2(ro) 192.168.1.3(ro)
[root@homepc ~]# /usr/sbin/exportfs -ra
[root@homepc ~]# mkdir /mnt/nfs4
[root@homepc ~]# mount -t nfs4 127.0.0.1:/ /mnt/nfs4
mount.nfs4: 127.0.0.1:/ failed, reason given by server: No such file or directory
[root@homepc ~]# mount -t nfs4 127.0.0.1:/export /mnt/nfs4
mount.nfs4: 127.0.0.1:/export failed, reason given by server: No such file or directory
[root@homepc ~]# /sbin/service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@homepc ~]# mount -t nfs4 127.0.0.1:/ /mnt/nfs4
mount.nfs4: 127.0.0.1:/ failed, reason given by server: No such file or directory
[root@homepc ~]# mount -t nfs4 127.0.0.1:/export /mnt/nfs4
mount.nfs4: 127.0.0.1:/export failed, reason given by server: No such file or directory
[root@homepc ~]# /sbin/service nfs restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@homepc ~]# mount -t nfs4 127.0.0.1:/ /mnt/nfs4
mount.nfs4: 127.0.0.1:/ failed, reason given by server: No such file or directory
[root@homepc ~]# mount -t nfs4 127.0.0.1:/export /mnt/nfs4
mount.nfs4: 127.0.0.1:/export failed, reason given by server: No such file or directory
[root@homepc ~]# ls -o /export
total 8
-rw-r--r-- 1 root 5 Aug 25 21:02 testfile.txt
[root@homepc ~]# cat /etc/hosts.allow
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
portmap: 127.0.0.1, 192.168.1.2, 192.168.1.3
mountd: 127.0.0.1, 192.168.1.2, 192.168.1.3
rquotad: 127.0.0.1, 192.168.1.2, 192.168.1.3
statd: 127.0.0.1, 192.168.1.2, 192.168.1.3
[root@homepc ~]#

ppesci
2007-08-25, 07:27 PM CDT
I think /etc/exports must contain something like:

/export 127.0.0.1(ro) 192.168.1.2(ro) 192.168.1.3(ro)

HTH

thrombomodulin
2007-08-25, 07:38 PM CDT
I think my /etc/exports file is identical already to what you suggest I should change it to. Thanks, Pete

prabhat3107
2007-10-11, 04:10 AM CDT
Hi thrombomodulin,

I am too facing the same problem.

found the following link suggesting a solution, however my initial attempts to configure it is failed.
I am still searching for the cause and solutions.

http://fedorasolved.org/post-install-solutions/nfsv4-fedora

stevea
2007-10-11, 11:31 AM CDT
What does "exportfs" report is shared ?

thrombomodulin
2007-10-11, 05:01 PM CDT
Prabhat3107,

I found this links also. I followed the instructions exactly. NFS4 now works between my two Fedora 7 machines.

Thrombomodulin

prabhat3107
2007-10-11, 10:24 PM CDT
Hi,
I could suceed in configuring nfsv4 server.

the importent thing with nfsv4 server is you need to put fsid=0 option with the exports.
for example: (in /etc/exports)
/home/data *(ro,fsid=0)

if you do not use fsid=0 option you will get the
"mount.nfs4: 127.0.0.1:/export failed, reason given by server: No such file or directory "
error

refer the manual page
# man 5 exports

which say that
The value 0 has a special meaning when use with NFSv4. NFSv4
has a concept of a root of the overall exported filesystem. The
export point exported with fsid=0 will be used as this root.



If I have to make a correction in the /etc/exports file you have posted it would be as bellow
[root@homepc ~]# cat /etc/exports
/export 127.0.0.1(ro,fsid=0) 192.168.1.2(ro,fsid=0) 192.168.1.3(ro,fsid=0)

and while mounting the nfs share observer the folliwing

# mount -t nfs4 <serverip>:/ /mount/point

not mount -t nfs4 <serverip>:/exports /mount/point