mount.nfs: Connection timed out on ubuntu 14.04.1 LTS

surajitM picture surajitM · Aug 29, 2017 · Viewed 18.2k times · Source

I trying to create a nfs server for the first time. On trying to mount to the server I am getting an error "mount.nfs: Connection timed out". My server version is ubuntu 14.04.5 LTS while my client is ubuntu 14.04.1 LTS. Following are the step that I have performed.

On Server Side:

# vi /etc/exports

/home/nfs           192.168.13.81(rw,async,no_root_squash)

# sudo service nfs-kernel-server restart

# sudo exportfs -u

/home/nfs       192.168.13.81

On Client Side:

# sudo mount 192.168.13.80:/home/nfs /home/nfs

mount.nfs: Connection timed out

on trying,

#sudo mount -t nfs4 -o proto=tcp,port=2049 192.168.13.80:/home/nfs /home/nfs

mount.nfs4: mounting 192.168.13.80:/home/nfs failed, reason given by server: No such file or directory

"# rpcinfo -p" gives:

program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  39340  status
    100024    1   tcp  49970  status
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    2   tcp   2049
    100227    3   tcp   2049
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs

I am not sure what or how else to try. Please help. Any help would be highly appreciated. Thanks.

Answer

αғsнιη picture αғsнιη · Sep 25, 2017

Not required restart nfs service. After you add below in /etc/exports

/home/nfs           192.168.13.81(rw,async,no_root_squash)

Just re-export the NFS directories:

exportfs -ra

Then use nfs4 to mount it.

mount -t nfs4 192.168.13.80:/home/nfs /home/nfs

You may also want to check if client has NFS access to server by the following command.

rpcinfo -p 192.168.13.80

You will get result if client has access, with lines as portmapper, nfs, mountd, nlockmgr, nfs_acl and rquotad.