1.啓動過程:linux
The bootprocess involves several files and errors in these files is the usual cause of算法
bootproblems.api
啓動進程調用幾個文件並在這幾個文件中發生的錯誤一般是啓動問題的緣由。網絡
系統啓動後執行的操做:oracle
1. Thecomputer's BIOS performs a power-on self-test (POST), and then locates andinitializes anyapp
peripheraldevices including the hard disk.ide
電腦 BIOS執行上電自檢(POST), 而後,定位和初始化周邊設備包括硬盤。this
2. TheBIOS reads the Master Boot Record (MBR) into memory from the boot device. (ForGUID Partitionspa
Table(GPT) disks, this MBR is the protective MBR on the first sector of the disk.)The MBR storescode
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的語句