CentOS Boot Process
To start CentOs, follow these steps:
I. POST power-on self-check
Post on self test (post on self test) first checks Each device, finds the device with a boot record, finds the Boot Record read into the operating system, and gives the system control to the Boot Record.
Ii. MBR Guidance
MBR (Master Boot Record), MBR records are generally in the disk 0 track 1 sector, a total of 512 bytes, the first 446 bytes are BootLoader, the last 4*16 bytes are used to store the partition information, and the last two bytes are used to verify the information.
Iii. GRUB kernel Loading
GRUB (GRand uniied Bootloader) is the first 446 bytes of MBR and is a type of Booloader. It is used to select the kernel to be started.
4. Start the init process
The init process is the first process started by the system. Other processes are controlled by the process fork. PID = 1.
1. Read the/etc/inittab and select the default level.
On my machine, the file content is as follows:
Id: 5: initdefault:
Indicates the multi-user mode. The graphic mode is supported.
2. Execute the initialization system script.
This script is in/etc/rc. d/rc. sysinit.
3. Run the script in/etc/rc. d/rcX. d /.
Because the default level I selected here is 5, all scripts under rc5.d will be read to control the services started or disabled when the system starts.
The scripts here are roughly divided into two types, starting with S and starting with K.
S: indicates that
K: indicates that the instance is not started at startup.
FILE command format, for example:
S01sysstat S boot start 01 boot sequence sysstat start Script Name
You can use chkconfig to link the script to auto-start upon startup.
Chkconfig-add SRC_SCRIPT add service
Chkconfig-del SRC_SCRIPT Delete Service
Chkconfig SRC_SCRIPT {on | off}
-Level 2345 specifies the default level
4. Run the/etc/rc. d/rc. local script.
This is the last script started during the startup process, and then the/bin/login user will be executed.