Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

9.2. GRUB

GNU GRand Unified Boot loader (GRUB)是​​​​​​​一​​​​​​​個​​​​​​​能​​​​​​​夠​​​​​​​在​​​​​​​系​​​​​​​統​​​​​​​開​​​​​​​機​​​​​​​時​​​​​​​選​​​​​​​擇​​​​​​​安​​​​​​​裝​​​​​​​系​​​​​​​統​​​​​​​或​​​​​​​載​​​​​​​入​​​​​​​核​​​​​​​心​​​​​​​的​​​​​​​程​​​​​​​式​​​​​​​。​​​​​​​同​​​​​​​時​​​​​​​也​​​​​​​讓​​​​​​​使​​​​​​​用​​​​​​​者​​​​​​​能​​​​​​​將​​​​​​​參​​​​​​​數​​​​​​​傳​​​​​​​遞​​​​​​​給​​​​​​​核​​​​​​​心​​​​​​​。​​​​​​​

9.2.1. GRUB以​​​​​​​及​​​​​​​ x86 開​​​​​​​機​​​​​​​程​​​​​​​序​​​​​​​

GRUB 依​​​​​​​下​​​​​​​列​​​​​​​階​​​​​​​段​​​​​​​步​​​​​​​驟​​​​​​​將​​​​​​​本​​​​​​​身​​​​​​​載​​​​​​​入​​​​​​​記​​​​​​​憶​​​​​​​體​​​​​​​中​​​​​​​:
  1. The Stage 1 or primary boot loader is read into memory by the BIOS from the MBR[4]. The primary boot loader exists on less than 512 bytes of disk space within the MBR and is capable of loading either the Stage 1.5 or Stage 2 boot loader.
  2. 如​​​​​​​果​​​​​​​有​​​​​​​必​​​​​​​要​​​​​​​,1.5 階​​​​​​​段​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​會​​​​​​​由​​​​​​​ 1 階​​​​​​​段​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​寫​​​​​​​入​​​​​​​記​​​​​​​憶​​​​​​​體​​​​​​​中​​​​​​​ 某​​​​​​​些​​​​​​​硬​​​​​​​體​​​​​​​會​​​​​​​需​​​​​​​要​​​​​​​經​​​​​​​過​​​​​​​緩​​​​​​​衝​​​​​​​階​​​​​​​段​​​​​​​到​​​​​​​第​​​​​​​ 2 階​​​​​​​段​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​。​​​​​​​尤​​​​​​​其​​​​​​​是​​​​​​​當​​​​​​​硬​​​​​​​碟​​​​​​​ /boot/ 分​​​​​​​割​​​​​​​區​​​​​​​大​​​​​​​於​​​​​​​ 1024 磁​​​​​​​柱​​​​​​​,或​​​​​​​當​​​​​​​使​​​​​​​用​​​​​​​ LBA 模​​​​​​​式​​​​​​​時​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​ /boot/ 分​​​​​​​割​​​​​​​區​​​​​​​或​​​​​​​者​​​​​​​一​​​​​​​小​​​​​​​部​​​​​​​分​​​​​​​於​​​​​​​ MBR 與​​​​​​​一​​​​​​​小​​​​​​​部​​​​​​​份​​​​​​​於​​​​​​​ /boot/ 分​​​​​​​割​​​​​​​區​​​​​​​。​​​​​​​
  3. 第​​​​​​​ 2 階​​​​​​​段​​​​​​​或​​​​​​​次​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​寫​​​​​​​入​​​​​​​記​​​​​​​憶​​​​​​​體​​​​​​​ 次​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​顯​​​​​​​示​​​​​​​在​​​​​​​ GRUB 目​​​​​​​錄​​​​​​​與​​​​​​​指​​​​​​​令​​​​​​​環​​​​​​​境​​​​​​​。​​​​​​​這​​​​​​​個​​​​​​​介​​​​​​​面​​​​​​​允​​​​​​​許​​​​​​​使​​​​​​​用​​​​​​​者​​​​​​​選​​​​​​​擇​​​​​​​要​​​​​​​啟​​​​​​​動​​​​​​​哪​​​​​​​個​​​​​​​核​​​​​​​心​​​​​​​或​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​,將​​​​​​​參​​​​​​​數​​​​​​​傳​​​​​​​至​​​​​​​核​​​​​​​心​​​​​​​,或​​​​​​​檢​​​​​​​查​​​​​​​系​​​​​​​統​​​​​​​參​​​​​​​數​​​​​​​。​​​​​​​
  4. 次​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​會​​​​​​​將​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​或​​​​​​​核​​​​​​​心​​​​​​​以​​​​​​​及​​​​​​​ /boot/sysroot/ 的​​​​​​​內​​​​​​​容​​​​​​​寫​​​​​​​入​​​​​​​記​​​​​​​憶​​​​​​​體​​​​​​​。​​​​​​​在​​​​​​​ GRUB 決​​​​​​​定​​​​​​​要​​​​​​​啟​​​​​​​始​​​​​​​哪​​​​​​​個​​​​​​​作​​​​​​​業​​​​​​​程​​​​​​​式​​​​​​​或​​​​​​​核​​​​​​​心​​​​​​​後​​​​​​​,它​​​​​​​會​​​​​​​載​​​​​​​入​​​​​​​並​​​​​​​將​​​​​​​電​​​​​​​腦​​​​​​​控​​​​​​​制​​​​​​​權​​​​​​​轉​​​​​​​移​​​​​​​給​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​。​​​​​​​
