• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 7 : How to boot into Rescue Mode or Emergency Mode

by admin

The post explains how to bootup RHEL 7 system into rescue mode or emergency mode. In RHEL7, both rescue mode and emergency mode are systemd targets which replaced the concept of runlevels in previous linux versions.

Rescue mode

Rescue mode is equivalent to single user mode and requires the root password. Rescue mode allows you to repair your system in situations when it is unable to complete a regular booting process. Rescue mode will try to mount all local file systems and start some important system services, but it does not activate network interfaces neither allow multiple users to be logged in.

Emergency mode

Emergency mode provides the most minimal environment possible and allows you to repair your system even in situations when the system is unable to enter rescue mode. In emergency mode, the system mounts the root file system as read-only, does not attempt to mount any other local file systems, does not activate network interfaces.

Bootup into Emergency mode(target)

1. During bootup, when the GRUB2 menu shows up, press the e key for edit.

Boot up screen grub2

2. Add the following parameter at the end of the linux16 line :

systemd.unit=emergency.target

Press Ctrl+a (or Home) and Ctrl+e (or End) to jump to the start and end of the line.

emergency target

3. Press Ctrl+x to boot the system with the parameter.

booting into emergency target

Bootup into Rescue mode(target)

There are 2 ways to get into rescue mode :
1. Method 1
There is a GRUB2 menu option when you boot up the system which can be selected to directly boot into rescue mode.

rhel 7 rescue mode

2. Method 2
1. During bootup, when the GRUB2 menu shows up, press the e key for edit.

2. Add the following parameter at the end of the linux16 line:

systemd.unit=rescue.target

Press Ctrl+a (or Home) and Ctrl+e (or End) to jump to the start and end of the line.

rhel 7 boot into rescue mode

3. Press Ctrl+x to boot the system with the parameter.

RHEL 7 rescue mode bootup

Switch to Emergency mode(target)

To switch to Emergency target, simply run following command as root:

# systemctl emergency
Broadcast message from root@geeklab on pts/1 (Mon 2016-08-17 00:44:58 EDT):
The system is going down to emergency mode NOW!

To prevent systemd from sending informative message:

# systemctl --no-wall emergency
# systemctl isolate emergency.target

Switch to Rescue mode(target)

To switch to rescue target, simply run following command as root:

# systemctl rescue
Broadcast message from root@geeklab on pts/0 (Mon 2016-08-17 00:22:44 EDT):
The system is going down to rescue mode NOW!

To prevent systemd from sending informative message:

# systemctl --no-wall rescue
# systemctl isolate rescue.target

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. RHEL / CentOS : How to shrink LVM volume
  2. CentOS / RHEL 7 : How to open a port in the firewall with firewall-cmd?
  3. “error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory” ‘java -version’ error on Startup
  4. CentOS / RHEL 7 : unable to start vsftpd service
  5. How to Enable Debug Mode for Chronyd Service in CentOS/RHEL 8
  6. CentOS / RHEL : How to configure a user account to never expire (disable password ageing)
  7. Inconsistent Device Names Across Reboot Cause Mount Failure Or Incorrect Mount in Linux
  8. CentOS / RHEL 7 : How to set udev rules for ASM on multipath disks
  9. Swapon Fails To Mount Swap – Gives Invalid Argument Error
  10. What is the purpose of “system user” in MySQL Replication

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright