CentOS Boot Process detailed

Source: Internet
Author: User

CentOS Boot Process detailed


First, the Linux boot process:


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/80/wKiom1cCW7vjU_hWAAC8KD1ykwc014.png "title=" Start process 2.png "width=" "height=" 324 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:324px; "alt=" Wkiom1ccw7vju_hwaac8kd1ykwc014.png "/>

BIOS:A basic input output system, a set of programs that solidify onto a ROM chip on the motherboard of a computer, save the most important basic input and output of the computer, Post-boot self-test program and system self-start program, can read and write the system settings from CMOS specific information.

MBR: Master boot record, main boot record area.

boot Loader: Boot loader.


Second, detailed process


First step: Load the BIOS

Power on the computer, the computer hardware automatically loads the BIOS, reads the relevant hardware information in the BIOS and makes a self-test of the hardware system, and then finds the first bootable device based on the BIOS configuration.

Step two: Read MBR

The first sector of the No. 0 track on the hard disk is called the MBR, which is the master boot record, and the size is 512 bytes, which holds the pre-boot information and partition table information. After the system locates the MBR of the hard disk specified by the BIOS, it is copied to physical memory, and the content that is copied to the physical memory is boot Loader (LILO or GRUB).

Step three: Boot boot Loader

Boot Loader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device, set up a map of the memory space, so as to bring the system's hardware and software environment to a suitable state, in order to finally call the operating system kernel ready to do everything.
Boot Loader is available in several ways, including Grub and Lilo, which are common loader.
This article takes grub as an example to provide a menu that allows the user to select the system to be launched or a different kernel version, and to load the user-selected kernel into a specific space in RAM for decompression and expansion.

The system reads the GRUB configuration information in memory (typically menu.lst or grub.conf) and loads the specified kernel according to this configuration information.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/80/wKiom1cCXEaRzq4YAABXC8A_Oos886.png "title=" Grub.png "width=" 650 "height=" 378 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:650px;height:378px; "alt=" Wkiom1ccxearzq4yaabxc8a_oos886.png "/>

Fourth step: Load the kernel

Grub transfers control of the system to the kernel, and the kernel starts probing all recognizable hardware devices and attempts to mount the root directory to obtain its driver. The disk driver needs to be loaded first to read the disk, and the disk driver is stored on disk, which will cause Linux to fail to boot. This is a problem that needs to be addressed through a pseudo-file system.

The virtual file system (Initial RAM Disk) is/boot/initramfs-release.img, which is characterized by the ability to load into memory via the boot loader, which is then decompressed and simulated in memory as a root directory. And this simulation in the memory of the file system can provide a running program, through the program to load the boot process of the most needed core modules, usually these modules are U disk, RAID, LVM, SCSI and other file system and disk driver. When loading is complete, it will help the core to re-call/sbin/init to begin the subsequent normal startup process.

Note: RAMDisk is a secondary file and is not required, depending on whether the kernel can directly drive the device on which the root file system resides.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/7D/wKioL1cCXRGiHT-lAAA5nTCn_IE349.png "title=" Initramfs.png "width=" 650 "height=" 179 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:650PX;HEIGHT:179PX; "alt=" Wkiol1ccxrgiht-laaa5ntcn_ie349.png "/>

Fifth step: Run the/sbin/init program and set the Linux operating level

After the kernel is loaded, the first application running in user space is/sbin/init, then read the/etc/inttab file and set the system operation level according to the file configuration;

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7E/7D/wKioL1cCXTiTu_r6AACYkQQ5bLU894.png "title=" Runlevel.png "width=" 650 "height=" 153 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:650px;height:153px; "alt=" Wkiol1ccxtitu_r6aacykqq5blu894.png "/>

Sixth step: Init Process Execution Rc.sysinit
After setting the run level, the Linux system executes the/ETC/RC.D/RC.SYSINIT system initialization script. Initialization includes setting host name, setting welcome information, activating Udex and Seliux, mounting all file systems defined in/etc/fstab file, detecting root file system, setting system clock, setting kernel parameters according to/etc/sysctl.conf file, Activates LVM and soft raid devices, activates swap devices, loads drivers for additional devices, and performs cleanup operations.

Seventh Step: Boot the kernel module

The kernel module is loaded according to the files in the/etc/sysconfig/modules file directory.

Eighth step: Execute the run-level of each service start (script mode)

Depending on the runlevel, the system will run the appropriate script from RC0.D to RC6.D to perform the appropriate initialization and start the appropriate service.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/80/wKiom1cCXNKS3A-WAAA47K-_ENc316.png "title=" Rc.d.png "width=" 650 "height=" 311 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:650px;height:311px; "alt=" Wkiom1ccxnks3a-waaa47k-_enc316.png "/>

Nineth Step: Execute/etc/rc.d/rc.local
Rc.local is the place where Linux is left to the user to personalize after all initialization work. You can put the things you want to set up and start up here.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7E/7D/wKioL1cCXZ_C3uxBAAAbnHJ-VNY200.png "title=" RC Local.png "width=" 650 "height=" 165 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:650px;height:165px; "alt=" Wkiol1ccxz_c3uxbaaabnhj-vny200.png "/>

Tenth step: Execute/bin/login program, enter login status
Linux will start the terminal or X Window to wait for the user to log in .

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7E/7D/wKioL1cCXdGxPjpZAAAImY-7hhw078.png "title=" Long.png "width=" 650 "height=" 269 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:650PX;HEIGHT:269PX; "alt=" Wkiol1ccxdgxpjpzaaaimy-7hhw078.png "/>



CentOS Boot Process detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.