|
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 ? |
|