用​​​​​​​來​​​​​​​啟​​​​​​​動​​​​​​​ Red Hat Enterprise Linux 的​​​​​​​方​​​​​​​式​​​​​​​稱​​​​​​​為​​​​​​​ 直​​​​​​​接​​​​​​​載​​​​​​​入​​​​​​​,因​​​​​​​為​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​可​​​​​​​以​​​​​​​直​​​​​​​接​​​​​​​啟​​​​​​​動​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​。​​​​​​​開​​​​​​​機​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​式​​​​​​​與​​​​​​​核​​​​​​​心​​​​​​​之​​​​​​​間​​​​​​​並​​​​​​​沒​​​​​​​有​​​​​​​緩​​​​​​​衝​​​​​​​階​​​​​​​段​​​​​​​。​​​​​​​
其​​​​​​​它​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​的​​​​​​​開​​​​​​​機​​​​​​​程​​​​​​​序​​​​​​​也​​​​​​​許​​​​​​​會​​​​​​​不​​​​​​​同​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​ 微​​​​​​​軟​​​​​​​® 視​​​​​​​窗​​​​​​​® 作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​以​​​​​​​及​​​​​​​其​​​​​​​它​​​​​​​的​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​使​​​​​​​用​​​​​​​ 連​​​​​​​鎖​​​​​​​載​​​​​​​入​​​​​​​ 的​​​​​​​開​​​​​​​機​​​​​​​模​​​​​​​式​​​​​​​。​​​​​​​在​​​​​​​這​​​​​​​種​​​​​​​方​​​​​​​式​​​​​​​下​​​​​​​,MBR 指​​​​​​​出​​​​​​​搭​​​​​​​載​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​分​​​​​​​割​​​​​​​區​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​扇​​​​​​​區​​​​​​​,在​​​​​​​這​​​​​​​個​​​​​​​扇​​​​​​​區​​​​​​​存​​​​​​​有​​​​​​​啟​​​​​​​動​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​所​​​​​​​需​​​​​​​的​​​​​​​檔​​​​​​​案​​​​​​​。​​​​​​​
GRUB 支​​​​​​​援​​​​​​​直​​​​​​​接​​​​​​​以​​​​​​​及​​​​​​​連​​​​​​​鎖​​​​​​​載​​​​​​​入​​​​​​​兩​​​​​​​種​​​​​​​開​​​​​​​機​​​​​​​模​​​​​​​式​​​​​​​,並​​​​​​​讓​​​​​​​它​​​​​​​啟​​​​​​​動​​​​​​​絕​​​​​​​大​​​​​​​部​​​​​​​分​​​​​​​的​​​​​​​作​​​​​​​業​​​​​​​系​​​​​​​統​​​​​​​。​​​​​​​

警告

During installation, Microsoft's DOS and Windows installation programs completely overwrite the MBR, destroying any existing boot loaders. If creating a dual-boot system, it is best to install the Microsoft operating system first.


[4] For more on the system BIOS and the MBR, refer to 節 30.2.1, “BIOS”.