In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Boot process and service control learning content boot process troubleshooting startup class failure service air and switching operation level optimization startup process
System boot is the beginning of the operating system, before the user can log in to the system normally, the Linux operating system
The boot process will complete a series of initialization tasks and load the necessary programs and command terminals to prepare the user for login.
This section provides a brief introduction to the boot process of the Linux operating system.
Overview of the boot process
The boot process of Linux operating system generally includes the following stages: post, MBR boot, GRUB menu, loading Linux kernel, init process initialization.
Init process is loaded and run by Linux kernel / sbin/init program is the first process in the system PID (process tag) number is always 1Systemd unit type unit type extension description Service.service describes a system service Socket.socket describes an interprocess communication socket Device.device describes a kernel-recognized device file Mount.mount describes a file system mount point Automount.automount describes a file system A unified automatic mount point Swap.swap describes a memory swap device or swap file Path.path describes a file or directory in a file system Timer.timer describes a timer (used to implement cron-like scheduling tasks) Snapshot.snapshot is used to save the state of an systemd Scope.scope uses systemd's bus interface to programmatically create external processes Slice.slice describes a group of hierarchically organized cgroup Management system process Target.target describes a set of systemd unit runlevel Systemd target description 0target shutdown status Using this level will turn off the host 1rescue.target single-user mode, log in to the system without password authentication, and are mostly used for system maintenance 2multi-usr.target to define / domain-specific runlevels. The default is equivalent to the full multi-user mode of the 33multi-usr.target character interface, and most server hosts run the re-level 4multi-usr.target to define / domain-specific run levels. By default, it is equivalent to the multi-user mode of the 35graphical.target graphical interface, and provides a graphical desktop operating environment 6reboot.target restart. When using this level, the host will restart to repair the MBR sector failure caused by the virus * *, incorrect partition operations, disk read and write errors, failure to find the boot program, boot interrupt can not load the operating system. The idea of solving the problem of black screen after boot should be to make a backup file in advance to install the CD and boot into first aid mode to recover the experimental case from this sub-file.
I. Experimental steps
1. Back up the mbr boot sector to another disk
two。 Simulated destruction of the mbr boot sector
3. Boot mirror first aid mode for mbr sector recovery
The backup is complete at this time. The following simulated sabotage:
Then restart:
Found that can not restart, the boot code disappears, continue to restart, eye disease and quick hands! Press esc
At this point, create a new mount point and mount the backed up files.
Recovery is successful! Repair the cause of GRUB boot failure the GRUB boot program in MBR is damaged, the grub.conf file is missing, the boot configuration is incorrect, and the system boot is stagnant, showing the "grub >" prompt to try to enter the boot command manually to enter the first aid mode, rewrite or restore grub.conf from backup to MRB sector to rebuild the grub program experimental case.
Experimental steps for grub menu recovery
1. Boot first aid mode and load system image
two。 Re-establish the sda partition
3. Rebuild the grub menu function configuration file
Note: background file of grub startup menu configuration file of grub2 startup menu
At this point, the simulation destroys:
Restart
Also press esc when rebooting.
Load system image
Chroot / mnt/sysimage/
Rebuild sda
Grub2-install / dev/sda
Rebuild the grub menu profile
Grub2-mkconfig-o / boot/grub2/grub2.cfg
4. Exit the bash environment Exit
5. Restart Reboot
Forgotten root user password failure cause forgotten root user password failure phenomenon unable to carry out management operations that require root authority if there is no other available account, you will not be able to log in to the system to solve the problem and enter the first aid mode, reset the password experimental case to crack the centos7 root login password
1. Load mirroring system
two。 Modify the password
Enter password
After the change, restart:
Login directly to the system service control common ways: systemctl control type service name control type:
Srart: start
Stop: stop
Restart: restart
Seload: reloading
Status: review the running level of the service status Linux system
View run level
Runlevel Command Systemctl tool temporarily switch Runlevel Init Command Systemctl tool Experimental case
Here, systemctl isolate graphical.target=init5systemctl isolate multi-user.target=init3.
Optimized startup process system service management tool Ntsysv tool provides an interactive, visual window that can be run by character terminals for centralized management of multiple services Systemctl tools do not provide interactive, visual window management of single service more efficient system service startup and control ntsysv system service management tool ntsysv-level level list
View the startup status of the system service sysemctl is-enabled service name sets the startup status of the system service systemctl enable/disable service name opens by space cancel by space this chapter summarizes the Linux operating system boot process Linux system service control run-level switching optimization boot auto-loading service
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.