Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the process of booting Linux?

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the process of Linux boot". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the process of Linux boot".

Linux boot is divided into the following six steps, namely BIOS, MBR, GRUB, Kernel, Init, RunLevel, RunDefinition.

BIOS

The moment you press the power switch, start loading BIOS and execute MBR (Master Boot Record)

BIOS stands for the basic input system (Basic Input/Output System), which performs some system integrity check, searches, loads, and executes the bootstrap (boot loader), which looks for the bootstrap on the floppy disk, CD-ROM, or hard disk. You can change the boot order by pressing the keyboard (usually F12 or F2, but varies from system to system) when the system starts.

Once the bootstrapper is detected and loaded into memory, BIOS transfers control to it

MBR

MBR represents the master boot record (Master Boot Record)

Used to load and execute GRUB

GRUB

GRUB is the Multiboot Manager (GRand Unified Bootloader)

Execute / etc/grub.conf to load the kernel image

Vim / etc/grub.confdefault=0timeout=5splashimage= (hd0,0) / grub/splash.xpm.gzhiddenmenutitle CentOS 6 (2.6.32-504.el6.x86_64) root (hd0,0) kernel / vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/mapper/vg_ddz-lv_root rd_NO_LUKS rd_NO_MD rd_LVM_LV=vg_ddz/lv_root crashkernel=128M.UTF-8 rd_LVM_LV=vg_ddz/lv_swap KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quietinitrd / initramfs-2 .6.32-504.el6.x86_64.imgKernel

Execute the kernel's first process / sbin/init, process number 1, which is the parent of all other processes that follow

Initrd stands for Initial RAM Disk

Initrd is used by the kernel as a temporary root directory until the kernel boot is complete and the real root directory is mounted successfully. It also includes some compiled necessary drivers that help it access hard drives and other hardware

Init

Execute / etc/inittab to determine the startup level

Vim / etc/intttab# Default runlevel. The runlevels used are:# 0-halt (Do NOT set initdefault to this) # 1-Single user mode# 2-Multiuser, without NFS (The same as 3, if you do not have networking) # 3-Full multiuser mode (terminal mode) # 4-unused# 5-X11 (graphical user interface) # 6-reboot (Do NOT set initdefault to this) # id:5:initdefault:

Execute / etc/rc.d/rc.sysinit to start the system process, such as NetWork

RunLevel

Execute a series of system services corresponding to the startup level

The directory corresponding to the startup level is as follows

Ll / etc/rc.d/

Drwxr-xr-x. 2 root root 4096 November 29 09:49 rc0.ddrwxr-xr-x. 2 root root 4096 November 29 09:49 rc1.ddrwxr-xr-x. 2 root root 4096 March 10 17:18 rc2.ddrwxr-xr-x. 2 root root 4096 March 10 17:18 rc3.ddrwxr-xr-x. 2 root root 4096 March 10 17:18 rc4.ddrwxr-xr-x. 2 root root 4096 March 10 17:18 rc5.ddrwxr-xr-x. 2 root root 4096 November 29 09:49 rc6.dRunDefinition

Finally execute / etc/rc.d/rc.local to run the custom service

Vim / etc/rc.d/rc.local

1 #! / bin/sh2 # 3 # This script will be executed * after* all the other init scripts.4 # You can put your own initialization stuff in here if you don't5 # want to do the full Sys V style init stuff.67 touch / var/lock/subsys/local8 if test-f / sys/kernel/mm/transparent_hugepage/enabled; then9 echo never > / sys/kernel/mm/transparent_hugepage/enabled10 fi11 if test-f / sys/kernel/mm/transparent_hugepage/defrag Then12 echo never > / sys/kernel/mm/transparent_hugepage/defrag13 fi1415 / bin/bash / usr/local/apps/kylin/bin/kylin.sh start

In which the 15th behavior customizes the startup script

Final3

Enter the login interface

Thank you for your reading, the above is the content of "what is the process of Linux boot?" after the study of this article, I believe you have a deeper understanding of what the process of Linux boot is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report