Ubuntu18.04挂载nfs失败....

VFS: Unable to mount root fs via NFS, trying floppy.
内核 配置 和传参都检测了很多遍 没查出问题
我去,搞了一晚上… 做开发千万别随意升级系统

Ubuntu 18.04 nfs 默认为协议3和协议4,但是 我的uboot 默认启动的是协议2的形式
如:  /srv/homes    hostname1(rw,sync,no_subtree_check)
若想要求 nfs 支持协议2,就在/etc/default/nfs-kernel-server末尾加一句:
RPCNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"

-----------------------------------------------------------------
# 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=""

RPCNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"

然后重启nfs /etc/init.d/nfs-kernel-server restart

果然可以了 踩了个坑啊 ,记录一下,要不又忘了.

你可能感兴趣的:(嵌入式linux)