像这样,我的服务器端配置是/etc/exports 中的 /lenge/gnu/aarch64_sysroot_nfs 192.168.137.8(rw,sync,no_subtree_check)
。
[ 4.995341] Root-NFS: nfsroot=/lenge/gnu/aarch64_sysroot_nfs
[ 4.999167] NFS: nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,nolock,addr=192.168.137.188'
[ 5.001094] NFS: parsing nfs mount option 'vers=2'
[ 5.002329] NFS: parsing nfs mount option 'udp'
[ 5.002843] NFS: parsing nfs mount option 'rsize=4096'
[ 5.004294] NFS: parsing nfs mount option 'wsize=4096'
[ 5.004996] NFS: parsing nfs mount option 'nolock'
[ 5.005533] NFS: parsing nfs mount option 'addr=192.168.137.188'
[ 5.008949] NFS: MNTPATH: '/lenge/gnu/aarch64_sysroot_nfs'
[ 5.010838] NFS: sending MNT request for 192.168.137.188:/lenge/gnu/aarch64_sysroot_nfs
[ 5.138789] NFS: MNT request succeeded
[ 5.139382] NFS: Faking up auth_flavs list
[ 5.144674] NFS: attempting to use auth flavor 1
[ 10.357008] NFS: nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,nolock,addr=192.168.137.188'
[ 10.357996] NFS: parsing nfs mount option 'vers=2'
[ 10.358620] NFS: parsing nfs mount option 'udp'
[ 10.359131] NFS: parsing nfs mount option 'rsize=4096'
[ 10.359734] NFS: parsing nfs mount option 'wsize=4096'
[ 10.360856] NFS: parsing nfs mount option 'nolock'
[ 10.361537] NFS: parsing nfs mount option 'addr=192.168.137.188'
[ 10.362440] NFS: MNTPATH: '/lenge/gnu/aarch64_sysroot_nfs'
[ 10.363178] NFS: sending MNT request for 192.168.137.188:/lenge/gnu/aarch64_sysroot_nfs
[ 10.377199] NFS: MNT request succeeded
[ 10.377666] NFS: Faking up auth_flavs list
[ 10.378161] NFS: attempting to use auth flavor 1
那么,问题出在哪里?
最佳答案
我也遇到这个问题了。我的/etc/exports 看起来像你的,但我的问题出在我的 uEnv.txt 上,特别是我如何告诉内核通过 NFS 挂载 rootfs。请参阅我总结问题和解决方案的图片。
在 nfsroot.txt 的第 2 节中 BeagleBoneBlack 的内核文档指出 NFS 设备及其定位位置需要通过以下方式传递给内核:
root=/dev/nfs
This is necessary to enable the pseudo-NFS-device. Note that it's not a real device but just a synonym to tell the kernel to use NFS instead of a real device.
nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
If the `nfsroot' parameter is NOT given on the command line, the default "/tftpboot/%s" will be used.
Specifies the IP address of the NFS server. The default address is determined by the `ip' parameter (see below). This parameter allows the use of different servers for IP autoconfiguration and NFS.
Name of the directory on the server to mount as root. If there is a "%s" token in the string, it will be replaced by the ASCII-representation of the client's IP address.
Standard NFS options. All options are separated by commas. The following defaults are used: port = as given by server portmap daemon rsize = 4096 wsize = 4096 timeo = 7 retrans = 3 acregmin = 3 acregmax = 60 acdirmin = 30 acdirmax = 60 flags = hard, nointr, noposix, cto, ac
我确实按照 @Sam Protsenko 的建议将 nfsvers=3 添加到我的 nfs-options 中,但我不确定是否单独这样做或与提到的更改相结合是导致内核挂载 rootfs 的原因。
在我原来的 uEnv.txt 中,“rootwait”和“rootdelay=5”似乎已被弃用。 NFS 报告在尝试解析时无法识别这些参数,因此我在更新的 uEnv.txt 中删除了它们。
找到here
关于linux-kernel - NFS挂载超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51372644/