Show Table of Contents
E.8. GRUB選單設定檔案
配置檔案(BIOS 系統上為
/boot/grub/grub.conf,而 UEFI 系統上則為 /boot/efi/EFI/redhat/grub.conf)主要用於建立作業系統的清單,以用來啟動 GRUB 的選單介面,實質上是讓使用者選擇預先設定欲執行的指令群組。您可使用在〈節 E.7, “GRUB 指令”〉中所提供的指令,以及一些只能在配置檔案中使用的特殊指令。
E.8.1. 設定檔結構
用來為選單介面設置全域偏好設定的指令位於 GRUB 配置檔案的上端,接著為每個作業核心的小節或選單上列出的作業系統。
下列為設計來啟動 Red Hat Enterprise Linux 或 Microsoft Windows 的基本 GRUB 選單配置檔案:
default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.32.130.el6.i686) root (hd0,0) kernel /boot/vmlinuz-2.6.32.130.el6.i686 ro root=LABEL=/1 rhgb quiet initrd /boot/initrd-2.6.32.130.el6.i686.img # section to load Windows title Windows rootnoverify (hd0,0) chainloader +1
這個檔案會設定 GRUB 去建立一個以 Red Hat Enterprise Linux 為預設作業系統的選單,並設定其自動開機時間為 10 秒。在此提供了兩個部份,每個各有一個作業系統項目,以及特定系統磁碟分割區表格特屬的指令。
注意
請注意,預設設定為整數。這歸類於 GRUB 設定檔中的第一
title 行。在上個範例中,如於將 微軟視窗 扇區設為預設,將 default=0 更改為 default=1。
配置 GRUB 選單配置檔案,以啟動多重作業系統上的相關資訊並不涵蓋於此章節中。欲取得額外資源,請參照 節 E.10, “其它的資源”。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.