NFS 服务器启动失败

报错信息

server ip 和 板子 ip 都正确情况下,发生ERROR:File lookup fail,也就是查找文件失败。那我们该如何解决呢?

image-20210306135616482

这是由于我们 uboot 中使用的 NFS 版本为 V2 版本,而 Ubuntu 使用的是 V3V4以上版本,从而导致板子无法找到 NFS 服务器当中的文件。

解决办法

让 Ubuntu 兼容 V2版本,也就是修改 /etc/default/nfs-kernel-server 文件。这是原来的文件内容:

# Number of servers to start up
RPCNFSDCOUNT=8

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information, 
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
RPCMOUNTDOPTS="--manage-gids"

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=""
  • 修改后的内容:
# Number of servers to start up
# RPCNFSDCOUNT=8
RPCNFSDCOUNT="-V 2 8"

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information, 
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
# RPCMOUNTDOPTS="--manage-gids"
RPCMOUNTDOPTS="-V 2 --manage-gids"

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS="--nfs-version 2,3,4 --debug --syslog"
  • 保存退出。重启 NFS 服务:
sudo service nfs-kernel-server restart

结果

image-20210306140950478

猜你喜欢

转载自blog.csdn.net/qq_43125185/article/details/114439791