You are on page 1of 3

Copyright (c) 2024, Oracle. All rights reserved. Oracle Confidential.

How to Boot Oracle Linux 7 into Rescue and Emergency Modes via systemd (Doc ID
2153996.1)

In this Document

Goal
Solution
Booting into Emergency mode (target)
Booting into Rescue mode (target)
Booting to systemd Debug Shell
Switching to Emergency mode (target)
Switching to Rescue mode (target)
References

APPLIES TO:

Oracle Cloud Infrastructure - Version N/A and later


Linux OS - Version Oracle Linux 7.0 and later
Linux x86-64

GOAL

This article describes how to configure Oracle Linux 7 (OL7) to boot into rescue and emergency modes.

In OL7, both rescue mode and emergency mode are systemd targets (that replace runlevels of previous OL versions).

Rescue mode is equivalent to single user mode and requires the root password.

Rescue mode allows the system to be repaired in situations when it is unable to complete it's regular boot process. Rescue
mode attempts to mount all local filesystems and start important system services, however does not activate network
interfaces, nor allow multiple users to be logged in.

Emergency mode provides a minimal environment allowing the system to be repaired 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 other local fileystems and does not activate network interfaces.

In the event that Oracle Linux is unable to completely boot at all, refer to How to Bootup Oracle Linux 7.x into Rescue
Mode From ISO Image.

SOLUTION

Booting into Emergency mode (target)

1. During boot, when the GRUB2 menu is displayed, press the e key i.e. edit.

2. Append the following parameter to the linux16 line on a x86-64 system, or to the linuxefi line on a UEFI system:

... systemd.unit=emergency.target

Press Ctrl+a (or Home) and Ctrl+e (or End) to jump to the start and end of the line.
Press Ctrl+x to boot the system with the newly added parameter into emergency mode.

3. When prompted, enter the root password or press Ctrl+D to continue.

Booting into Rescue mode (target)

1. During boot, when the GRUB2 menu is displayed, press the e key i.e. edit.

2. Append the following parameter to the linux16 line on a x86-64 system, or to the linuxefi line on a UEFI system:

... systemd.unit=rescue.target

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

Press Ctrl+x to boot the system with the newly added parameter into rescue mode.

3. When prompted, enter the root password or press Ctrl+D to continue.

Booting to systemd Debug Shell


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

1. During boot, when the GRUB2 menu is displayed, press the e key i.e. edit.

2. Append the following parameter to the linux16 line on a x86-64 system, or to the linuxefi line on a UEFI system:

... systemd.debug-shell

The system will configure the debug shell on console TTY9. Press Ctrl+Alt+F9 to connect to the debug shell (no credentials
required).

Switching to Emergency mode (target)

To switch to emergency target, run following as root:

# systemctl emergency

Broadcast message from root@<HOSTNAME.DOMAINNAME> on pts/1 (Mon 2016-06-27 00:44:58 EDT):

The system is going down to emergency mode NOW!

Run the following to prevent systemd from sending informational messages:

# systemctl --no-wall emergency


# systemctl isolate emergency.target

Switching to Rescue mode (target)

To switch to rescue target, run following as root:

# systemctl rescue

Broadcast message from root@<HOSTNAME.DOMAINNAME> on pts/0 (Mon 2016-06-27 00:22:44 EDT):

The system is going down to rescue mode NOW!

Run the following to prevent systemd from sending informational messages:

# systemctl --no-wall rescue


# systemctl isolate rescue.target

REFERENCES

NOTE:2302734.1 - How to Bootup Oracle Linux 7.x into Rescue Mode From ISO Image
Didn't find what you are looking for?

You might also like