called emergency.target
So we will use the term "emergency.target" for "runlevel 1"
There can be two possible scenarios for going into emergency target level
- You have a working setup with a shell
- You machine is unable to boot
Based on the scenario type you can choose the steps to be followed
Scenario 1: When you have a working shell
In this case you can hit the below command to change your existing runlevel to "emergency.target"
You can use below command to switch to rescue mode
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
OR
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
Broadcast message from root@golinuxhub.lab on pts/1 (Sun 2017-12-24 23:47:08 IST):
The system is going down to rescue mode NOW!
Scenario 2: When you do not have working shell
If you are having boot up related issues then it is obvious that you would want to go to emergency target to get a shell for further troubleshooting the issue
Now with RHEL 7 the steps to switch to emergency.target is completely different from the steps as used in RHEL 6 and earlier variants
Steps to switch runlevel to emergency.target
- Once the GRUB menu appears during bootup process you will see a splash screen which will contain the list of available kernel for bringing up the system, for my system I only have one kernel installed along with a rescue image
- Choose the kernel you want to edit using the arrow key to highlight the kernel using which you want to enter into emergency.target
- then press the letter "e" key to edit the boot entry
Red Hat Enterprise Linux Server (0-rescue-d6e5b9fa407542fcbcaa72e7e6b777e2) 7.4 (Maipo)
Use the ^ and v keys to change the selection.
Press 'e' to edit the selected item, or 'c' for a command prompt.
The next screen should look similar to the below example of me selecting the 3.10.0-693.el7.x86_64 kernel for editing.
linux16 /vmlinuz-3.10.0-693.el7.x86_64 root=/dev/mapper/rhel-root ro rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet net.ifnames=0 systemd.unit=emergency.target
Press Ctrl-x to start, Ctrl-c for a command prompt or Escape to
- Look out for line starting with "linux16" on the screen using the arrow button, for some cases it can also be linux and linuxefi
- Once the blinking cursor is on this respective line press the "End" key from the keyboard to go to the end of this line
- Give a "blank space" and provide the detail of target you want to boot your system into, for example to boot into emergency target use the below syntax
systemd.unit=emergency.target
- Next once done hit "Enter" to save the line
- Lastly press "Ctrl + x" to boot the system using the changes you have done
- Next thing you will observe below screen where you must enter "root" user password to continue
- After giving the password you will get the shell
I hope the article was useful.