LinuxSir.cn,穿越时空的Linuxsir!

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

[已解决]Grub启动-Error 2: Bad file or directory type<求助>

[复制链接]
发表于 2009-2-14 11:50:52 | 显示全部楼层 |阅读模式
在ubuntu下安装Gentoo,安装过程一切正常.修改的是ubuntu的menu.lst,启动提示grub 2号错误.
安装过程倒不难,现被卡在这里,请大家帮忙!谢谢!

menu.lst内容:
title           Gentoo Linux 2.6.27-r8
root            (hd0,11)
kernel          /boot/kernel-2.6.27-gentoo-r8 root=/dev/sda12  ro

title                Debian GNU/Linux, kernel 2.6.27-11-generic
root                (hd0,8)
kernel                /boot/vmlinuz-2.6.27-11-generic root=UUID=0831f4db-27d6-40fa-a1f8-a5ca086980cf ro quiet splash locale=zh_CN
initrd                /boot/initrd.img-2.6.27-11-generic
boot

ubuntu启动正常, 我确认(hd0,11)/boot/kernel-2.6.27-gentoo-r8是存在的。
Google了很多没找到合适方法(可能心急吧!)
我修改:kernel          /boot/kernel-2.6.27-gentoo-r8 root=/dev/sda12  ro
这行内容不止十次了,电脑重启也不止十次,没法解决,问题是否出在内核(怎么确认内核是否有问题)?
Btw, 这个问题可能很简单,知道怎么解决的兄弟麻烦告诉我详细过程,新手,请不见笑!^_^
发表于 2009-2-14 11:56:47 | 显示全部楼层
1.看看你的/boot文件系统类型,在内核里面是否已经被选择支持了。 如果ex2默认好像是不支持的。需要手工选择。
另外,你可以在grub报错后,可以在grub里面手工输入来选择你的boot分区。方法是进入grub命令提示下,然后kernel (hd0,按<tab> 就会有提示, 这样就知道你是否配置grub.conf(menu.lst)是否有错了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-14 12:13:31 | 显示全部楼层
/boot没有单独分开,文件系统类型是ext3,内核配置时ext2,ext3都选上了支持的。
grub安装是正常的,开机报错后提示:
“Error 2:Bad file or directory type
press any key to continue ...”
在grub命令提示下?--我现在重启进去看看!谢谢!
回复 支持 反对

使用道具 举报

发表于 2009-2-14 12:34:13 | 显示全部楼层
http://www.linuxplanet.com/linuxplanet/tutorials/6480/1/

楼主可以参考一下这个~

好像是由于ext3和e2fsprogs造成的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-14 13:54:18 | 显示全部楼层
grub> kernel (hd0, (tab,按tab一下键)
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type unknown, partition type 0x7
Partition num: 5, Filesystem type unknown, partition type 0x7
Partition num: 6, Filesystem type unknown, partition type 0x7
Partition num: 7, Filesystem type unknown, partition type 0x83
Partition num: 8, Filesystem type unknown, partition type 0x83
Partition num: 9, Filesystem none, partition type 0x82
Partition num: 10, Filesystem type unknown, partition type 0x83
Partition num: 11, Filesystem type unknown, partition type 0x83

grub>kernel (hd0,7)/   (tab,按tab一下键)
grub>kernel (hd0,8)/   (tab,按tab一下键)
grub>kernel (hd0,10)/   (tab,按tab一下键)
正常显示。

grub>kernel (hd0,11)/   (tab,按tab一下键)
Error 2:Bad file or directory type

看来真的是grub没法分辨(hd0,11)这个区.

于是用之前的/boot单独的分区(hd0,10)引导,没出现Error 2错误,可是启动时提示错误:
VFS: Cannot open root device "root=/dev/sda11" or unknown-block(2,0)
 Please append a correct "root=" boot option
 Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(2,0)

问题先帖出来,搜了一下,网上有些例子,忙了一上午,先吃了饭再研究。^_^
哪位有空也请帮忙找一下答案.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-14 14:32:10 | 显示全部楼层
网上找了些文章,不知道是不是内核问题?有什么办法可以知道内核是不是有问题?
以下是现在的menu.lst:
title           Gentoo Linux 2.6.27-r8
root            (hd0,10)
kernel          /boot/kernel-2.6.27-gentoo-r8 root=/dev/sda12

title                Debian GNU/Linux, kernel 2.6.27-11-generic
root                (hd0,8)
kernel                /boot/vmlinuz-2.6.27-11-generic root=UUID=0831f4db-27d6-40fa-a1f8-a5ca086980cf ro quiet splash locale=zh_CN
initrd                /boot/initrd.img-2.6.27-11-generic
boot

fatab:
/dev/sda11                /boot                ext3                noauto,noatime        1 2
/dev/sda12                /                ext3                noatime                0 1
/dev/sda10                none                swap                sw                0 0
/dev/cdrom                /mnt/cdrom        auto                noauto,ro        0 0
回复 支持 反对

使用道具 举报

发表于 2009-2-14 15:05:25 | 显示全部楼层
Post by kentty;1947453
网上找了些文章,不知道是不是内核问题?有什么办法可以知道内核是不是有问题?
以下是现在的menu.lst:
title           Gentoo Linux 2.6.27-r8
root            (hd0,10)
kernel          /boot/kernel-2.6.27-gentoo-r8 root=/dev/sda12

title                Debian GNU/Linux, kernel 2.6.27-11-generic
root                (hd0,8)
kernel                /boot/vmlinuz-2.6.27-11-generic root=UUID=0831f4db-27d6-40fa-a1f8-a5ca086980cf ro quiet splash locale=zh_CN
initrd                /boot/initrd.img-2.6.27-11-generic
boot

fatab:
/dev/sda11                /boot                ext3                noauto,noatime        1 2
/dev/sda12                /                ext3                noatime                0 1
/dev/sda10                none                swap                sw                0 0
/dev/cdrom                /mnt/cdrom        auto                noauto,ro        0 0

我觉得和内核没有关系,你都没有找到内核文件,你到你的Debian里面用fsck去看看你那个不认的分区把,可能磁盘有错也不一定。

突然想起,忘了问了,你是安装 AMD64 ,还是x86的版本???
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-14 15:28:23 | 显示全部楼层
网上有很多文章说到如果内核编译配置时有的模块没有选上也会出现VFS的错误提示,我应该没有漏选的。我安装的是x86版本,因现在的ubuntu也是i686,如果安装AMD64的,在ubuntu下好像34跟64的不兼容sudo chroot /mnt/gentoo /bin/bash没法进去。
fsck结果如下:
$sudo fsck /dev/sda11
fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
/dev/sda11: clean, 14/26104 files, 12702/104388 blocks

$sudo fsck /dev/sda12
fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
/dev/sda12: clean, 392081/1048576 files, 805562/4188940 blocks
回复 支持 反对

使用道具 举报

发表于 2009-2-14 16:02:18 | 显示全部楼层
是不是grub的版本的问题呀,你在gentoo里面安装重装grub试试。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-14 16:03:47 | 显示全部楼层
chroot到gentoo里重装过grub了,问题依旧。
回复 支持 反对

使用道具 举报

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

本版积分规则

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