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" относится к первой строке
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.