1.啟動過程:
The bootprocess involves several files and errors in these files is the usual cause of
bootproblems.
啟動程序調用幾個檔案并在這幾個檔案中發生的錯誤通常是啟動問題的原因。
系統啟動後執行的操作:
1. Thecomputer's BIOS performs a power-on self-test (POST), and then locates andinitializes any
peripheraldevices including the hard disk.
電腦 BIOS執行上電自檢(POST), 然後,定位和初始化周邊裝置包括硬碟。
2. TheBIOS reads the Master Boot Record (MBR) into memory from the boot device. (ForGUID Partition
Table(GPT) disks, this MBR is the protective MBR on the first sector of the disk.)The MBR stores
informationabout the organization of partitions on that device. On a computer with x86architecture,
the MBRoccupies the first 512 bytes of the boot device. The first 446 bytes containboot code that
points tothe bootloader program, which can be on the same device or on another device.The next
64 bytescontain the partition table. The final two bytes are the boot signature, whichis used for error
detection.The default bootloader program used on Oracle Linux is GRUB, which stands forGRand
UnifiedBootloader.
BIOS從啟動裝置讀取主啟動記錄(MBR master boot record)到記憶體。(對于GUID 分區表磁盤(GPT磁盤),MBR是在第一磁盤扇區的保護MBR)MBR存儲關于裝置分區組織資訊。在一個 x86構架的電腦上,MBR占用啟動裝置的第一個512位元組。前面446個位元組包含指向bootloader程式的啟動碼,它可以在相同的裝置或者不同裝置。下面64位元組包含分區表。最後2個位元組是啟動簽名,用于錯誤檢測。預設用在oracle linux上的bootloader程式是GRUB, 代表GrandUnified Bootloader.
什麼是GUID?
全局唯一辨別符(GUID,GloballyUnique Identifier)
是一種由算法生成的二進制長度為128位的數字辨別符。
GUID 的格式為“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,其中每個 x 是 0-9 或 a-f範圍内的一個4位16進制數。
3. TheGRUB bootloader loads the Oracle Linux kernel into memory.
GRUB加載kernel到記憶體
4. Thekernel initializes and configures the system hardware.
kernel初始化并配置系統硬體
5. Thekernel reads the initramfs file, extracts its contents into a temporary,memory-based file system
(tmpfs),and loads the modules that the file system contains.
kernel讀取 initramfs檔案,提取其内容到臨時,基于記憶體的檔案系統(tmpfs),并加載檔案系統包含的子產品。
6. Thekernel starts the /sbin/init process with a process ID of 1 (PID 1). init isthe ancestor of all
processeson a system. init reads its job configuration from the /etc/init directory. The/etc/
init/rcS.conffile controls how init handles system initialization.
kernel使用程序号1開始/sbin/init程序。 init是所有系統程序的祖先。init會從/etc/init目錄讀取它的job配置檔案。/etc/init/rcS.conf檔案控制init怎麼樣處理系統初始化。
7. initreads /etc/inittab to determine the default run level. The entry in/etc/inittab should
take theform id:N:initdefault:, where N is the default run level. If the file does notdefine a
defaultboot level, the default run level is 3.
init讀取/etc/inittab決定預設的運作級别。/etc/inittab應該按照這種格式:id:N:initdefault:
8. initruns /etc/rc.sysinit to initialize thesystem, including:
settingthe host name
initializing the network
mounting the /proc file system
initializing SELinux based on its configuration
printing a welcome banner
initializing the system hardware based on kernel boot arguments
mounting the file systems
cleaning up directories in /var
starting swapping
init運作/etc/rc.sysinit來初始化系統,包括:
設定主機名
初始化網絡
挂載/proc檔案系統
初始化selinux
列印歡迎智語(/etc/motd)
初始化基于kernel啟動參數的系統硬體
挂載檔案系統
清理/var目錄
啟動swaping
9. initexecutes scripts in the /etc/rcX.ddirectory to bring the system to the default run level, X. The
/etc/init/rc.conffile controls how init starts individual run levels. See Section 4.3, “AboutRun
Levels”and Section 4.3.4, “About Service Scripts”.
init執行/etc/rcX.d目錄中的腳本來把系統帶到預設的運作級别。
/etc/init/rc.conf檔案控制init怎麼樣啟動單獨的運作級别。
10. initruns any actions that you have defined in /etc/rc.local.
init運作執行/etc/rc.local的語句
本文轉自chenzudao51CTO部落格,原文連結:http://blog.51cto.com/victor2016/1897356 ,如需轉載請自行聯系原作者