LinuxSir.cn,穿越时空的Linuxsir!

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

LFS 8.4小节-安装Grub错误

[复制链接]
发表于 2008-10-22 17:31:00 | 显示全部楼层 |阅读模式
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系统 第二版(作者:孙海勇)


硬盘分区:

  1. Number  Start   End     Size    Type     File system  Flags
  2. 1      32.3kB  1028MB  1028MB  primary  xfs
  3. 2      1028MB  2056MB  1028MB  primary  linux-swap
  4. 3      2056MB  3084MB  1028MB  primary  ext2
  5. 4      3084MB  8587MB  5503MB  primary  xfs
复制代码


我将第四分区(/dev/sda4)挂载到主系统的 /mnt 目录,在/mnt/LFS下进行编译工作。
在 chroot 环境下设置 Grub 引导。


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

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

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

  12. Error 15: File not found

  13. grub>
复制代码


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


  1. root [ / ]# ls -l /boot/grub
  2. total 104
  3. -rw-r--r-- 1 root root    512 Oct 16 10:14 stage1
  4. -rw-r--r-- 1 root root 100554 Oct 16 10:14 stage2
  5. root [ / ]#
复制代码


我尝试着将 boot 目录复制到 /dev/sda1 中,Grub却能顺利的找到 stage1。

  1. grub> find /boot/grub/stage1
  2. (hd0,0)

  3. grub>
复制代码


为何 Grub 找不到 /dev/sda4 下的 stage1 ?
发表于 2008-10-22 19:06:02 | 显示全部楼层
/boot 不是 /mnt/xxx/boot ?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-22 19:09:53 | 显示全部楼层
Post by 晨想;1897629
/boot 不是 /mnt/xxx/boot ?


使用LiveCD 2160 启动,/dev/sda4 挂接到 /mnt

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

在 chroot 环境 boot 的路径为:
/boot
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-22 22:21:18 | 显示全部楼层
已解决。是路径不动。

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


感谢晨想同志的提醒。
回复 支持 反对

使用道具 举报

发表于 2008-11-21 01:21:26 | 显示全部楼层
我也遇到这个错误了,但我看不太懂你怎么解决的。能详细点吗?
回复 支持 反对

使用道具 举报

发表于 2008-11-21 23:05:59 | 显示全部楼层
Mark,我还担心到时候grub不好认盘呢.
回复 支持 反对

使用道具 举报

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

本版积分规则

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