这真的让我失望。我有 Gentoo 和 Ubuntu,都带有 Grub2。Gentoo 有一个专用/boot分区,而 Ubuntu 没有。我menuentry在 Gentoo 中有一个/etc/grub.d/40_custom可以启动 Ubuntu(并且 Ubuntu 可以正常启动)。
因为 Ubuntu 带有 Grub,所以我想链式加载到那个,而不是维护我设置根、内核、initrd 和其他东西的条目。这是我对链加载器的使用(Ubuntu 已开启/dev/sda4,我已经在那里安装了 Grub):
menuentry 'Chainloader' {
insmod chain
set root=(hd0,4)
chainloader +1
}
Run Code Online (Sandbox Code Playgroud)
它给了我error: Invalid signature,我发现没有可用的解决方案。有人可以指出吗?
这是结果 </dev/sda4 head -c 512 | hd
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200
Run Code Online (Sandbox Code Playgroud)
这是 的结果fdisk -l。/dev/sda1属于/bootGentoo,Gentoo 属于/dev/sda2,Ubuntu 属于/dev/sda4. Ubuntu的/boot是/dev/sda4太多。
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe001152b
Device Boot Start End Blocks Id System
/dev/sda1 1 9 72261 83 Linux
/dev/sda2 10 13064 104864287+ 8e Linux LVM
/dev/sda4 * 18152 19457 10490445 83 Linux
Run Code Online (Sandbox Code Playgroud)
没有错误 grub-install /dev/sda4 --no-floppy --force
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. 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 their use is discouraged..
Installation finished. No error reported.
Run Code Online (Sandbox Code Playgroud)
启动过程的初始部分包括从硬盘驱动器的第一个扇区(即所谓的主引导记录 (MBR))加载代码。通常,Grub 会写入第一个硬盘驱动器扇区,而不是写入保存 /boot 的分区的第一个扇区。但是,您通常可以在 Linux 安装期间更改此设置,但在现代安装例程中,此设置通常是隐藏的。
您说您已将 Grub 安装到 /dev/sda4 中,但是您的配置看起来正确,并且您发布的错误消息表明 Grub 可能未正确安装到您想要链接加载的分区中。您应该启动到 Gentoo,然后 chroot 到 Ubuntu 分区。确保 /boot 现在正确指向 Ubuntu-/boot 而不是 Gentoo!现在将 Grub 2 安装到 Ubuntu 分区 /dev/sda4: 的第一个扇区中grub-install /dev/sda4 --no-floppy。
与往常一样,在处理 MBR 和分区时,请确保在开始之前拥有可用的最新备份。
| 归档时间: |
|
| 查看次数: |
8800 次 |
| 最近记录: |