1. 程式人生 > >[中英對照]Booting Process in Linux RHEL 7 | Linux RHEL 7啟動過程

[中英對照]Booting Process in Linux RHEL 7 | Linux RHEL 7啟動過程

quick .org org lin really conf linked 傳統 temp

Booting Process in Linux RHEL 7 | Linux RHEL 7啟動過程

In this post, I will guide you booting process in linux RHEL 7, it is very important to know the linux booting process to troubleshoot and fix boot issues. Redhat 7 replaced the init process (/sbin/init) with systemd (/usr/lib/systemd/systemd), systemd provides considerably more control compared to the init process does, although still supporting existing init scripts.
在本文中,我將引導你了解Linux RHEL 7的啟動過程。了解Linux的啟動過程對排除故障和修復啟動問題來說非常重要。RedHat 7使用systemd(/usr/lib/systemd/systemd)替換init進程(/sbin/init)。與傳統的init進程相比,systemd提供了更多的啟動控制,雖然它仍支持現有的init腳本。

技術分享

Linux boot process step by step:
Linux的啟動過程

1. BIOS (Perform POST) | BIOS (執行上電自檢Power On Self Test)
2. MBR (loads GRUB2) | 加載GRUB2
3. GRUB2

  • Loads the vmlinuz kernel image 加載vmlinuz內核映像
  • Extract the contents of initramfs image 提取initramfs映像中的內容

4. KERNEL

  • Loads necessary driver modules from initrd image 從initrd映像中加載必要的驅動模塊
  • Systemd starts systems first process systemd啟動系統中第一個進程

5. SYSTEMD

  • Reads conf files from /etc/systemd 從/etc/systemd中讀取配置文件
  • Reads file linked by /etc/systemd/system/default.target 讀取/etc/systemd/system/default.target指向的文件
  • Brings the system to the state defined by the system target 將系統引導到由system target定義的狀態

技術分享

RHEL 7 booting process:
RHEL 7啟動過程

BIOS:
BIOS Full Form is Basic Input/Output System, It is a software which helps in booting process when the power is on, it executes the power on self test (POST) to identify, test and initialize system hardware components and its loads the MBR.
BIOS代表的是基本的輸入輸出系統,它是一個幫助開機的軟件,當上電後,它執行開機自檢(POST)來識別、測試和初始化系統硬件部件,加載主引導記錄(MBR)。

Master boot record (MBR)
It is the information in the first sector (512 bytes) of any Linux booting disk drive that identifies where and how an operating system is situated. Out of 512 bytes Boot-loader contains in 446 bytes, next 64 bytes contains the partition table for the disk. Last 2 bytes is called Magic number, which is used for error detection. MBR detects the bootable device and loads the GRUB2 boot loader into memory and transfers control over to it.
XXXX

技術分享

GRUB2 Bootloader:
GRUB stands for GRand Unified Boot-loader. In Redhat 7, GRUB 2 is the default boot loader program, GRUB boot loader was used in previous RHEL versions. Configuration file for GRUB2 is located at /boot/grub2/grub.cfg. GRUB2 do a search for vmlinuz kernel image file in the /boot and loads the vmlinuz kernel image file into memory and extract the items in the initramfs image file into tmpfs (temporary file system).
XXXX

initramfs: It will pre-load the block devices modules, for example: SCSI, IDE, so that the root file system, on which those modules normally reside, can then be accessed and mounted.
XXXX

KERNEL:
The initramfs is bound to the kernel and the kernel mounts this initramfs as part of a two-stage boot process.
Kernel starts the systemd process with a process ID of 1 (PID 1).
XXXX

SYSTEMD:
systemd is an init system used in boot process in linux RHEL 7 to bootstrap the user space and manage all processes subsequently. systemd brings the machine to the state based on the system target, performing system initialization tasks such as:
XXXX

  • Initializing the Network
  • Setting the Host-name
  • Initializing SE-Linux
  • Initializing the system hardware based on kernel boot arguments
  • Mounting the file systems, including virtual file systems such as the /proc file system
  • Starting swapping

I hope this article provides you the information about, Booting Process in Linux RHEL 7. Thank you for studying!!. Be Social and share it in social media,if you really feel worth sharing it.
XXXX

擴展閱讀

  • A Basic Guide to Linux Boot Process
  • 6 Stages of Linux Boot Process (Startup Sequence)
  • How Linux Boots, Run Levels, and Service Control
  • Quick HOWTO : Ch07 : The Linux Boot Process
  • Inside the Linux boot process
  • Wikipedia: Linux startup process
  • Systemd Boot Process a Close Look in Linux

[中英對照]Booting Process in Linux RHEL 7 | Linux RHEL 7啟動過程