[已解决]Grub启动-Error 2: Bad file or directory type<求助>
时间:2009-02-14
来源:互联网
安装过程倒不难,现被卡在这里,请大家帮忙!谢谢!
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, 这个问题可能很简单,知道怎么解决的兄弟麻烦告诉我详细过程,新手,请不见笑!^_^
作者: kentty 发布时间: 2009-02-14
另外,你可以在grub报错后,可以在grub里面手工输入来选择你的boot分区。方法是进入grub命令提示下,然后kernel (hd0,按<tab> 就会有提示, 这样就知道你是否配置grub.conf(menu.lst)是否有错了。
作者: dutongtie 发布时间: 2009-02-14
grub安装是正常的,开机报错后提示:
“Error 2:Bad file or directory type
press any key to continue ...”
在grub命令提示下?--我现在重启进去看看!谢谢!
作者: kentty 发布时间: 2009-02-14
作者: kimux 发布时间: 2009-02-14
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)
问题先帖出来,搜了一下,网上有些例子,忙了一上午,先吃了饭再研究。^_^
哪位有空也请帮忙找一下答案.
作者: kentty 发布时间: 2009-02-14
以下是现在的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
作者: kentty 发布时间: 2009-02-14
作者: kentty
网上找了些文章,不知道是不是内核问题?有什么办法可以知道内核是不是有问题?
以下是现在的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 |
突然想起,忘了问了,你是安装 AMD64 ,还是x86的版本???
作者: dutongtie 发布时间: 2009-02-14
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
作者: kentty 发布时间: 2009-02-14
作者: dutongtie 发布时间: 2009-02-14
作者: kentty 发布时间: 2009-02-14
作者: kentty 发布时间: 2009-02-14
作者: kentty
请问怎么看电脑启动时的信息,我想把错误信息帖出来.我找不到log文件.
|
作者: dutongtie 发布时间: 2009-02-14
作者: kentty
请问怎么看电脑启动时的信息,我想把错误信息帖出来.我找不到log文件.
|
如果用openrc
在/etc/rc.conf里
rc_logger="YES"
作者: kimux 发布时间: 2009-02-14
Error 2: Bad file or directory type
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)
作者: coderoar 发布时间: 2009-02-14
emerge-fetch.log emerge.log lastlog news portage sandbox wtmp
好像没有需要的。^_^
在/etc/rc.conf里还没有这句:
rc_logger="YES"
错误信息中有:
Root-NFS:No NFS server avilable,giving up.
VFS:Unable to mount root fs via NFS, trying floppy.
我现在从新编译内核,多选一些模块,再看看行不行.
作者: kentty 发布时间: 2009-02-14
作者: coderoar 发布时间: 2009-02-14
coderoar兄,
Partition num: 10, Filesystem type unknown, partition type 0x83
Partition num: 11, Filesystem type unknown, partition type 0x83
这个显示不就是83了吗?
我从编了一下内核,一会试完了不行就用genkernel 试试.
谢谢楼上各位!
作者: kentty 发布时间: 2009-02-14
应该是已经编进去的了。
作者: kentty 发布时间: 2009-02-14
现在准备用genkernel 生成内核,但手册里有一句:
复制安装光盘上的内核配置文件到genkernel搜索配置文件的默认位置:
# zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6
我在ubuntu下没有config.gz这个文件,快崩溃了,搞了一天了!
现在去刻盘,用光盘启动找config.gz这个文件.
作者: kentty 发布时间: 2009-02-14
再用genkernel生成内核,终于成功进入字符界面的Gentoo Linux了,试了一下网络,ping不通,估计是网络配置的问题,这个慢慢研究了(估计是个简单问题)。
"如使用 genkernel,内核参数可以改为 “real_root=/dev/sda11 root=/dev/ram0 rootfstype=ext3”。"---coderoar
coderoar兄,我的/是在sda12,上面那句我改11为12,可以正常启动到Gentoo了.
sda11我没试过,不知道能不能成功.
我的理解是root ()这个是/boot所在分区.
kernel real_root=这个是/所在分区.
不知道是不是这样理解,不过我这样做可以正常进系统了。^_^
再次感谢楼上所有兄弟姐妹的帮忙。累了一天了,还好,问题解决了。呵呵。。。
作者: kentty 发布时间: 2009-02-15
作者: kentty
现在准备用genkernel 生成内核,但手册里有一句:
复制安装光盘上的内核配置文件到genkernel搜索配置文件的默认位置: # zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6 |
作者: kentty
我的理解是root ()这个是/boot所在分区.
kernel real_root=这个是/所在分区. |
---
很费解你的 GRUB 会不认 ext3,后来还有“Error 2: Bad file or directory type”吗?
作者: coderoar 发布时间: 2009-02-15
添加DNS后可以上了。我的是DHCP自动获取IP的。
作者: kentty 发布时间: 2009-02-15
-coderoar兄,我把/boot放在/下,同一分区,就会出现Error 2错误提示,把/boot单独分出来就没有这个错误了.grub不认sda12,认sda11,两个区都是用同一软件格式化的.
安装gentoo是这样的:
ext3格式分sda11,sda12两个区,把sda12挂到/mnt/gentoo,解压stage3到/mnt/gentoo/,sda11挂到/mnt/gentoo/boot,chroot进去根据手册来的.
后在ubuntu下改menu.lst,grub就不认sda12了.
我现在也不明白为什么grub不认得sda12.
作者: kentty 发布时间: 2009-02-15
作者: coderoar 发布时间: 2009-02-15
开始的menu.lst
menu.lst内容:
title Gentoo Linux 2.6.27-r8
root (hd0,11)
kernel /boot/kernel-2.6.27-gentoo-r8 root=/dev/sda12 ro
现在的menu.lst:
title Gentoo Linux 2.6.27-r8
root (hd0,10)
kernel /boot/kernel-2.6.27-gentoo-r8 real_root=/dev/sda12 root=/dev/ram0 rootfstype=ext3
作者: kentty 发布时间: 2009-02-15
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28