Chinaunix首页 | 论坛 | 博客
  • 博客访问: 64989
  • 博文数量: 28
  • 博客积分: 230
  • 博客等级: 二等列兵
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-01 09:44
文章分类

全部博文(28)

文章存档

2016年(1)

2015年(2)

2014年(11)

2013年(7)

2012年(7)

我的朋友

分类: LINUX

2014-06-26 08:54:27




前两天编译内核,发现启动flash上的文件系统,启动不起来,但使用ramdisk (/dev/ram) 则可以正常启动,并且U盘可以正常挂载,说明文件系统是ok的,那么问题出在哪里了呢? 
参考:http://askubuntu.com/questions/71332/kernel-panics-with-cannot-open-root-device-error-where-do-i-append-the-root

VFS: Cannot open root device "sda1" or unknown block (0,0) Please append a correct "root=" boot option;


Following is the excerpt from a by :

Most likely one of the most occurring issue (but once you solved it, you most likely are never going to see it again):

Unable to mount root fs on unknown-block(0,0) 

or

VFS: Cannot open root device "sda3" or unknown-block(8,3)
Please append a correct "root=" boot option; here are the available partitions:
  sda driver: sd
    sda1 sda2 

The digits 0,0 or 8,3 can be different in your case - it refers to the device that the kernel tries to access (and which fails). Generally speaking one can say that, if the first digit is 0, then the kernel is unable to identify the hardware. If it is another digit (like 8), it is unable to identify the file system (but is able to access the hardware).

The problem here is that the kernel that you are booting cannot translate the root=/dev/... parameter you gave it (inside the boot loader configuration) into a real, accessible file system. Several reasons can result in such a failure:

  • the kernel configuration is missing drivers for your HDD controller (cases 1, 4, 5)
  • the kernel configuration is missing drivers for the bus used by your HDD controller
  • the kernel configuration is missing drivers for the file system you are using
  • the device is misidentified in your root= parameter (cases 2, 3)

Resolving the issue is easy if you know what the reason is. You most likely don't, so here's a quick check-up.

Open the kernel configuration wizard (the make menuconfig part) so that you can update the kernel configuration accordingly.

  • Check if you have built in (and not as a module) support for the bus / protocol that your harddisk controller uses.
  • Most likely this is PCI support, SATA support (which is beneath SCSI device support), ...
  • Check if you have built in (and not as a module) support for the HDD controller you use. One of the most frequent cases: you selected support for your harddisk controller protocol (IDE, SATA, SCSI, ...) but forgot to
    select the HDD controller driver itself (like Intel PIIX). Try
    running the following lscpi command, and paste its output on
    . The site will show you which kernel drivers you need to select for your system. Within the menuconfig,
    you can type "/" to open the search function, and type in the driver
    name to find out where it resides. # lspci -n
  • Check if you have built in (and not as a module) support for the file system(s) you use.
  • Say your root file system uses btrfs (which I definitely don't recommend) but you didn't select it, or selected it to be built as a
    module, then you'll get the error you see. Make sure the file system
    support is built in the kernel.
  • Check if the kernel parameter for root= is pointing to the correct partition.

    This isn't as stupid as it sounds. When you are booted with one kernel, it might list your disks as being /dev/sda whereas your (configured) kernel is expecting it to be /dev/hda. This is not because kernels are inconsistent with each other, but because of the drivers used: older drivers use the hda syntax, newer sda.

    Try switching hda with sda (and hdb with sdb, and ...).

    Also, recent kernels give an overview of the partitions they found on the device told. If it does, it might help you identify if you misselected a partition (in the example given at the beginning of this section, only two partitions are found whereas the kernel was instructed to boot the third). If it doesn't, it is most likely because the kernel doesn't know the device to begin with (so it can't attempt to display partitions).

  • Check if the kernel that is being boot by the boot loader is the correct kernel. I have seen people who, after building a first kernel (which doesn't boot), forget that they have to mount /boot before the overwrite the kernel with a new one. As a result, they copy the kernel to the root file system (/) whereas the boot loader still expects the kernel image to be on the /boot partition.


看到了吧, 如果是 unknown-block(0,0) ,说明没有识别硬件,那么很有可能是硬件驱动出问题了.

查看/dev/sda* , /dev/sdb*, 发现根本没有相应的设备文件,那么是否驱动没有识别设备呢?
检查一下,lspci,发现pci识别了硬件为:
0000:00:10.0 Mass storage controller: Silicon Image, Inc. SiI 3114 [SATALink/SATARaid] Serial ATA Controller (rev 02)
检查内核配置,发现果然没有编译Silicon Mass storage的驱动,在内核配置中增加该驱动,启动,OK!
.config中增加:  CONFIG_SATA_SIL=y



阅读(1355) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~