CentOS 6 System Startup process

Source: Internet
Author: User

CentOS 6 used in the Bootloader Program for Grub , Init to be Upstart . The approximate flowchart for booting up is as follows:


650) this.width=650; "style=" float:left; "src=" http://s3.51cto.com/wyfs02/M01/72/A3/ Wkiom1xpkklcxmiqaacfsvuym98739.jpg "title=" boot flowchart. png "alt=" wkiom1xpkklcxmiqaacfsvuym98739.jpg "/>

The step diagram is decomposed as follows:

1 , power-on self-test, when powered on, the computer passes BIOS to load CMOS information, obtain the host hardware configuration, and will be hardware detection and hardware initialization.

2 , BIOS according to Boot Sequence (device boot order) to obtain the first bootable device. In order, if the current device does not have an mbr , skip the current device to find the next device until The device containing the MBR is found. If the MBR is damaged and so on, the boot fails and does not continue looking down on the bootable device. Otherwise, do the next step.

3 bios mbr bootloader bios init in the first sector of a hard disk device. mbr

       due to mbr bootloader occupies 446 Span style= "Font-family:simsun;" -bytes, which are stored in mbr bootloader bootloader mbr is stored in the bootloader The main program, configuration-related files are stored in the file system.

Grupfunctions are completed by three modules:Stage1,stage1_5and theStage2. Stage1that is stored inMBRin theBootloader,stage1_5stored inMBRback of the sector, andStage2is typically stored in the file system,/ Bootdirectory. Stage1and thestage1_5The task to be completed is to load theStage2,Stage2is the module that implements the function. Stage1does not recognize the file system and therefore needs to be loadedstage1_5, whilestage1_5The ability to identify the file system, so it can be loaded into the file systemStage2module. Note: WhenStage1can identifyStage2when you secure the physical space for storage, you do not need to passstage1_5you can directly loadStage2.

Stage2 after loading the relevant configuration file, the following functions are implemented:

    • Provides a selection menu, and provides an interactive interface.

Users can choose different startup options to achieve multi-boot function; code.

    • load the kernel file (or Initramfs )

Point directly to the location where the kernel files are located to start the operating system.

    • Transfer to other Loader

Transfer the boot function to the other Loader responsible.

4 , Kernel is loaded into memory to start its own initialization, the main operation is to detect all the hardware devices can be identified and load the appropriate hardware driver; For security purposes, mount the root file system read-only, (wait until the boot is complete, the functions are normal, and then read and write again); The first application that invokes user space /sbin/init.

   because kernel The disk is not recognized, so use the initramfs Gets the driver for the disk. Initramfs like a thin kernel, It contains the modules required during the boot process (determines which hard drive is required when the system is installed, and is integrated into the ). initramfs Span style= "FONT-FAMILY:CALIBRI;" >kernel can identify the disk, generally need init

  • The root directory is the same disk as SATA,SCSI,SAS,USB interface, except for the IDE

  • The root directory is located in the file system for LVM,RAID and other formats

  • Other modules that must be provided when the kernel is loaded

5 , Init The main function is to prepare the environment for the execution of the software, call the execution of the relevant script file to implement,

such as/etc/inittab,/etc/init/*.conf, etc.

    • Get the default run level,/etc/inittab

    • system initialization, /etc/rc.d/rc.systinit

    • Turn off or start the service at the corresponding level, and start the boot terminal, etc.,/etc/init/*.conf and/ETC/RC.D/RC#.D


What to do when the/etc/rc.d/rc.sysinit is initialized

(1) Set host name

(2) Setting welcome information

(3) Activate Udev and SELinux

(4) Mount the file system defined in the/etc/fstab file

(5) Detecting the root file system and re-mounting the root filesystem in read and write mode

(6) Setting the system clock

(7) Activate swap device

(8) Set kernel parameters according to/etc/sysctl.conf file

(9) Activating LVM and software RAID devices

(10) Loading drivers for additional devices

(11) Cleaning operation


This article is from the "Learning World" blog, please be sure to keep this source http://letitbe1028.blog.51cto.com/7901525/1691395

CentOS 6 System Startup process

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.