LinuxSir.cn,穿越时空的Linuxsir!

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

LFS的grub引导不了,不知道是什么原因???

[复制链接]
发表于 2006-3-25 17:15:16 | 显示全部楼层 |阅读模式
我是在虚拟机VMvare 5.5上安装LFS的,系统安装完以后,grub.conf文件也设置好了,但是reboot以后,系统总是从host启动,而不能从LFS启动,不知道是什么原因??

硬盘分区:
----------------------------------------
|Disk /dev/hda: 4294 MB, 4294967296 bytes
|16 heads, 63 sectors/track, 8322 cylinders
|Units = cylinders of 1008 * 512 = 516096 bytes
|                                                                           
|   Device Boot      Start         End      Blocks   Id  System
|/dev/hda1               1         156       78592+  83  Linux  
|/dev/hda2             157         405      125496   82  Linux swap
|/dev/hda3             406        8322     3990168    5  Extended           
|/dev/hda5   *         406        8322     3990136+  83  Linux
|
|Disk /dev/sda: 12.8 GB, 12884901888 bytes
|255 heads, 63 sectors/track, 1566 cylinders
|Units = cylinders of 16065 * 512 = 8225280 bytes
|
|   Device Boot      Start         End      Blocks   Id  System
|/dev/sda1   *           1          31      248976   83  Linux
|/dev/sda2              32          97      530145   82  Linux swap
|/dev/sda3              98        1566    11799742+  83  Linux
----------------------------------------
我将LFS装在/dev/hda5分区上的。

grub.conf文件的配置:
host的grub.conf
----------------------------------------
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux ES (2.6.9-22.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.9-22.EL.img

title LFS 6.1.1
        root (hd1,4)
        kernel /boot/lfskernel-2.6.11.12 root=/dev/hda5
----------------------------------------

LFS的grub.conf
/mnt/lfs/etc/grub.conf
----------------------------------------
default=0
timeout=10

color green/black light-green/black

title LFS 6.1.1
        root (hd0,4)
        kernel /boot/lfskernel-2.6.11.12 root=/dev/hda5

title Red Hat Enterprise Linux ES (2.6.9-22.EL)
        root (hd1,0)
        kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.9-22.EL.img
----------------------------------------


安装时我在chroot环境下运行grub,总是报错:选择的硬盘不存在。
----------------------------------------
grub> root (hd0,4)

Error 21: Selected disk does not exist

grub> root (hd1,4)

Error 21: Selected disk does not exist
----------------------------------------

我又退回到host环境运行grub:
----------------------------------------
grub> root (hd0,4)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,4)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.

grub>
----------------------------------------

然后reboot,但是系统启动以后,还是从host启动。why ?????????????????



我在/mnt/lfs下创建了一个文件file:
echo "hello LFS ................" > /mnt/lfs/file
我分别在系统启动时运行grub,进入host系统时运行grub和从进入LFS系统时运行grub,分别执行命令:
cat (hd0,4)/file
在host中和LFS中,输出“hello LFS ................”,
----------------------------------------
grub> cat (hd0,4)/file
hello LFS ................

grub>
----------------------------------------

但在启动时,却出错:“Error 22: No such partition”
----------------------------------------
grub> cat (hd0,4)/file

Error 22: No such partition

grub> cat (hd1,4)/file
hello LFS ................

grub>
----------------------------------------
为什么上述三种情况下的输出不一样????


为什么不能从LFS分区引导???

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2006-3-25 17:25:38 | 显示全部楼层
从哪个硬盘启动,那个硬盘就是 hd0。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-25 17:49:13 | 显示全部楼层
Post by 终极幻想
从哪个硬盘启动,那个硬盘就是 hd0。


在LFS分区中也安装了grub,我要怎样配置才能让LFS分区来引导系统呢?
回复 支持 反对

使用道具 举报

发表于 2006-3-25 17:53:18 | 显示全部楼层
启动到 LFS 里边后,启动 udev,然后再重新设置 grub 就可以了。主要把 boot 位置弄清楚就可以了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-25 18:06:42 | 显示全部楼层
多谢终极幻想
我是第一次做LFS,许多东西还不太清楚,能否介绍得详细点!!
回复 支持 反对

使用道具 举报

发表于 2006-3-25 19:37:28 | 显示全部楼层
http://www.linuxsir.cn/bbs/showthread.php?t=248548
这是我遇到的GRUB问题.你看能对你有帮助没有.
回复 支持 反对

使用道具 举报

发表于 2006-3-26 09:55:07 | 显示全部楼层
你有两个硬盘,一个是主盘,一个是从盘,估计你的主盘是sda,电脑启动是首先读主盘的MBR,这样就启动到host上了。在你的host的menu.lst文件中加入如下启动项试试。
title    启动LFS
configfile (hd1,4)/boot/grub/menu,lst
回复 支持 反对

使用道具 举报

发表于 2006-3-26 11:08:26 | 显示全部楼层
Post by 终极幻想
启动到 LFS 里边后,启动 udev,然后再重新设置 grub 就可以了。主要把 boot 位置弄清楚就可以了。


是grub吧?
回复 支持 反对

使用道具 举报

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

本版积分规则

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