Solve the problem that Linux system can't boot

  
                  

When your beloved Linux system fails, how do you solve it? No operating system ensures 100% reliability. One day, even the Linux system will not start. This article gives you some strategies for using Linux workstations that do not start properly.

No matter how much you love your Linux system, sometimes you have to restore your system. Yes, even a Linux system machine can suffer a system crash: this is inevitable whether it is due to a video configuration error, a kernel update error, or an init script configuration error. I've seen a lot of this, and even on my own machine, most of it is due to an X configuration error, which is really frustrating.

Using the correct runlevel

After installing a new Linux system, I immediately took steps to ensure that the disaster does not happen easily. One of the measures is to edit the operating level of the system. The run level tells the system how far it is from taking the boot process. The running level is divided into six levels:

Level 0: Stop (do not set initdefault)

Level 1: Single User Mode

Level 2: Multi-user mode, no NFS (Same as level 3, if you don't have a network)

Level 3: Complete multi-user mode

Level 4: Not used

Level 5: X11

Level 6: Restart (do not set initdefault)

The new Linux system almost always uses Run Level 5 (X11) by default, indicating that the system will stop at the graphical login interface after the boot is complete. . The system works fine before something (or someone) uses the X configuration.

Then you have to find a login method. You can press [Ctrl][Alt][F7] to enter a text-based virtual window, but why bother? Otherwise, I always change the runlevel to level 3 in the /etc/inittab file. The code you changed is:

id:5:initdefault:

It is changed to:

id:3:initdefault:

When X is wrong This is a very simple method of system recovery.

Multi-Core

Another obvious method of disk recovery is to always install a working kernel. I usually work on a kernel that is updated via yum. Sometimes, the kernel will have some errors that prevent one or more of my machines from starting.

To avoid this, I always promise to use at least one functioning kernel on my machine. To solve this problem, first add plugins=1 to the /etc/yum.conf file, then apply the script and name it n-installonly.py, which is saved in the /usr/lib/yum-plugins file. . You can update the number of kernels used by the Linux system by modifying the tookeep variable (default is 2).

Knowing that there is a working kernel on a Linux system, you can perform a security upgrade. If the new kernel fails, simply boot the old kernel to resolve the problem on the new kernel (whether it is deleted, recompiled, or upgraded).

Copyright © Windows knowledge All Rights Reserved