How to boot into single user mode or runlevel 3 using the GRUB bootloader?
Environment
- Red Hat Enterprise Linux (RHEL) 6
- Red Hat Enterprise Linux (RHEL) 5
- Red Hat Enterprise Linux (RHEL) 4
- Red Hat Enterprise Linux (RHEL) 3
Issue
- How to boot into single user mode or runlevel 3 using the GRUB bootloader?
Resolution
Single user mode can be accessed by appending an "S", "s", or "single" to the kernel command line in GRUB. Likewise, a "3" can be used to boot to runlevel 3. To do this, restart the system and when the GRUB splash screen presents itself:
-
Select/highlight the desired kernel using the up/down arrow keys.
-
Press the letter a to modify the kernel line.
-
On the new screen, press the spacebar to add a space, then type the letter s and press Enter.
This will boot the system into single user mode, i.e. the boot process will stop immediately after execution of rc.sysinit and present a root BASH shell.
Root Cause
Adding "S", "s", or "single" to the kernel command-line tells the kernel to to have init drop to a root shell after rc.sysinit finishes. This allows one to get into the system without a password and bypass any problems with services.
Adding "1" to the kernel command-line seems to do basically the same as above, but in reality init also kicks off rc for runlevel 1 before dropping to a root shell. This means that in runlevel 1, there could possibly be some services running (if they were configured in /etc/rc1.d).
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.