+ -
当前位置:首页 → 问答吧 → LFS6.2中 在“8.4. 使 LFS 系统能够启动”章节 grub报错

LFS6.2中 在“8.4. 使 LFS 系统能够启动”章节 grub报错

时间:2009-12-01

来源:互联网

我是在虚拟机上用挂载liveCD的方式做的,之前一切正常,但是在进入grub以后,确定root (hd0,0) 后出现“error 5 Partition table invalid or corrupt”的错误,因为是虚拟机 肯定是(hd0,0)我没做其他的划分,请各位帮帮忙:)是不是跟虚拟机的虚拟设备有关呢,还是别的什么原因,还请大家指点

作者: reaver   发布时间: 2009-12-01

分区如何布局?

会不会抓屏?能否贴出 cfdisk 的输出画面?

作者: d00m3d   发布时间: 2009-12-02

我是用虚拟机新建的一块scsi硬盘,直接格式化成EXT3文件系统 然后挂在/mnt/lfs下
上传的图像
cfdisk.png (19.4 KB, 16 次查看)

作者: reaver   发布时间: 2009-12-02

没有分区?直接挂sda?

作者: simdiak   发布时间: 2009-12-02

为什么不分区不行呢,是不是不分区,分区表里就没信息啊

作者: reaver   发布时间: 2009-12-02

這樣就未試過了,那麼你用 root (hd0) 行不?

作者: d00m3d   发布时间: 2009-12-03

引用:
作者: d00m3d
這樣就未試過了,那麼你用 root (hd0) 行不?
我试过 不行,tab键以后都没有任何的提示,之前,我好像问过一次grub识别设备的原理,后来未果- -!我也就淡忘了,后来我出差了,最近总算忙的差不多了,又开始从新学起了,版主还记得我吧:)

估计分区的话可能才会在分区表那几个字节里写东西,我想是不是grub写入MBR前会从那里找呢,我还得再试试:)谢谢版主关注阿

作者: reaver   发布时间: 2009-12-03

不用 tab,直接鍵入 root (hd0) 可行否?

作者: d00m3d   发布时间: 2009-12-03

引用:
作者: d00m3d
不用 tab,直接鍵入 root (hd0) 可行否?
不行,我试过了,我抽时间按照分区的再走一遍看看,找找原因:)

作者: reaver   发布时间: 2009-12-03

没有分区怎么行呢,不太可能吧,一个分区都没有从哪起动

作者: myssc   发布时间: 2009-12-16

用 lilo 引导可以不分区的。
其实用文件系统无关的引导程序都可以,如 syslinux。

grub 因其特殊的安装运行方式,无法应用在不分区环境。
grub 会覆盖0磁道0扇区后若干扇区,不分区时会破坏文件系统,其自身也不允许安装到不分区的设备。

作者: 聚焦深空   发布时间: 2009-12-17

深空兄,Grub2 似乎也繼承了 Grub 的方式來運作,是否也不能像 lilo 引導不分區的?

作者: d00m3d   发布时间: 2009-12-17

还没用 grub2 在不分区环境下试过,如果和 grub 原理一样,应该不行。

不分区的情况很少人用,偶个人只在建立虚拟机时使用,维护时映像文件可以直接挂载到宿主,不用计算 offset。

作者: 聚焦深空   发布时间: 2009-12-18

刚刚在 debian sid i386 环境下试过,grub2 支持不分区环境引导。
grub2 相对 grub 对不分区情况做了特殊处理,有进步,又多一个理由切换到 grub2。
引用:
# grub-install /dev/hda
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk. This is a BAD idea.
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
/usr/sbin/grub-setup: error: If you really want blocklists, use --force.

作者: 聚焦深空   发布时间: 2009-12-19

debian sid i386 环境下,grub2 不分区环境引导配置文件 /boot/grub/grub.cfg 内容如下:
代码:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=0
insmod ext2
set root=(hd0)
search --no-floppy --fs-uuid --set 7c3ca617-c511-4bc8-b4f9-3b2e90d172bf
if loadfont /usr/share/grub/unicode.pf2 ; then
 set gfxmode=640x480
 insmod gfxterm
 insmod vbe
 if terminal_output gfxterm ; then true ; else
 # For backward compatibility with versions of terminal.mod that don't
 # understand terminal_output
 terminal gfxterm
 fi
fi
set locale_dir=/boot/grub/locale
set lang=en
insmod gettext 
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, with Linux 2.6.32-trunk-686" {
 insmod ext2
 set root=(hd0)
 search --no-floppy --fs-uuid --set 7c3ca617-c511-4bc8-b4f9-3b2e90d172bf
 linux /boot/vmlinuz-2.6.32-trunk-686 root=/dev/hda ro quiet
 initrd /boot/initrd.img-2.6.32-trunk-686
}
menuentry "Debian GNU/Linux, with Linux 2.6.32-trunk-686 (recovery mode)" {
 insmod ext2
 set root=(hd0)
 search --no-floppy --fs-uuid --set 7c3ca617-c511-4bc8-b4f9-3b2e90d172bf
 linux /boot/vmlinuz-2.6.32-trunk-686 root=/dev/hda ro single 
 initrd /boot/initrd.img-2.6.32-trunk-686
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

作者: 聚焦深空   发布时间: 2009-12-19

看来 Grub2比 Grub 进步不少,但很不习惯它的语法,仍未适应

作者: d00m3d   发布时间: 2009-12-19