This article describes how to bootup RHEL/CentOS 8 system into rescue mode using the systemd rescue target unit.
You may need to boot your RHEL 7/8 and CentOS 7/8 system to fix some common problems when the system refuse to boot normally.
What is Linux rescue mode
Rescue mode is equivalent to single user mode but requires the root password whereas single user mode doesn’t require it.
In rescue mode, the system tries to mount all local file systems and start only few important system services, but it does not activate network interfaces or allow more users to log into the system at the same time.
Make a Note: Booting into rescue mode from installation DVD/ISO is referred to as “Anaconda Rescue Mode” that is different from just booting with systemd rescue target.
Bootup into Rescue mode (target)
Booting into rescue mode (target) can be done in two ways as shown below:
1) Booting into rescue mode using rescue image
You can boot the system directly into rescue mode from the GRUB2 menu options namely
2) Booting into rescue mode by adding the ‘rescue.target’ parameter.
Step-1: On the ‘GRUB 2’ boot screen, select the kernel that you want to edit and press the
'e' key to interrupt the boot process.
Step-2: Go to the line that contains the word ‘linux’ and press ‘Ctrl+e’ to jump to the end of the line then add
'systemd.unit=rescue.target' and press
'Ctrl+x' to boot the system with the changed parameters.
Step-3: When the ‘rescue mode’ appear, enter the root password for further troubleshooting.
Step-4: When the troubleshooting is done, type ‘reboot’ to boot the system in normal mode either ‘multiuser.target’ or ‘graphical.target’.
Over to You
In this guide, we have explained how to boot Red Hat (RHEL) 8 system in rescue mode in two different ways. This same procedure works on other RHEL clones such as CentOS 8, Rocky Linux 8 and AlmaLinux 8.
If you have any questions or feedback, feel free to comment below.