目标板挂载NFS时“rpcbind: server localhost not responding, timed out”解决

本文介绍了解决目标板在广州华天正real6410开发板上使用NFS挂载时出现的错误问题。通过禁用文件锁解决了rpcbind服务响应超时导致的挂载失败。
部署运行你感兴趣的模型镜像

问题:

工作环境:VMWare 10.0.2 build 1744117,VMWare中安装Ubuntu12.04.4,Ubuntu中已配置好了nfs-kernel-server和portmap,更新了exports文件,并重启了nfs服务。

目标板使用广州华天正的real6410开发板,执行命令:

mount -t nfs 192.168.1.157:/nfsboot /mnt
得到错误信息:

[root@Real6410 /]# mount -t nfs 192.168.1.157:/nfsboot /mnt

rpcbind: server localhost not responding, timed out

RPC: failed to contact local rpcbind server (errno 5).

rpcbind: server localhost not responding, timed out

RPC: failed to contact local rpcbind server (errno 5).

rpcbind: server localhost not responding, timed out

RPC: failed to contact local rpcbind server (errno 5).

rpcbind: server localhost not responding, timed out

RPC: failed to contact local rpcbind server (errno 5).

lockd_up: makesock failed, error=-5

rpcbind: server localhost not responding, timed out

RPC: failed to contact local rpcbind server (errno 5).

rpcbind: server localhost not responding, timed out

RPC: failed to contact local rpcbind server (errno 5).

rpcbind: server localhost not responding, timed out

RPC: failed to contact local rpcbind server (errno 5).

mount: mounting 192.168.1.157:/nfsboot on /mnt failed: Input/output error

[root@Real6410 /]# 

解决办法:

1. nfs_mount默认选项包括文件锁,依赖于portmap提供的动态端口分配功能;

所以,尝试禁止文件锁试一下。

执行命令:

mount -t nfs -o nolock 192.168.1.157:/nfsboot /mnt

结果是:

[root@Real6410 /]# mount -t nfs -o nolock 192.168.1.157:/nfsboot /mnt

[root@Real6410 /]# 
没有错误提示了,说明已挂载成功。

查看一下挂载后的结果:

[root@Real6410 /]# df

Filesystem           1K-blocks      Used Available Use% Mounted on

ubi0:rootfs             949256    267108    677088  28% /

df: /mnt/sdcard: No such file or directory

tmpfs                    92500         0     92500   0% /dev/shm

192.168.1.157:/nfsboot

                      19478208   4878016  13587712  26% /mnt

[root@Real6410 /]#



您可能感兴趣的与本文相关的镜像

Dify

Dify

AI应用
Agent编排

Dify 是一款开源的大语言模型(LLM)应用开发平台,它结合了 后端即服务(Backend as a Service) 和LLMOps 的理念,让开发者能快速、高效地构建和部署生产级的生成式AI应用。 它提供了包含模型兼容支持、Prompt 编排界面、RAG 引擎、Agent 框架、工作流编排等核心技术栈,并且提供了易用的界面和API,让技术和非技术人员都能参与到AI应用的开发过程中

### NFS服务器无响应超错误解决方案 当遇到"NFS server not responding timed out"错误,通常表明客户端无法成功连接到NFS服务器。以下是可能导致此问题的原因以及相应的解决方法: #### 1. **网络连通性** 确认客户端和服务器之间的网络通信正常。可以使用`ping`命令测试两者间的连通性[^3]。 ```bash ping <server_ip> ``` 如果发现网络不通或者丢包严重,则需要排查路由器、交换机或其他网络设备设置是否存在异常。 #### 2. **防火墙配置** 检查服务器上的防火墙是否阻止了NFS端口的访问。默认情况下,NFS服务可能运行在动态分配的高编号端口上,因此建议固定这些端口号并开放相应范围内的TCP/UDP流量[^4]。 编辑 `/etc/services` 文件来指定静态rpcbind端口: ```bash rpcbind 111/tcp # Portmapper RPC service rpcbind 111/udp # Portmapper RPC service nfs 2049/tcp # Sun's Network File System (NFS) mountd 892/tcp # NFS mount daemon statd 662/tcp # Status monitor for NFS lock manager lockd 32803/tcp # Network Lock Manager ``` 接着修改 `/etc/default/nfs-kernel-server` 或者 `/etc/sysconfig/nfsserver` 配置文件中的选项以锁定特定端口号,并重启相关服务使更改生效。 对于iptables规则添加如下允许条目: ```bash iptables -A INPUT -p tcp --dport 111 -j ACCEPT iptables -A INPUT -p udp --dport 111 -j ACCEPT iptables -A INPUT -p tcp --dport 2049 -j ACCEPT iptables -A INPUT -p udp --dport 2049 -j ACCEPT iptables -A INPUT -p tcp --dport 892 -j ACCEPT iptables -A INPUT -p udp --dport 892 -j ACCEPT iptables -A INPUT -p tcp --dport 662 -j ACCEPT iptables -A INPUT -p udp --dport 662 -j ACCEPT iptables -A INPUT -p tcp --dport 32803 -j ACCEPT iptables -A INPUT -p udp --dport 32803 -j ACCEPT service iptables save ``` #### 3. **IP转发功能启用** 确保Linux系统的IPv4数据包转发已开启,这对于充当网关角色或支持跨子网共享资源至关重要。可以通过调整参数实现这一点[^5]: ```bash echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf sysctl -p ``` 另外,在某些Solaris系统里也需要手动激活此项特性[^2]: ```bash ndd -set /dev/ip ip_forwarding 1 ``` #### 4. **NFS版本兼容性和挂载选项** 尝试切换不同的协议版本(如v3 vs v4),因为不同操作系统之间可能存在不一致之处。同注意避免使用软装载(`soft`)除非绝对必要;因为它会在失败不等待重试而立即返回错误给应用程序[^6]. 正确的挂载方式示例: ```bash mount -t nfs -o vers=4,proto=tcp,noresvport,rsize=32768,wsize=32768,timeo=600,retrans=2,bg,_netdev <server>:/<exported_dir> </local_mount_point> ``` #### 5. **日志分析** 最后不要忘记查看/var/log/messages或者其他地方记录下来的诊断信息帮助定位根本原因所在[^7]。 ```bash tail -f /var/log/messages ``` ---
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值