Show Table of Contents
E.7. GRUB 指令
GRUB 在指令列介面下有數項有用的指令。有些指令之後可以接受其它選項,這些選項應該與指令本身分開,而其它選項之間需保有一個空位字元。
以下的清單為可使用的選項:
boot— 啟動作業系統或最後載入的連續載入器。chainloader </path/to/file>— 載入如連續載入器的指定檔案。如果該檔案位於指定分割區的第一扇區,使用 blocklist 標記法,+1,而非檔案名稱。下列為範例chainloader指令:chainloader +1displaymem— 依據 BIOS 的資訊,顯示目前使用中的記憶體。這適用於在開機前決定系統需要多少記憶體。initrd </path/to/initrd>— 讓使用者能夠在開機時指定一個欲使用的初始記憶體磁碟(RAM disk)。當 kernel 需要特定模組來正常開機時將會需要initrd,例如當 root 分割區格式化為 ext3 或 ext4 檔案系統時。下列為一initrd指令範例:initrd /initrd-2.6.8-1.523.imginstall <stage-1> <install-disk> <stage-2>— 將 GRUB 安裝至系統 MBR。pconfig-file<stage-1>— 表示一個可以找到主開機管理程式映像檔裝置、分割區或一個檔案,例如(hd0,0)/grub/stage1。<install-disk>— 指定用來安裝第一階段開機管理程式的磁碟,例如(hd0)。<stage-2>— 將第二階段開機管理程式的位置傳給第一階段管理程式,例如(hd0,0)/grub/stage2。p<config-file>— 這個選項命令install指令來搜尋由<config-file>指定的選單設定檔,例如(hd0,0)/grub/grub.conf。
警告
install指令覆蓋任何已經存在 MBR 的資訊。kernel </path/to/kernel> <option-1> <option-N>... — 指定在啟動作業程式時所載入的核心檔案。將 </path/to/kernel> 替換為一個從 root 指令指定的分割區的完整途徑。將 <option-1> 替換為 Linux 核心選項,例如root=/dev/VolGroup00/LogVol00來指定系統 root 分割區所在的裝置。可以傳送多個選項至核心,但必須以空間字元隔開。下列為kernel指令範例:kernel /vmlinuz-2.6.8-1.523 ro root=/dev/VolGroup00/LogVol00上個範例中的選項指定位於hda5分割區的 Linux root 檔案系統。root (<device-type><device-number>,<partition>)— 設定 GRUB 的 root 分割區 例如(hd0,0),並掛載分割區。下列為root指令範例:root (hd0,0)rootnoverify (<device-type><device-number>,<partition>)— 設定 GRUB 的 root 分割區,如同root指令,但不掛載分割區。
輸入
help --all 來瀏覽其它可用的指令。有關於 GRUB 指令,請參照網上文件 http://www.gnu.org/software/grub/manual/。

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.