|
|
我是在虚拟机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
|