应用开发通过nfs来mount失败解决办法mount.nfs: Connection timed out

简介: 应用开发通过nfs来mount失败解决办法mount.nfs: Connection timed out

问题描述

mount挂载目录时报错mount.nfs: Connection timed out

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

原因分析:

这个错误可能是由于网络连接超时导致的。可以尝试以下方法解决此问题:

  1. 检查目标主机是否开启了NFS服务。
  2. 检查目标主机和开发板之间的网络连接是否正常。
  3. 确保目标主机和开发板都在同一局域网内。
  4. 检查防火墙设置,确保NFS端口未被阻止。

解决方案:

目标主机和开发板没有在同一局域网内。

造成原因分析

正点原子开发板应用开发时开发板的ip地址是动态的,我们需要将其改为静态的

下面是修改过后的:

具体操作

在开发板终端下操作:

修改网络配置文件

vi /etc/network/interfaces

删除设置网口eth0为动态部分

加上设置eth0为静态部分

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

重新加载网络配置文件

/etc/init.d/networking force-reload

重新启动网络服务

/etc/init.d/networking restart

查看是否修改成功

ifconfig

现在开发板与虚拟机已经在一个局域网下了,重新挂载

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

成功挂载


目录
相关文章
|
8天前
|
Unix Linux 文件存储
文件传输、文件挂载MOUNT:NFS、CIFS、ADB、SAMBA
文件传输、文件挂载MOUNT:NFS、CIFS、ADB、SAMBA
86 0
|
7月前
nfs之mount.nfs: Stale file handle
nfs之mount.nfs: Stale file handle
102 0
|
网络协议 Linux 网络安全
AnolisOS8.6做NFS服务端,挂载失败 mount: RPC: Unable to receive; errno = Connection refused
anolis8.6安装nfs服务端,在显示共享目录时,始终报错
|
存储 缓存 文件存储
NFS Hard Mount Vs Soft Mount
本章节将详细分析和对比NFS挂载参数的优劣,在使用NFS可根据业务情况做出最佳选择。
5909 0
|
网络协议 Linux 开发工具
NFS启动时报错Linux NFS:could not open connection for tcp6
1.1 启动时出现的错误 [root@znix ~]#/etc/init.d/nfs startShutting down NFS daemon:                                 [  OK  ]Shutting down NFS mountd:       ...
1608 0