无法将 ubuntu 10.04 grub.cfg 输入到 redhat 5.1 menu.lst 文件中以运行 2 个 linux 操作系统和 1 个 windows

无法将 ubuntu 10.04 grub.cfg 输入到 redhat 5.1 menu.lst 文件中以运行 2 个 linux 操作系统和 1 个 windows

我的计算机有三个操作系统。

我首先安装了 Windows 7,然后安装了 ubuntu 10.04

最后我安装了 redhat 5.1

现在我知道一件事,因为我安装了 redhat,所以 ubuntu 安装的 grub 将被 redhat grub 覆盖。而且我知道要在启动时看到所有三个操作系统,我必须将 /boot/grub/cfg 输入到 /boot/grub/menu.lst 文件中。

现在问题是这样的

在以前的版本中,使用 ubuntu grub 文件非常容易,但是现在这个文件被修改了..现在我不知道要从 ubuntu /grub/grub.cfg 文件中提取什么,以便我可以在 redhat /boot/grub/menu.lst 文件中进行输入..

简而言之,我无法将 grub.cfg 文件的条目放入 redhat menu.lst 文件中。你能帮帮我吗,我想在这三个 eOS 上工作。

答案1

Ubuntu 的最新版本附带了 grub2,其配置文件使用的语法与 grub1(我相信是 redhat 使用的)不同。

如果你看一下 ubuntu 中的 /boot/grub/grub.cfg 文件,你应该会发现一个类似这样的部分

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd0,3)'
    search --no-floppy --fs-uuid --set 5cf7c0d3-8b4d-428f-a54a-ea43ce486654
    linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5cf7c0d3-8b4d-428f-a54a-ea43ce486654 ro quiet splash
    initrd  /boot/initrd.img-2.6.32-21-generic
}

转换为以下 menu.lst 条目

title Ubuntu, with Linux 2.6.32-21-generic
root (hd0,3)
kernel /boot/vmlinuz-2.6.32-21-generic root=UUID=5cf7c0d3-8b4d-428f-a54a-ea43ce486654 ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic

当然,您需要根据您的配置调整磁盘 UUID 和分区号。

相关内容