Methods of booting into Single-user mode in Linux system

Source: Internet
Author: User
Tags file system

The knowledge that Linux enters Single-user mode (single) is a must for administrators because Single-user mode is a way to modify the system configuration or implement maintenance without affecting other users (or other users). Single-user mode is also the mode in which the recovery works on a compromised system. Single-user mode applies to the following situations:

(Single-user mode also has a premise that your grub or Lilo works, and you know where your system problems occur, and when you log on in Single-user mode, you can open the file system write, and then do the system repairs you want)

Modify password

modifying system configuration files and repair systems

System backup restore, partition, etc.

If it doesn't work in single mode, then there's no good way to do it.

Home, you can use

The code is as follows:

#telinit 1//Allow system to enter Single-user mode without reboot (single)

Here's a summary of how Linux enters Single-user mode from two aspects of grub and Lilo.

Under grub into Single-user mode in three ways, in fact, is a kind of, but the difference between the number of steps

The first and simplest. In the Grub splash screen, highlight the desired kernel, and then press the "a" key to add the boot option. To boot Single-user mode, add the single flag after the existing kernel option, and then press ENTER. Examples are as follows:

Copy Code

The code is as follows:

Grub append> ro root=label=/rhgb quiet single

Single is added after, and then press ENTER (rhgb-graphics to boot, quiet-does not output startup information)

The second is to press the "E" key, that is, to edit the existing boot menu options, after the kernel line plus single, start on the line, and then press ENTER, and then press "B", that is, the boot system into Single-user mode.

The third is to press the "C" key, that is, enter the GRUB command prompt and enter a series of grub boot commands that are familiar to grub's commands. I am accustomed to looking at the note input, no way, I have no memory, such as:

The code is as follows:

Gurb >root (hd0,0)

Grub > KERNEL/VMLINUZ-2.6.9-42.ELSMP ro root=/dev/hda1 single

Grub > Boot

I feel quite in trouble.

How to boot into Single-user mode under Lilo

At the LILO prompt. Type the label name of the configuration you want to boot (according to the name specified in lilo.conf), followed by-s or single. For example, the default configuration that Debian comes with is called "Linux," so to boot the configuration into Single-user mode, you should use:

The code is as follows:

Lilo:linux Single

Note that in Single-user mode (single), the root directory of the file system is installed as read-only when booting the system, which is a way to prevent system instability. If you need to fix a problem by modifying a configuration file or command in the root file system, or if you need to execute a command that modifies those files, this mechanism will prevent us from doing so. For example, we can only execute commands like Df,fdisk, but if we do write, we can't use them. So we can use the following command to reinstall the root file system in read-write mode:

The code is as follows:

#mount-O remount-w/

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.