转载于:https://blog.youkuaiyun.com/STL1634614466/article/details/105130813/
VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6 NFS挂载不上,内核配置问题
确认host端的nfs支持的版本,使用命令nfsstat查看
root@Silence:/opt/nfsboot# nfsstat -v
Server packet stats:
packets udp tcp tcpconn
3 3 0 0
Server rpc stats:
calls badcalls badfmt badauth badclnt
0 3 3 0 0
Server reply cache:
hits misses nocache
0 0 0
Server io stats:
read write
0 0
Server read ahead cache:
size 0-10% 10-20% 20-30% 30-40% 40-50% 50-60% 60-70% 70-80% 80-90% 90-100% notfound
32 0 0 0 0 0 0 0 0 0 0 0
Server file handle cache:
lookup anon ncachedir ncachenondir stale
0 0 0 0 0
在给内核传参中指定 setenv bootargs root=/dev/nfs rw nfsroot=192.168.1.141:/opt/nfsboot,v3 ip=192.168.1.10:192.168.1.141:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC2,115200
加上这个v3之后就可以了。原因应该是我使用linux版本是ubuntu 18.04,nfs版本的问题。具体的原因还需要后面去找。