Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
9.4. GRUB 專業用語
在使用 GRUB 之前,了解程式與裝置間的關聯是很重要的,例如硬碟與分割區。特別是在設定用來啟動多重作業系統的 GRUB。
9.4.1. 裝置名稱
當 GRUB 引用特定裝置時,請用下列格式(請注意,括號以及逗點在語法結構上十分重要):
(<type-of-device><bios-device-number>,<partition-number>)
The <type-of-device> specifies the type of device from which GRUB boots. The two most common options are
hd
for a hard disk or fd
for a 3.5 diskette. A lesser used device type is also available called nd
for a network disk. Instructions on configuring GRUB to boot over the network are available online at http://www.gnu.org/software/grub/manual/.
The <bios-device-number> is the BIOS device number. The primary IDE hard drive is numbered
0
and a secondary IDE hard drive is numbered 1
. This syntax is roughly equivalent to that used for devices by the kernel. For example, the a
in hda
for the kernel is analogous to the 0
in hd0
for GRUB, the b
in hdb
is analogous to the 1
in hd1
, and so on.
The <partition-number> specifies the number of a partition on a device. Like the <bios-device-number>, most types of partitions are numbered starting at
0
. However, BSD partitions are specified using letters, with a
corresponding to 0
, b
corresponding to 1
, and so on.
注意
GRUB 的裝置編號系統一定是從
0
開始而非 1
。新使用者最常犯的錯誤就是將這裡弄錯。
舉例來說,如果一個系統有多於一個的硬碟,GRUB 會認定主硬碟為
(hd0)
然後次硬碟為 (hd1)
。以此類推 GRUB 會認定主硬碟上得主分割區為 (hd0,0)
,次硬碟上的第三分割區為 (hd1,2)
。
基本上下列為在 GRUB 下命名裝置與分割區的定律:
- 不論是 IDE 或是 SCSI,所有硬碟都以
hd
開頭。fd
是指 3.5 磁碟。 - 指定一個裝置的所有分割區,請不要填入逗號與分割區編號。但命令 GRUB 來為特定磁碟設定 MBR 是很重要的。例如,
(hd0)
指定 MBR 在主裝置上,(hd3)
指定 MBR 在第四裝置上。 - 如果系統上有多個磁碟裝置,知道 BIOS 中的磁碟開機順序是很重要的。如果系統僅用 IDE 或 SCSI 裝置並不複雜,但如果多種不同裝置類型,則選擇搭載開機分割區的磁碟類型為先就變得十分重要。