LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2229|回复: 3

昨天周末自己搞了个mini启动盘,可以总是在加载vfs出错,请指教!

[复制链接]
发表于 2008-11-24 08:55:44 | 显示全部楼层 |阅读模式
昨天周末自己搞了个mini启动盘,可以总是在加载vfs出错,请指教!

估计是内核的配置问题,我不知道在那一项没选,请高人给点意见!



多谢关注!
发表于 2009-1-15 13:59:40 | 显示全部楼层
我以前安装也碰到过这个问题,总结起来就是以下几点。是简单的英文,我就不译了。


kernel panic VFS: Unable to mount root fs 总结收藏


Fix your kernel boot parameters.

Make sure your kernel has a "root=" parameter passed to it in your bootloader and that the

parameter points to your root file system. For example, my root file system is on

/dev/hde2. My grub.conf contains:
Code:
kernel (hd0,0)/boot/bzImage-2.6.1-rc2-gentoo-1 root=/dev/hde2

If you use LILO, then your lilo.conf should contain something analogous to:
Code:
image=/boot/bzImage-2.6.1-rc2-gentoo-1
root=/dev/hde2

Remember to rerun lilo after editing lilo.conf!

If you don't know which partition is your root, then check /etc/fstab and look for the

entry for / :
Code:
/dev/hde2 / reiserfs noatime 1 2


Ensure the proper options and drivers are built into the kernel.

Don't forget to mount /boot when installing a new kernel!

devfs support
You need devfs support built in and mounted at boot time. In the 2.6 kernel, these are

listed as:
Code:
File systems
-> Pseudo file systems
-> /dev file system support (OBSOLETE) DEVFS_FS
-> Automatically mount at boot DEVFS_MOUNT

In the 2.4 kernel, they are:
Code:
File systems
-> /dev file system support (EXPERIMENTAL)
Automatically mount at boot


File system support
You need support for your root file system built in (not built as a module). My root file

system is Reiser. So I have reiserfs built into my kernel. If you are unsure what your

root file system is, check /etc/fstab.


Drive controller support
You need supoort for your drive controller built into the kernel. If you are unsure what

to build, check with `lspci', part of the sys-apps/pciutils package. If all else fails,

build them all and use the process of elimination.

IDE
Make sure you have support for your IDE chipset compiled in. In the 2.6 kernel, these can

be found in
Code:
Device Drivers
-> ATA/ATAPI/MFM/RLL support
-> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
-> PCI IDE chipset support
-> Generic PCI bus-master DMA support

For the 2.4 kernel, they are in
Code:
ATA/IDE/MFM/RLL support
-> IDE, ATA and ATAPI Block devices
-> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
-> Generic PCI IDE chipset support

You also need "Include IDE/ATA-2 DISK support" built in. This can be found in the

"Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support" branch of the kernel configuration

menu.

SCSI
Make sure you have support for your SCSI device compiled in. In the 2.6 kernel,
Code:
Device drivers
-> SCSI device support
-> SCSI low-level drivers

In the 2.4 kernel,
Code:
SCSI support
-> SCSI low-level drivers

You also need "SCSI disk support" built in. This can be found in the "SCSI [device]

support" branch of the kernel configuration menu.


Partition selection support
If you partitioned your drive under a different operating system, you may need to enable

partition selection support in the kernel. In both the 2.4 and 2.6 kernels,
Code:
File systems
-> Partition types
-> Advanced partition selection





       
用上面及我个人上次排错经验总结来说是:

一、内核编译时要把文件系统的格式(如EXT2,EXT3)之类的编译进去。
二、把IDE和SCSI编译进内核。
三、注意PCI等也要编译进内核。
四、注意/etc/fstab中写是不是正确。
五、GRUB中的boot的启动的在哪个hd(或sd)。


最简单的方法是。用他自动编译内核的那种方法生成内核。
再看下能不能启动。
1.不能启动,出错就出在/etc/fstab或grub上
2.如果能启动。则错误出在内核的编译上。
重新编译内核直到成功。





       

安装及确定grub的方法:
#grub
>find


    * grub> find /boot/grub/stage1,它會找原來裝 GRUB 的硬碟分區,例如 (hd1,0),即第二個硬

碟的第一個分區。
    * grub> root (hd1,0),告訴它 linux root 在哪裡。
    * grub> setup (hd0),安裝 GRUB 在第一個硬碟的 MBR (Master Boot Record)。把 Windows 的

bootloader 蓋掉… 之後可以在 GRUB menu 中加入進 Windows 系統的選項,本文不討論這個。
    * grub> quit,結束,這樣就完成 GRUB rebuild,可以 reboot 了。

另一作法是把 GRUB 安裝在硬碟分區裡,例如 grub> setup (hd1,0),安裝 GRUB 在第二個硬碟的第一

個分區,而不是 MBR。這種方法可以使用 Windows 的 boot loader 來作 dual system 啟動,我就是

這麼作的,下回再來介紹。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-20 08:59:05 | 显示全部楼层
thanks
回复 支持 反对

使用道具 举报

发表于 2009-2-13 22:40:52 | 显示全部楼层
驱动,前两天编译的lfs也是这样,内核编译的时候添加驱动就OK了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表