Skip to main content

Solution to application development failure to mount via nfs mount.nfs: Connection timed out


Solution to application development failure to mount via nfs


Problem Description

Error mount.nfs: Connection timed out when mounting directory

root@ATK-IMX6U:~# mount -t nfs -o nolock,nfsvers=3 192.168.10.100:/home/alientek/linux/nfs get/
mount.nfs: Connection timed out

Cause Analysis:

This error may be caused by a network connection timeout. You can try the following methods to resolve this issue:

1.Check whether the NFS service is enabled on the target host.

2.Check whether the network connection between the target host and the development board is normal.

3.Make sure that the target host and development board are in the same LAN.

4.Check your firewall settings to make sure the NFS port is not blocked.

solution:

The target host and development board are not in the same LAN .

Cause analysis

When developing applications on the Zhengdian Atom development board, the IP address of the development board is dynamic. We need to change it to static.

The following is the modified one:

Specific operations

Operate under the development board terminal:

modify the network configuration file

vi /etc/network/interfaces

Delete the part that sets network port eth0 as dynamic

and add the part that sets eth0 as static.

auto eth0 iface eth0 inet static
address 192.168.10.101
gateway 192.168.10.2
netmask 255.255.255.0
#network 192.168.10.225
#broadcast 192.168.10.255

Reload network configuration file

/etc/init.d/networking force-reload

Restart network service

/etc/init.d/networking restart

Check whether the modification is successful

ifconfig

Now that the development board and the virtual machine are on the same LAN, remount them.

mount -t nfs -o nolock,nfsvers=3 192.168.10.100:/home/alientek/linux/nfs get/

Mounted successfully