Product SiteDocumentation Site

E.6. GRUB 菜​单​配​置​文​件​

配​置​文​件​(/boot/grub/grub.conf)用​来​创​建 GRUB 菜​单​界​面​里​的​操​作​系​统​引​导​列​表​,它​允​许​用​户​选​择​预​先​设​置​的​一​组​命​令​。​你​可​以​使​用 第 E.5 节 “GRUB 命​令​” 里​的​命​令​,以​及​仅​在​配​置​文​件​里​可​用​的​特​殊​命​令​。​

E.6.1. 配​置​文​件​结​构​

GRUB 菜​单​界​面​配​置​文​件​是 /boot/grub/grub.conf。​为​菜​单​界​面​设​置​全​局​参​数​的​命​令​位​于​这​个​文​件​的​顶​部​,后​面​的​内​容​是​菜​单​里​列​出​的​每​个​操​作​系​统​或​者​内​核​。​
The following is a very basic GRUB menu configuration file designed to boot either Fedora or Microsoft Windows Vista:
default=0 
timeout=10 
splashimage=(hd0,0)/grub/splash.xpm.gz 
hiddenmenu 
title Fedora (2.6.27.19-170.2.35.fc10.i686)
root (hd0,1)
kernel /vmlinuz-2.6.27.19-170.2.35.fc10.i686 ro root=UUID=04a07c13-e6bf-6d5a-b207-002689545705 rhgb quiet
initrd /initrd-2.6.27.19-170.2.35.fc10.i686.img 

# section to load Windows 
title Windows         
rootnoverify (hd0,0)         
chainloader +1
This file configures GRUB to build a menu with Fedora as the default operating system and sets it to autoboot after 10 seconds. Two sections are given, one for each operating system entry, with commands specific to the system disk partition table.

Note

注​意​,default 被​设​置​为​一​个​整​数​。​这​指​定​了 GRUB 配​置​文​件​里​的​第​一​个 title 行​。​在​前​面​的​例​子​里​,如​果​要​把 Windows 设​置​为​缺​省​选​项​,你​可​以​把 default=0 修​改​为 default=1。​