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 裝​​​​​​​置​​​​​​​並​​​​​​​不​​​​​​​複​​​​​​​雜​​​​​​​,但​​​​​​​如​​​​​​​果​​​​​​​多​​​​​​​種​​​​​​​不​​​​​​​同​​​​​​​裝​​​​​​​置​​​​​​​類​​​​​​​型​​​​​​​,則​​​​​​​選​​​​​​​擇​​​​​​​搭​​​​​​​載​​​​​​​開​​​​​​​機​​​​​​​分​​​​​​​割​​​​​​​區​​​​​​​的​​​​​​​磁​​​​​​​碟​​​​​​​類​​​​​​​型​​​​​​​為​​​​​​​先​​​​​​​就​​​​​​​變​​​​​​​得​​​​​​​十​​​​​​​分​​​​​​​重​​​​​​​要​​​​​​​。​​​​​​​