CentOS system repair mode and centos Repair Mode

Source: Internet
Author: User
Tags superuser permission

CentOS system repair mode and centos Repair Mode

A recent error occurred while tuning the CentOS system resolution. the result is that the system prompts "cocould not apply the stored configuration for monitors" after logging on, it turns out that when I changed the Resolution, the system created a display configuration file. When I log on to the system, I read the configuration file and found that no matching display was found. An error was returned. The solution on the Internet is to delete the display configuration file, that is, execute the following command:

rm -f $HOME/.config/monitors.xml

Even so, those people on the internet can open the shell when the error is prompted. My CentOS 7 system cannot open the shell at all, and the whole error Prompt window is filled with the whole screen, the button is not even closed, and the shortcut key cannot be used. The restart is still invalid.

At this time, I thought of the Linux repair mode when I started the system. When I started the system, neither of the two menus entered the repair mode. Later, I saw someone on the internet saying that I could modify the Startup menu to enter the repair mode. So I tried it and the result was quite satisfactory. In fact, it is easy to modify. When you start the system, press the "e" key to edit the menu, and then move the cursor to the "crashkernel = auto" item, change the value of this item from "auto" to "linux single ".

Then press Ctrl-x to restart the system and enter the repair mode. Enter the root user password to log on to the shell as the root user.

So what is "linux single? In fact, it is the single-user mode of linux, that is, the root user mode. If this value is specified in the pilot item, the grub boot kernel will be logged on in the root user mode after it is started. Correspondingly, you can specify the system running level in the "/etc/inittab" configuration file. If this parameter is set to 1, the system logs on in single-user mode.

Editing the boot items in the boot menu is temporary. After the system is restarted, they will restore the original values. If you want to change some of them permanently, you can modify the grub configuration file. If you do not know where the grub configuration file is located, run the "whereis grub" command to find it. On my host, it is located in the following position:

Grub:/usr/lib/grub/etc/grub. d/etc/grub2.cfg/usr/share/grub

Then we can view the "/etc/grub2.cfg" file. The result shows the same content as what we saw when editing the Startup menu. Of course, you need the superuser permission to view and modify the file. However, it is generally not recommended to modify it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.