+ -
当前位置:首页 → 问答吧 → LFS 8.4小节-安装Grub错误

LFS 8.4小节-安装Grub错误

时间:2008-10-22

来源:互联网

LFS 8.4小节-安装Grub错误

我按照 LFS 6.3-rc2 文档的指导在虚拟机中编译Linux,在进行到 8.4 安装Grub设置引导小节时出现了错误,无法继续进行。

我的使用环境:
虚拟机: VMware 6.0.0 build-45731
LiveCD: lfslivecd-x86-6.3-r2160.ISO
软件包: lfslivecd-x86-6.3-r2160.ISO 中自带的源码包。
参考文档: Linux From Scratch - Version 6.3-rc2
手把手教你如何建立自己的Linux系统 第二版(作者:孙海勇)


硬盘分区:
代码:
Number Start End Size Type File system Flags
 1 32.3kB 1028MB 1028MB primary xfs
 2 1028MB 2056MB 1028MB primary linux-swap
 3 2056MB 3084MB 1028MB primary ext2
 4 3084MB 8587MB 5503MB primary xfs
我将第四分区(/dev/sda4)挂载到主系统的 /mnt 目录,在/mnt/LFS下进行编译工作。
在 chroot 环境下设置 Grub 引导。

代码:
grub> root (hd0,
 Possible partitions are:
 Partition num: 0, Filesystem type is xfs, partition type 0x83
 Partition num: 1, Filesystem type unknown, partition type 0x82
 Partition num: 2, Filesystem type is ext2fs, partition type 0x83
 Partition num: 3, Filesystem type is xfs, partition type 0x83

grub> root (hd0,3)
 Filesystem type is xfs, partition type 0x83

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

Error 15: File not found

grub>
Grub 提示没有找到 stage1。但用 ls 查看 /boot/grub 目录中却有此文件。

代码:
root [ / ]# ls -l /boot/grub
total 104
-rw-r--r-- 1 root root 512 Oct 16 10:14 stage1
-rw-r--r-- 1 root root 100554 Oct 16 10:14 stage2
root [ / ]#
我尝试着将 boot 目录复制到 /dev/sda1 中,Grub却能顺利的找到 stage1。
代码:
grub> find /boot/grub/stage1
 (hd0,0)

grub>
为何 Grub 找不到 /dev/sda4 下的 stage1 ?

作者: tsingl   发布时间: 2008-10-22

/boot 不是 /mnt/xxx/boot ?

作者: 晨想   发布时间: 2008-10-22

引用:
作者: 晨想
/boot 不是 /mnt/xxx/boot ?
使用LiveCD 2160 启动,/dev/sda4 挂接到 /mnt

在编译环境 boot 的路径为:
/mnt/lfs/boot

在 chroot 环境 boot 的路径为:
/boot

作者: tsingl   发布时间: 2008-10-22

已解决。是路径不动。

mount /dev/sda4 /mnt
/mnt/boot/grub = /dev/sda4/boot/grub


感谢晨想同志的提醒。

作者: tsingl   发布时间: 2008-10-23

我也遇到这个错误了,但我看不太懂你怎么解决的。能详细点吗?

作者: lorking   发布时间: 2008-11-21

Mark,我还担心到时候grub不好认盘呢.

作者: qufo   发布时间: 2008-11-22