Starting from RHEL 7 the runlevel concept is no more and now the formerly known as runlevel 1 is 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
Based on the scenario type you can choose the steps to be followed
You can use below command to switch to rescue mode
OR
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
The next screen should look similar to the below example of me selecting the 3.10.0-693.el7.x86_64 kernel for editing.
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
[root@golinuxhub ~]# systemctl isolate rescue.target
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
OR
[root@golinuxhub ~]# systemctl rescue
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!
IMPORTANT NOTE: This command is similar to systemctl isolate rescue.target, but it also sends an informative message to all users that are currently logged into the system. To prevent systemd from sending this message, run this command with the --no-wall command line option:
# systemctl --no-wall rescue
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 issueNow 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
The next screen should look similar to the below example of me selecting the 3.10.0-693.el7.x86_64 kernel for editing.
- 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
The line should look like below after editing
- 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