+ -
当前位置:首页 → 问答吧 → Kernel panic ?!

Kernel panic ?!

时间:2008-04-10

来源:互联网

(更好的排版格式在:http://blog.ccidnet.com/blog-htm-do-...280649.html)

常常听到一些初次玩LFS的朋友讲:经历了千辛万苦,终于编译完了全部LFS系统,怀着激动的心情重启机器,期待着自己亲手构建的LFS顺利运行时,经常会遇到Kernel panic ——内核打出类似下面的一段话,然后死机:
VFS: Cannot open root device "sda8" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
这个问题应该怎么解决?

已我的经验,造成这个问题的原因十有八九是没有把root文件系统所在的硬盘控制器的驱动程序编译到内核中。解决的也很直接:找到硬盘控制器的型号,然后把相应的驱动程序编译到内核中。更详细的解决步骤是:
1、在构建LFS的host系统上,运行lspci命令,列出机器的硬件信息。
2、在硬件信息中,查找 IDE interface 或 SATA Controller 或 SAS Controller 等关键字,得到到硬盘控制器的型号
3、在内核配置中,把对应的驱动程序编译到内核(不能编译成模块)。对 IDE硬盘,驱动程序在Device Drivers-->ATA/ATAPI/MFM/RLL配置项下找;对于 SATA硬盘,驱动程序在Device Driver-->SCSI device support-->SCSI low-level drivers配置项下找。
4、重启机器,在LFS的新内核下,问题解决。

例子1:
我的DELL Inspiron6400 的SATA硬盘控制器问题(http://linuxman.blog.ccidnet.com/blo...226147.html)

1)用lspci命令列出硬件信息:
wyk-debian:/home/wyk# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GTT Express Memory Controller Hub (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express PCI Express Root Port (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Aud io Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (r ev 01)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (r ev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controll er #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Control ler (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (re v 01)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Con troller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X1400
03:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapte r (rev 19)
03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 01)
03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (re v 0a)
03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)
0b:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Conne ction (rev 02)

2)查找关键字,得到硬盘控制器的型号:
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Con troller (rev 01)

3)配置内核,把对应的驱动程序编译进内核:
Device Driver
|---->SCSI device support
|---->SCSI disk support
|----->verbose SCSI error reporting (不是必须的,但可方便问题定位)
|----->SCSI low-level drivers
|---->Serial ATA (SATA) support
|---->intel PIIX/ICH SATA support

4)重启机器,在LFS新内核下,问题解决。

例子2:
linuxsir 论坛上yantao123yt网友的VMware虚拟机的硬盘控制器问题(http://www.linuxsir.org/bbs/thread326405.html)

1)用lspci命令列出硬件信息:
lfslivecd:root | sat apr 5 11:17:07 2008 | /
#lspci

00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
00:07.2 USB controller: Intel Corporation 82371AB/EB/MB PIIX4 USB
00:07.3 Bidge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:0f.0 VGA Compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter
00:10.0 SICI storage controller: LSI Login / symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra 320 SCSI (rev 01)
00:11.0 Ethernet controller : Advanced Micro Devices [AMD] 79C970 [PCnet32 LANCE] (rev 10)
00:12.0 Multimedia audio controller :Ensoniq ES1371 [AudioPCI-97] (rev 02)

2)查找关键字,得到硬盘控制器的型号:
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)

3)配置内核,把对应的驱动程序编译进内核:
Device Driver
|---->DriverATA/ATAPI/MFM/RLL
|---->Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
|----->generic/default IDE chipset support
|----->PCI IDE chipset support
|---->Generic PCI IDE Chipset Support

4)重启机器,在LFS新内核下,问题解决。

作者: laowang_buaa   发布时间: 2008-04-10

依照楼主说的照做,虚拟机还是跑不起来啊

作者: x_crdjn   发布时间: 2008-04-11

我都差不多把scsi的全部的芯片种类加进去了,还是不能启动

作者: beyond1314   发布时间: 2008-04-13

内核里面选上自己机子上能pci到的设备的驱动就够了,别选多了

作者: sspipipipi   发布时间: 2008-04-14

多选了也没事吧

作者: beyond1314   发布时间: 2008-04-14

一般都没事的,就算是全选了。~~

作者: 晨想   发布时间: 2008-04-14

感激楼主~~~~~~~~~~
在我最崩溃的时候给了我希望.版本不同,有些选项还是不大一样的,最后成功拉,
lfs成功了.心情自然好开心.谢谢!!

作者: archer_z   发布时间: 2008-12-18

用虚拟机搞LFS,应该挺累的吧

作者: think365   发布时间: 2008-12-21

热门下载

更多