VFS: Cannot open root device \"%s\"(A) or %s(B): error %d(C)\n"
Please append a correct \"root=\" boot option; here are the available partitions:\n
VFS: Unable to mount root fs on %s(D)
以上是 init/do_mounts.c 文件中的 函数mount_block_root 做的打印
表示 利用所有的文件系统 调用 do_mount_root 对 一个分区(通过是您指定的) 进行了挂载,但是还是挂载失败
上面的信息就是打印出来的帮助您定位错误的信息
内核会针对不同的情况对 A B C D 进行填充
A : 如果您指定的是 root=/dev/hda2 ,那么 A 为 "/dev/" 后面的 hda2
如果您指定的是 root=/xxx/hda2(前五个字节不为"/dev/"),那么 A 为 /xxx/hda2
B : 根据您指定的 root=/dev/hda2 , 根据ROOT_DEV =name_to_dev_t(root_device_name); 算出来的设备号,从而算出来的主次设备号,格式 为 unknown-block(主设备号,次设备号)
C : do_mount_root 的返回值,返回值的定义在 内核代码中的 include/uapi/asm-generic/errno-base.h
D : 和B一样
实例
1
VFS: Cannot open root device "mmcblk0p1" or unknown-block(179,1): error -19
Please append a correct "root=" boot option; here are the available partitions:----------------------------------------------------------------
A为 mmcblk0p1
B为 unknown-block(179,1)
C为 19
A的格式是对的,mmc设备的分区名请参考 Documentation/block/cmdline-partition.txt
B表示 已经找到了mmc设备的驱动, 因为主次设备已经出来了,且是对的. 请参考 Documentation/devices.txt
C为19 表示 #define ENODEV 19/* No such device */
这个问题的结论是
1.有驱动
2.可查磁盘名级分区名是否正确
3.可查对应的文件系统
2
VFS: Cannot open root device "mtdblock5" or unknown-block(0,0): error -6----------------------------------------------------------------
A为 mtdblock5
B为 unknown-block(0,0)
C为 -6
A的格式是对的
B 0= reserved as null device number ,表示没找到该设分区的设备号,驱动可能有问题
C -6 #define ENXIO 6/* No such device or address */
这个问题的结论是
1.查驱动是否存在
2.可查磁盘名级分区名是否正确
3.可查对应的文件系统
3
VFS: Cannot open root device "nfs" or unknown-block(0,255)----------------------------------------------------------------
内核中nfs设置不对,必须包括如下配置
CONFIG_INET=y
CONFIG_IP_PNP=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
同时注意配置 的 nfs 的版本,要和服务器上的nfs版本(nfsstat 可查到)匹配
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
-------------
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
b300 31205376 mmcblk0 driver: mmcblk
b301 529121 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1
b302 30410758 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
通过 指定nfs版本解决 : nfsroot=192.168.1.250:/home/rootfs,proto=tcp,nfsvers=3-----------------------
VFS: Unable to mount root fs via NFS, trying floppy.
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)[<c0039ca8>](unwind_backtrace+0x0/0xfc) from [<c04cf028>](dump_stack+0x18/0x1c)[<c04cf028>](dump_stack+0x18/0x1c) from [<c04cf08c>](panic+0x60/0x1ac)[<c04cf08c>](panic+0x60/0x1ac) from [<c0008fd0>](mount_block_root+0x204/0x25c)[<c0008fd0>](mount_block_root+0x204/0x25c) from [<c00090b0>](mount_root+0x88/0xd0)[<c00090b0>](mount_root+0x88/0xd0) from [<c0009204>](prepare_namespace+0x10c/0x1a8)[<c0009204>](prepare_namespace+0x10c/0x1a8) from [<c00084c4>](kernel_init+0xf0/0x130)[<c00084c4>](kernel_init+0xf0/0x130) from [<c0034a34>](kernel_thread_exit+0x0/0x8)
没有网卡驱动
4
No filesystem could mount root, tried: ext3 ext2 cramfs vfat msdos iso9660 romfs
kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)---------------------------
磁盘分区被格式化为xxx文件系统,内核镜像无该xxx文件系统的支持
挂载不上 , 内核给的提示
一般挂载不上的话,会有打印 here are the available partitions:
然后在下面打印如下
Please append a correct "root=" boot option; here are the available partitions:030016777216 hda driver: ide-disk
0301499873 hda1
030216277152 hda2
16004194302 hdc driver: ide-cdrom
08002097152 sda driver: sd
08012096451 sda1
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)-----------------
以下为注释
0300(十六进制数)16777216(有多少个磁盘扇区)hda(磁盘名)driver(所用的驱动): ide-disk
0301(十六进制数)499873(有多少个扇区)hda1(分区名)030216277152 hda2
16004194302 hdc driver: ide-cdrom
08002097152 sda driver: sd
08012096451 sda1
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
理论VFS: Cannot open root device \"%s\"(A) or %s(B): error %d(C)\n"Please append a correct \"root=\" boot option; here are the available partitions:\nVFS: Unable to mount root fs on %s(D)init/do_mounts.c mount_block_root表示 利用所有的文件系统 调用 do_mount_roo