Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
9.7. GRUB 菜单配置文件
The configuration file (
/boot/grub/grub.conf
), which is used to create the list of operating systems to boot in GRUB's menu interface, essentially allows the user to select a pre-set group of commands to execute. The commands given in 第 9.6 节 “GRUB 命令” can be used, as well as some special commands that are only available in the configuration file.
9.7.1. 配置文件结构
GRUB 菜单界面配置文件是
/boot/grub/grub.conf
。为菜单界面设置全局参数的命令位于这个文件的顶部,后面的内容是菜单里列出的每个操作系统或者内核。
下面是一个很简单的 GRUB 菜单配置文件,它用来引导Red Hat Enterprise Linux或者 Microsoft Windows 2000:
default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-2.el5PAE) root (hd0,0) kernel /boot/vmlinuz-2.6.18-2.el5PAE ro root=LABEL=/1 rhgb quiet initrd /boot/initrd-2.6.18-2.el5PAE.img # section to load Windows title Windows rootnoverify (hd0,0) chainloader +1
这个文件使 GRUB 建立了一个把Red Hat Enterprise Linux作为缺省操作系统的菜单,并在 10 秒后自动启动它。每个操作系统条目都包括了两部分内容,以及针对于系统磁盘分区表的命令。
注意
注意,default 被设置为一个整数。这指定了 GRUB 配置文件里的第一个
title
行。在前面的例子里,如果要把 Windows
设置为缺省选项,你可以把 default=0
修改为 default=1
。
Configuring a GRUB menu configuration file to boot multiple operating systems is beyond the scope of this chapter. Consult 第 9.9 节 “其它资料” for a list of additional resources.