0 前言
使用Ubuntu 18.04的NFS服务器存放开发板的根文件系统,开发板无法正常挂载根文件系统。如下所示:
提示挂载失败。
根本原因是Ubuntu 18.04默认只支持nfs V3、V4,而uboot默认使用nfs V2。
1 开发板无法挂载Ubuntu 18.04的NFS服务器文件系统解决方法
输入如下命令:
sudo vi /etc/default/nfs-kernel-server
修改nfs-kernel-server文件为如下内容:
# 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="-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"
保存退出。
输入命令重启Ubuntu的NFS服务器即可:
sudo /etc/init.d/nfs-kernel-server restart
接着重启开发板,能够正常加载根文件系统了: