LinuxSir.cn,穿越时空的Linuxsir!

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

[求助]gentoo 2008LiveCD安装grub失败

[复制链接]
发表于 2008-10-26 00:03:28 | 显示全部楼层 |阅读模式
我用的是2008.0_beta2的LiveCD安装的,因为我的网络需要登录客户端,没有选择在线的安装,安装过程没有出现错误。但安装完成后重启发现硬盘的MBR应该没有任何改变,(XP正常启动,没有出现GRUB菜单)。并且我进LliveCD发现安装分区(hd0,4)下的/boot/grub/stage1等文件是存在的。
    然后我准备手动开始安装GRUB,在该liveCD下的根用户下进入grub,然后root(hd0,4),setup(hd0)之后提示(大致如此):
   checking if "/boot/grub/stage1 exists .....no"
   大概就是说stage1等文件不存在。这里我确认(hd0,4)分区上是有/boot/grub/stage1等文件的,不知道为什么会发生这种错误。
   然后我用grub-install安装脚本安装,但是提示could not find device for /boot 和not found or not a block device的错误。网上有一种方法提示说,运行如下命令可以解决:grep -v rootfs /proc/mounts > /etc/mtab 但仍没有解决问题,提示同样的错误。
   之后我用ubuntu的7.04liveCD安装光盘同样运行上述命令也提示同样的错误。最后我用ubuntu8.04的liveCDp安装光盘同样运行上述命令之后,grub提示succeed!,之后我重启系统之后,进入时发现grub 提示菜单,但出现grub loading,error2之后就没反应了。
   我网上搜了发现http://www.hiadmin.com/gentoo-li ... %BC%8F%E7%89%88bug/         
有人报错,但我感觉这个错误是不是跟我的一样
   对上述的错误,应该如何解决?望各位指点。本人刚刚接触gentoo,不知道我的问题有没有叙述明白。
 楼主| 发表于 2008-10-26 12:23:20 | 显示全部楼层
尝试用grubfordos,开机进入grubfordos之后,运行:root (hd0,4),提示识别了LINUX的分区,但是kernel /boot/kernel**** 提示 bad file for directory type,也无法用TAB键补全命令,顺便说明我把gentoo装在了扩展分区里。
     装gentoo已经把我装得差点崩溃了:(……都快两个星期了,gentoo还没有在硬盘上好好跑起来……………………ok,I'll wait.
回复 支持 反对

使用道具 举报

发表于 2008-10-26 12:29:20 | 显示全部楼层
你找个livecd启动,然后执行sudo fdisk -l
贴出来结果
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-26 12:48:27 | 显示全部楼层
grub> root (hd0,
Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0xc
   Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 3,  Filesystem type is fat, partition type 0x1b
   Partition num: 4,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 5,  Filesystem type unknown, partition type 0x82
============================================================================

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf0b1ebb0

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1530    12289693+   c  W95 FAT32 (LBA)
/dev/sda2            1531        7649    49150867+  83  Linux
/dev/sda3            7650        9434    14338012+   5  Extended
/dev/sda4            9435        9729     2369587+  1b  Hidden W95 FAT32
/dev/sda5            7650        9357    13719478+  83  Linux
/dev/sda6            9358        9434      618471   82  Linux swap / Solaris

这是liveCD下进入grub后的输出和fdisk -l 输出。多谢版主关注
回复 支持 反对

使用道具 举报

发表于 2008-10-26 12:52:31 | 显示全部楼层
首先,如zhllg版主所言,LiveCD是有必要的。
然后,
Post by lfs233;1899501
...但是kernel /boot/kernel**** 提示 bad file for directory
type,也无法用TAB键补全命令...

你确信存在/boot路径?
命令 kernel /vmlinuz****,不行吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-26 13:39:21 | 显示全部楼层
Post by LongerZ;1899513
首先,如zhllg版主所言,LiveCD是有必要的。
然后,

你确信存在/boot路径?
命令 kernel /vmlinuz****,不行吗?


我在liveCD挂载过/dev/sda5(这个对应的应该就是hd0,4吧?),浏览该分区上,的确有/boot路径,并且gentoo的liveCD安装完后,/目录下是没有vmlinuz****的。
回复 支持 反对

使用道具 举报

发表于 2008-10-26 16:30:19 | 显示全部楼层
装grub的时候要先chroot
你的sda5的/boot里到底有哪些文件?
全列出来
回复 支持 反对

使用道具 举报

发表于 2008-10-26 16:53:24 | 显示全部楼层
root (hd0,4) ,这个sda5如果是你的/boot来着,grub应该无须路径吧?,直接kernel- tab补全?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-26 17:49:25 | 显示全部楼层
今天下午,我刻了2008-r1的liveCD无网络安装盘(以前安的是beta2版本),重新分区,再重新安装一遍,安装过程没有出错。还是一样的结果:(

这个是fdisk -l的结果:

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf0b1ebb0

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1530    12289693+   c  W95 FAT32 (LBA)
/dev/sda2            1531        2868    10747485   83  Linux
/dev/sda3            2869        2942      594405   82  Linux swap / Solaris
/dev/sda4            2943        9729    54516577+   5  Extended
/dev/sda5            2943        9729    54516546   83  Linux

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
在liveCD下,我把sda2挂载在当前目录的gentoo下.以下是结果boot和boot/grub文件夹里的内容:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

livecd gentoo # ls -l gentoo/boot/
total 23108
-rw-r--r-- 1 root root  1294167 Oct 26 14:18 System.map-genkernel-x86-2.6.24-gentoo-r5
lrwxrwxrwx 1 root root        1 Oct 26 14:41 boot -> .
drwxr-xr-x 2 root root     4096 Oct 26 14:51 grub
-rw-r--r-- 1 root root 19060328 Oct 26 14:18 initramfs-genkernel-x86-2.6.24-gentoo-r5
-rw-r--r-- 1 root root  3267168 Oct 26 14:18 kernel-genkernel-x86-2.6.24-gentoo-r5

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
livecd gentoo # ls -l gentoo/boot/grub/
total 320
-rw-r--r-- 1 root root   8032 Feb 28  2008 e2fs_stage1_5
-rw-r--r-- 1 root root   7904 Feb 28  2008 fat_stage1_5
-rw-r--r-- 1 root root   7168 Feb 28  2008 ffs_stage1_5
-rw-r--r-- 1 root root     15 Oct 26 14:51 glidevice.map
-rw-r--r-- 1 root root    272 Oct 26 14:51 grub.conf
-rw-r--r-- 1 root root   7200 Feb 28  2008 iso9660_stage1_5
-rw-r--r-- 1 root root   8608 Feb 28  2008 jfs_stage1_5
lrwxrwxrwx 1 root root      9 Oct 26 14:51 menu.lst -> grub.conf
-rw-r--r-- 1 root root   7328 Feb 28  2008 minix_stage1_5
-rw-r--r-- 1 root root   9760 Feb 28  2008 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 Feb 28  2008 stage1
-rw-r--r-- 1 root root 105340 Feb 28  2008 stage2
-rw-r--r-- 1 root root 105340 Feb 28  2008 stage2_eltorito
-rw-r--r-- 1 root root   7488 Feb 28  2008 ufs2_stage1_5
-rw-r--r-- 1 root root   6752 Feb 28  2008 vstafs_stage1_5
-rw-r--r-- 1 root root   9384 Feb 28  2008 xfs_stage1_5

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
这个是我运行grub的具体内容:
grub> root (hd0,
Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0xc
   Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 2,  Filesystem type unknown, partition type 0x82
   Partition num: 4,  Filesystem type is ext2fs, partition type 0x83

grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 2: Bad file or directory type

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

这个是我运行grub-install的具体内容:
livecd gentoo # grub-install /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

对了,chroot环境也试了,不过chroot时,我只是按照gentoo安装手册上做的,就是挂载/proc 和/dev ,然后chroot /mnt/gentoo /bin/bash 然后env-update ,source /etc/profile ,结果也是如上,不知道chroot这步有没有对?
回复 支持 反对

使用道具 举报

发表于 2008-10-26 18:30:12 | 显示全部楼层
你肯定什么地方做错了
照手册做,一步也不要省,不要自作聪明的省略或者改变任何步骤
淹死的都是会水的
对grub安装有任何问题的话,请看info grub
回复 支持 反对

使用道具 举报

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

本版积分规则

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