无法通过nfs挂载ubuntu18.04中的根文件系统

在uboot中设置bootargs

引导内核后通过nfs挂载网络根文件系统时出现所示错误。

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
random: nonblocking pool is initialized

经过各种试验发现是nfs服务的问题。

原因是:ubuntu18.04只支持nfs 3和nfs 4,而uboot默认使用nfs 2。

解决方法:

在ubuntu18.04的 “/etc/default/nfs-kernel-server” 文件末尾加一行,如图所示。

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

然后重启nfs服务即可。

sudo /etc/init.d/nfs-kernel-server restart

猜你喜欢

转载自www.cnblogs.com/Rainingday/p/12447463.html