红帽企业 Linux 6:/boot/grub/menu.lst 或 /boot/grub/grub.conf?

红帽企业 Linux 6:/boot/grub/menu.lst 或 /boot/grub/grub.conf?

我有一个全新的 Scientific Linux 6 系统,但同样的问题应该适用于 CentOS 6、RHEL6 或任何 RHEL6 衍生版本。

我看到它/boot/grub包含一个menu.lst以及一个grub.conf文件。还有一个符号链接 from/etc/grub.conf表明/boot/grub/grub.conf我应该使用grub.conf.

# cd /boot/grub
# ls -ld grub.conf menu.lst
-rw-------  1 root root 845 Aug 29 13:00 grub.conf
-rw-------. 1 root root 847 Aug 29 13:00 menu.lst
# ls -l /etc/grub.conf
lrwxrwxrwx. 1 root root 22 Aug 29 13:00 /etc/grub.conf -> ../boot/grub/grub.conf

这些文件不是由 RPM 提供的,这使得很难找到描述此更改的更改日志:

# rpm -qa --whatprovides /etc/grub.conf /boot/grub/menu.lst /boot/grub/grub.conf 
no package triggers /etc/grub.conf
no package triggers /boot/grub/menu.lst
no package triggers /boot/grub/grub.conf

我应该使用哪个文件?为什么有两个文件?您能给我指点一下权威文档吗?

更新有趣的是,在 RHEL5.6/5.7 系统上,menu.lst通常是指向./grub.conf.符号链接/etc/grub.conf也在那里:

# ls -l /boot/grub/menu.lst /boot/grub/grub.conf /etc/grub.conf
-rw------- 1 root root 1036 Aug  2 11:34 /boot/grub/grub.conf
lrwxrwxrwx 1 root root   11 Apr  5 00:42 /boot/grub/menu.lst -> ./grub.conf
lrwxrwxrwx 1 root root 22 Aug  3  2009 /etc/grub.conf -> ../boot/grub/grub.conf

但是,这个符号链接在 RHEL6 中不再存在。我找不到任何有记录的原因。

答案1

我们应该使用/boot/grub/grub.conf, 并且/boot/grub/menu.lst应该是 的符号链接grub.conf

这些文件最初是由 anaconda 在安装过程中创建的。这是已登录/var/log/anaconda.program.log。我们可以看到这个 anaconda 执行使用的是grub.conf,而不是menu.lst

13:00:23,089 INFO    : Running... ['/sbin/grub-install', '--just-copy']
13:00:23,134 INFO    : Running... ['/sbin/grub', '--batch', '--no-floppy', '--device-map=/boot/grub/device.map']
13:00:23,346 INFO    : 
13:00:23,347 INFO    : 
13:00:23,347 INFO    :     GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
13:00:23,347 INFO    : 
13:00:23,348 INFO    :  [ Minimal BASH-like line editing is supported.  For the first word, TAB
13:00:23,348 INFO    :    lists possible command completions.  Anywhere else TAB lists the possible
13:00:23,348 INFO    :    completions of a device/filename.]
13:00:23,348 INFO    : grub> root (hd0,0)
13:00:23,348 INFO    :  Filesystem type is ext2fs, partition type 0x83
13:00:23,348 INFO    : grub> install --stage2=/boot/grub/stage2 /boot/grub/stage1 d (hd0) /boot/grub/stage2 p (hd0,0)/boot/grub/grub.conf
13:00:23,348 INFO    : grub> 

答案2

你应该使用菜单.lst。我安装了 science linux 6.1,它使用 menu.lst。您可以在SL官方文档页面进行验证:http://ftp.scientificlinux.org/linux/scientific/6.1/x86_64/os/repoview/grub.html

答案3

我不确定为什么 Red Hat 选择使用 GRUB/boot/grub/grub.conf作为 GRUB 的配置文件,因为 GRUB 规范是针对/boot/grub/menu.lst.我相信符号链接是必要的,因为引导加载程序的阶段 1 指的是/boot/grub/menu.lst.

相关内容