当前位置:网站首页>Guidance process and service control
Guidance process and service control
2022-07-21 04:29:00 【Jijijijijijijiji】
Catalog
One 、Linux Operating system boot process
1、 Self checking on startup (BIOS)
Linux Operating system boot process summary :
Two 、 System initialization process
Run level corresponding to Systemd The goal is
3、 ... and 、 Troubleshoot startup failures
One 、Linux Operating system boot process
1、 Self checking on startup (BIOS)
After the server is turned on , Will be based on the motherboard BIOS The settings in are right for CPU、 Memory 、 The graphics card 、 Keyboard and other equipment for preliminary testing , After successful detection, the system control is transferred according to the preset startup sequence , Most of the time, it will be handed over to the local hard disk .
summary : Detect the first device that can boot the system , Such as hard disk or optical drive
2、MBR guide
When booting the system from the local hard disk , First, according to the first sector of the hard disk MBR ( Master boot record ) Set up , Pass system control to the partition that contains the operating system boot file ; Or directly based on MBR The boot information in the record calls the boot menu ( Such as GRUB) .
summary : Run on MBR Boot in sector GRUB Bootstrap
3、GRUB menu
about Linux For the operating system ,GRUB ( Unified boot loader ) Is the most widely used multi system bootloader program . Control of the system is passed on to GRUB in the future , The Startup menu will be displayed for the user to choose , And according to the selection ( Or use the default value ) load Linux Kernel files , Then transfer control of the system to the kernel .
CentOS 7 It's using GRUB2 Start the bootloader .
summary :GRUB The bootstrapper reads GRUB The configuration file /boot/grub2/grub.cfg, To get the settings and path locations of the kernel and image file system
4、 Loading kernel (kernel)
Linux The kernel is a special pre compiled binary , Between various hardware resources and system programs , Responsible for resource allocation and scheduling . After the kernel takes control of the system , Will be in full control of the whole Linux The operation of the operating system , stay Centos In the system , The default kernel file is located in “/boot/vmlinuz-3.10.514.e17.x86_64”.
summary : Load the kernel and image file system into memory
5、init Process initialization
In order to complete the further system boot process ,Linux The kernel first converts "/sbin/init" Program loaded into memory to run ( A running program is called a process ),init The process is responsible for the initialization of the whole system , Finally, wait for the user to log in .
summary : Loading hardware drivers , The kernel puts init The process is loaded into memory to run
Linux Operating system boot process summary :
1、 Self checking on startup : Power on test hardware
2、MBR guide : Know what system program to load ( It will refer to user-defined ---BIOS)
3、GRUB2 menu : Submit menu ( Need to load 、 Program started ) Ready for the kernel
4、 Loading kernel : Load the core program 、 Memory and image ( Put it in memory )
5、init Process initialization : Start the system program in the menu ( Put it in memory )
Two 、 System initialization process
init process
from Linux The kernel loads and runs /sbin/init Program
init Process is the first process in the system
init Process PID( Process tag ) The number will always be 1
Systemd
systemd yes linux One of the operating systems init Software
centos7 The new systemd Starting mode , Replace the traditional sysvinit
centos7 The first one running in init The process is /lib/systemd/system/
The first program loaded by the system is init
The tools of the system management program are systemd,systemd The command program of is :systemctl.
Systemd Unit type
Unit type | Extension | explain |
service | .service | Describe a system service |
sockt | .sockt | Describes a socket for interprocess communication |
device | .device | Describe a device file identified by the kernel |
mount | .mount | Describe the mount point of a file system |
automount | .automount | Describes the auto mount point of a file system |
swap | .swap | Describe a memory swap device or swap file |
path | .path | Describe a file or directory in a file system |
timer | .timer | Describe a timer ( Used to implement similar cron Scheduling tasks for |
snapshot | .snapshot | Used to save a systemd The state of |
scope | .scope | Use systemd To create external processes programmatically |
slice | .slice | Describe cgroup A group of management system processes that are organized hierarchically |
target | .target | Describe a group systemd Unit of |
Run level corresponding to Systemd The goal is
Operation level | Systemd Of target | explain |
0 | target | Shutdown status , Using this level will shut down the host |
1 | rescue.target | Single user mode , You can log in to the system without password verification , For system maintenance |
2 | multi-user.target | User defined / Domain specific runlevels . Default is equivalent to 3 |
3 | multi-user.target | Full multi user mode of character interface , Most server hosts run at this level |
4 | multi-user.target | User defined / Domain specific runlevels . Default is equivalent to 3 |
5 | graphical.target | The multi-user mode of graphical interface , Provides a graphical desktop operating environment |
6 | reboot.target | Restart , Using this level will restart the host |
3、 ... and 、 Troubleshoot startup failures
1、 Repair MBR Sector failure
The cause of the problem
Trojan horse , The cause of the virus
Incorrect partition operation , Disk read and write operations
The fault phenomenon
Bootloader not found
Unable to load operating system , Black screen after power on
Solutions
Backup files well in advance
Enter first aid mode
Recover from backup files
2、 Repair GRUB Boot failure
The cause of the problem
MBR Medium RGU The bootloader is broken
grub.conf file missing , Wrong boot configuration
The fault phenomenon
System guidance stalls , Show grub> Prompt
Solutions
Try entering the boot command manually
Enter first aid mode , Rewrite or restore from backup
towards MBR Reconstruction in sector grub Program
3、 forget root password
The cause of the problem
Forget the password for various reasons
The fault phenomenon
Unable to proceed root Authority management operation
There is no way to root User login system
Solutions
Enter first aid mode , Reset password
边栏推荐
- There are n integers in total. One bit can be divided by 1, two bits can be divided by 2, and three bits can be divided by 3, N bits can be divided by n. Find the largest number that meets this condit
- 北京双线机房的一些分析
- Account and authority management
- XShell安装配置教程
- Shell脚本数组与冒泡排序
- 北京BGP机房的发展历程
- 服务器硬件及RAID配置
- shell脚本之for循环
- Top, pgrep, pstree, jobs, at, crontab commands in process and scheduled task management
- PXE高效网络装机、Kickstart无人值守安装
猜你喜欢
随机推荐
Mysql 安装
File system and log analysis
SSH远程管理及sshd服务支持验证方式
不知道 MySQL 咋学?刷完牛客这 50 道题就够了!(第六篇)
ARP principle
SNAT and DNAT
Installation and management procedures
JSON解析
Regular expression and shell Three Musketeers (grep, egrep, SED, and awk) tools
CPU平均负载过高检查(iowait负载高)
Qixin Jushi cloud spectrum new chapter | Haitai Fangyuan and Sichuan Unicom reach ecological strategic cooperation
SSH Remote Management and sshd service support verification method
One bite of Stream(1)
天坛机房项目成果汇报
什么是FTP
DHCP原理及配置
Bond network mode
How much does it cost to buy a kitchen knife that can shoot garlic? Get the price of kitchen knife by crawling
What is FTP
Quota of disks