Linux operating system startup process detailed

  

Phase 1: BIOS boot boot phase

Implement hardware initialization and find boot media in this process

Load Boot Boot Manager (GRUB) from MBR and run it Boot Management

Phase 2: GRUB Boot Boot Phase

Load stage1

Load stage1.5

Load stage2

Read /boot/grub.conf file and display the boot menu

Load selected kernel and initrd files into memory

Stage 3: Kernel stage

Run kernel boot parameters

Decompress the initrd file and mount the initd filesystem, load the necessary drivers

Mount the root filesystem

Stage 4: Sys V init initialization phase

Start /sbin /init program

Run the rc.sysinit script, set the system environment, start the swap partition, check and mount the file system

Read the /etc/inittab file, run at Service with different runlevels defined in /et/rc.d/rc<#>.d



Open Character Terminal 1-6 Console /Open Graphic Display Management Console #<<>

Startup Process and Details

BIOS ==> bootloader ==> kernel & initrd .img ==> /sbin/init

1.bootloader (grub)

/boot/grub/grub.conf <-- grub configuration file, decide which kernel to use and Initrd.img

There are two stage files in the /boot/grub directory, where:

stage1 <--- the size is 512 bytes, this file will be written into the MBR

stage2 <--- After stage1 is booted, this file will be called

If there is a problem with grub, there may be two cases:

a. Cannot enter grub, Only one cursor appears in the upper left corner of the screen. In this case, basically the MBR has been destroyed and needs to enter the rescue mode for repair.

--> chroot environment, execute "grub-install /boot where partition" to fix

--> When there is no grub related command, install grub.rpm package to recover

--> When there is no relevant vmlinuz and initrd.img files in the /boot directory, install the kernel.rpm package to fix it

--> No grub.conf needs to be manually fixed

b.grub is successfully loaded, and <quo;grub>” appears on the screen, indicating that the configuration file grub.conf cannot be found.

--> Manual Repair

2.kernel & initrd.img

When loading vmlinuz and initrd: kernel panic, basically grub.conf settings There is a problem with the parameters.

--> Check if there is a problem with grub.conf writing

--> It may also be a partition setting or hard disk corruption, etc., you need to enter rescue mode check

3./sbin/init

The configuration file for /sbin/init is /etc/inittab

According to this configuration file, the following scripts will be executed in order:

-- -> /etc/rc.d/rc.sysinit

Define hostname, remount each partition, load each module

---> /etc/rc.d/rc [0-6] scripts starting with S in the .d/directory

Starting services for each runlevel

---> mingetty /dev/tty[1-6]

Enable Terminal



Copyright © Windows knowledge All Rights Reserved