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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

How to Boot into Rescue Mode or Emergency Mode Through Systemd in CentOS/RHEL 7 and 8

By admin

This article explains how to bootup CentOS/RHEL 7 and 8 system into rescue mode or emergency mode. In CentOS/RHEL 7 and 8, both rescue mode and emergency mode are systemd targets which replaced the concept of runlevels in previous CentOS/RHEL versions.

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 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.

2. Add the following parameter at the end of the linux16 line on x86-64 systems, or the linuxefi line on UEFI systems:

systemd.unit=emergency.target

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

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

emergency mode CentOS RHEL 7 and 8

Bootup into Rescue mode(target)

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 on x86-64 systems, or the linuxefi line on UEFI systems:

systemd.unit=rescue.target

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

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

rescue mode CentOS RHEL 7 and 8

Bootup into Debug Shell

The systemd debug shell provides a shell in the startup process that can be used to diagnose systemd related boot-up problems. Once in the debug shell, systemctl commands such as systemctl list-jobs, and systemctl list-units can be used to diagnose boot problems.

During bootup, when the GRUB2 menu shows up, press the e key for edit. Add the following parameter at the end of the linux16 line on x86-64 BIOS-based systems, or the linuxefi line on UEFI systems:

systemd.debug-shell

The systemd will configure the debug shell on TTY9. Press Ctrl+Alt+F9 to connect to the debug shell (no credential needed).

Switch to Emergency mode(target)

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

# systemctl emergency

Broadcast message from root@dhcp-cn-10-182-71-190.cn.oracle.com on pts/1 (Mon 2016-06-27 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@dhcp-cn-10-182-71-190.cn.oracle.com on pts/0 (Mon 2016-06-27 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, CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. 14 Useful “cat” Command Examples in Linux
  2. Downloading a Specific Version of Package and Its Dependencies from Repository for Offline Installation Using YUM
  3. CentOS / RHEL 6 : How to force a NTP sync with the NTP server(s)
  4. How to add or delete a samba user under Linux
  5. Linux OS service ‘portmap’
  6. What is the purpose of “mysql.sys@localhost” user
  7. CentOS / RHEL : How to Disable / Enable direct root and non-root user ssh login
  8. How To Disable Ksplice Service on OEL
  9. Unable to login with GUI on CentOS/RHEL 7
  10. Linux / UNIX : How to find files which has SUID/SGID set

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary