大学生
最后登录1970-1-1
在线时间 小时
注册时间2017-3-19
|
5火花
本帖最后由 我是520老谢 于 2019-11-10 13:14 编辑
linux开发板挂接网络根文件系统失败:电脑端linux:主机ip地址: 192.168.1.101
linux开发板ip地址:
1、可以挂接根文件系统
2、可以在根文件系统中挂接网络文件系统
3、无法使用网络根文件系统
内核信息
Image Name: Linux-5.2.11
Created: 2019-11-03 2:22:50 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3136256 Bytes = 3 MiB
Load Address: 30108000
Entry Point: 30108000
Verifying Checksum ... OK
Loading Kernel Image ... OK
情况如下:
1、使用u-boot正常进入内核之后,之前有使用的根文件系统
1.1、文件系统可以正常ping通主机,不过需要先设置eth0
VFS: Mounted root (yaffs filesystem) on device 31:3.
Freeing unused kernel memory: 204K
This architecture does not have kernel memory protection.
Run /linuxrc as init process
init started: BusyBox v1.7.0 (2019-08-25 20:21:29 CST)
starting pid 43, tty '': '/etc/init.d/rcS'
random: fast init done
mount: mounting ztmpfs on /tmp failed: No such file or directory
/etc/init.d/rcS: line 9: cannot create /proc/sys/kernel/hotplug: nonexistent directory
Please press Enter to activate this console.
starting pid 48, tty '': '/bin/sh'
#
#
2、配置eth0
# ifconfig eth0 192.168.1.51
dm9000 dm9000 eth0: link down
# dm9000 dm9000 eth0: link down
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
dm9000 dm9000 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
3、ping通主机
linux电脑端主机IP:192.168.1.101
ping 192.168.1.101
PING 192.168.1.101 (192.168.1.101): 56 data bytes
64 bytes from 192.168.1.101: seq=0 ttl=64 time=1.874 ms
64 bytes from 192.168.1.101: seq=1 ttl=64 time=1.652 ms
64 bytes from 192.168.1.101: seq=2 ttl=64 time=1.276 ms
3、可以在根文件系统下挂接网络文件系统:
# mount -t nfs -o nolock 192.168.1.101:/home/sambaShare/rootfs/busybox/fs_zdyz_rootfs /mnt
#
# cd /mnt/
# ls
bin lib mnt root sys usr
dev linuxrc proc sbin tmp
#
4、如果在u-boot中设置参数,
setenv bootargs 'root=/dev/nfs rw nfsroot=192.168.1.101:/home/sambaShare/rootfs/busybox/fs_zdyz_rootfs ip=192.168.1.51:192.168.1.101:192.168.1.1:255.255.255.0::eth0ff console=ttySAC0'
5、启动内核: 显示信息如下
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
Loading compiled-in X.509 certificates
hctosys: unable to open rtc device (rtc0)
dm9000 dm9000 eth0: link down
dm9000 dm9000 eth0: link down
random: fast init done
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
IP-Config: Complete:
device=eth0, hwaddr=c2:89:c9:94:a2:7b, ipaddr=192.168.1.51, mask=255.255.255.0, gw=192.168.1.1
host=192.168.1.51, domain=, nis-domain=(none)
bootserver=192.168.1.101, rootserver=192.168.1.101, rootpath=
dm9000 dm9000 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
之后就是一些错误信息,无法挂接到网络文件系统。
5.1、能在有根文件系统下面挂接网络文件系统
5.2、无法在u-boot中设置默认根文件系统参数,设置根文件系统为网络文件系统。
6、有坛友知道这个异常的原因吗?
异常信息:
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
IP-Config: Complete:
device=eth0, hwaddr=c2:89:c9:94:a2:7b, ipaddr=192.168.1.51, mask=255.255.255.0, gw=192.168.1.1
host=192.168.1.51, domain=, nis-domain=(none)
bootserver=192.168.1.101, rootserver=192.168.1.101, rootpath=
dm9000 dm9000 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
0100 4096 ram0
(driver?)
0101 4096 ram1
(driver?)
0102 4096 ram2
(driver?)
0103 4096 ram3
(driver?)
0104 4096 ram4
(driver?)
0105 4096 ram5
(driver?)
0106 4096 ram6
(driver?)
0107 4096 ram7
(driver?)
0108 4096 ram8
(driver?)
0109 4096 ram9
(driver?)
010a 4096 ram10
(driver?)
010b 4096 ram11
(driver?)
010c 4096 ram12
(driver?)
010d 4096 ram13
(driver?)
010e 4096 ram14
(driver?)
010f 4096 ram15
(driver?)
1f00 512 mtdblock0
(driver?)
1f01 128 mtdblock1
(driver?)
1f02 16384 mtdblock2
(driver?)
1f03 245120 mtdblock3
(driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
CPU: 0 PID: 1 Comm: swapper Not tainted 5.2.11 #7
Hardware name: SMDK2440
Backtrace:
[<c0118ae4>] (dump_backtrace) from [<c0118d94>] (show_stack+0x18/0x1c)
r6:c0638ea8 r5:00000000 r4:c071f499
[<c0118d7c>] (show_stack) from [<c05806f0>] (dump_stack+0x20/0x28)
[<c05806d0>] (dump_stack) from [<c0124c94>] (panic+0xe4/0x2dc)
[<c0124bb4>] (panic) from [<c06b4348>] (mount_block_root+0x1c4/0x2b8)
r3:5323b251 r2:5323b251 r1:c3821ec0 r0:c0638ea8
r7:c309b000
[<c06b4184>] (mount_block_root) from [<c06b4698>] (mount_root+0x10c/0x138)
r10:00000097 r9:c06da838 r8:000003e8 r7:00000000 r6:0000001e r5:c06eb928
r4:00000000
[<c06b458c>] (mount_root) from [<c06b482c>] (prepare_namespace+0x168/0x1b8)
r8:00000000 r7:c06da830 r6:c06da858 r5:c06da858 r4:c071ef0c
[<c06b46c4>] (prepare_namespace) from [<c06b3f58>] (kernel_init_freeable+0x17c/0x1c0)
r6:c071eee0 r5:00000008 r4:c071eee0
[<c06b3ddc>] (kernel_init_freeable) from [<c059d664>] (kernel_init+0x10/0xfc)
r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c059d654
r4:00000000
[<c059d654>] (kernel_init) from [<c01090e0>] (ret_from_fork+0x14/0x34)
Exception stack(0xc3821fb0 to 0xc3821ff8)
1fa0: 00000000 00000000 00000000 00000000
1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
r4:00000000
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) ]--- |
|
最佳答案
查看完整内容
可以参考一下我们的笔记
[mw_shl_code=html,true]通过Uboot挂载网络文件系统、内核和设备树
以NXP官方提供的文件系统为例,介绍如何通过uboot来挂载虚拟机上的文件系统。
命令:
setenv ipaddr 192.168.0.209;setenv ethaddr 08:00:00:00:22:02;setenv serverip 192.168.0.169;setenv gatewayip 192.168.0.1;setenv netmask 255.255.255.0;
setenv bootargs "console={console},console,{baudrate} root=/dev/nfs ip={ipaddr}:ip ...
|