Centos system startup process

  Introduction: Because centos7 using systemd init process changes is relatively large, here introduces the use of the boot process and centos5 6.
First a rough start on the flow chart
Centos system startup process
The first step: POST POST
  POST is part of the BIOS functions, responsible for CPU, motherboard, memory and other hardware self-test work.
Step two: BootLoader boot loader
  which is responsible for guiding the system starts, the current mainstream linux are using GRUB2 boot loader, which is responsible to find a kernel file, providing grub menu.
The third step: loading the kernel file
  by the above kernel boot files to load into memory decompressor, a total of four steps:

   1.探测可识别到的所有硬件设备。
   2.加载硬件驱动程序(它是借助于ramdisk/ramfs加载的)
   3.以只读的方式挂载文件系统
   4.运行用户空间的第一个程序:/sbin/init

init initialization
  1. init is acquired according to a run-level configuration file, and acquires the system initialization script file path (file init centos5 of / etc / inittab, centos6 split / etc / inittab files for multiple files).
  2. Read the system initialization script /etc/rc.d/rc.sysinit, and follow the script content.

  1. Set the host name
  2. A banner
  3. Selinux and activate udev
  4. Mount the / etc / fstab file defined file system
  5. Detecting the root file system, and read-write file system remounting
  6. Set the system clock
  7. Activate the swap set
  8. Setting kernel parameters according to the /etc/sysctl.conf file
  9. Activate lvm equipment and software raid
  10. Load additional device drivers
  11. Cleanup operations

  According to acquire the previous run level, run the script file /etc/rc.d/rc
/etc/rc.d/ there are several rc # .d directory (the # represents the number, also run level) of the file, its directory files in the file is connected only to the service script files in /etc/init.d/, according to the linked file in the default run level and /etc/rc#.d in / etc / inittab acquired startup and shutdown system services, must now also think of why start at different levels of service is not the same, why some start-up service, but some close links to files in the /etc/rc#.d/ beginning with K or S, K indicates the startup of service to be stopped, S for the boot to be started service, and the service script, there will be a priority,

K : K ## : ## execution order; the smaller the number, the first operation; the smaller the number of services, is generally dependent on the level of service
S : ## S : ## execution order; the smaller the number, the first run ; smaller number of services are often relied upon to service
Centos system startup process

  In 2345 the level of /etc/rc#.d directory will have a rc.local file, link it to /etc/rc.d/rc.local, it is not a startup file, it is actually an ordinary file, if What do you want to boot operating you can write this file.
Step Four: Start the terminal program
  here is what to look at in the end run level, if it is a graphical interface directly into the graphical interface.
Step five: the user logs on
  to the system startup done here.
Because relatively large changes in version comparison system initialization process command
init command:
Centos system startup process
Set command boot comparison
Centos system startup process
Centos system startup process
again a system diagram start:
Centos system startup process
system start detailed map:
Centos system startup process

Guess you like

Origin blog.51cto.com/13449039/2409542