In this guide, we will explain how to boot RHEL 9 into rescue mode. RHEL 9 is also known as Red Hat Enterprise Linux 9.
Rescue mode is a minimal Linux environment independent of your main system. It provides a command-line interface with essential tools to troubleshoot and fix problems that prevent a normal boot. Rescue mode also refer as Single user mode or emergency mode.
With rescue mode, we can:
- Reset forgotten root password: Regain access to your system if you’ve locked yourself out.
- Fix file system errors: Repair corrupted the corrupted filesystem.
- Mount file systems: Access your system’s files for troubleshooting or data recovery.
- Run diagnostic tools: Identify hardware or software issues causing boot failures.
Booting RHEL 9 into Rescue Mode
There are two methods through we can enter into rescue mode. We can use either of it.
Method :1 (Using rd.break keyword)
1) Boot your RHEL 9 system and press ESC key to go to boot loader screen as shown below:
Note: If you have multiple Kernels then select the kernel which you are using for booting your RHEL system.
2) Press ‘e’ to enter into edit mode and then go to the end of line which starts with ‘linux‘ word, type the keyword “rd.break” as shown below:
Next, press Ctrl-x or F10 to boot
3) Remount the /sysroot in read-write (rw) mode
Execute the following commands to mount the sysroot file system in read write mode.
switch_root : /# mount -o remount,rw /sysroot switch_root : /# chroot /sysroot sh-4.4#
Now move to the troubleshooting part, Let’s assume we want to reset forgotten root password. Run the following command.
sh-4.4# passwd root sh-4.4# touch /.autorelabel
Let’s assume we have create a file system but it creating issues while booting OS, so in such scenario we can comment that file system in the /etc/fstab file.
Once you are done with troubleshooting, you can reboot the system using following command.
sh-4.4# reboot -f
Method : 2 (Using rw init=/sysroot/bin/sh)
1) Start RHEL 9 system and go to the boot loader screen (Press ESC key for boot loader Screen)
Choose the first line which includes Kernel.
2) Press e and go the line which starts with the word linux and replace ‘ro’ with ‘rw init=/sysroot/bin/sh’
Now, press Ctrl-x or F10 to boot the system into rescue mode.
Next type the following command.
:/# chroot /sysroot
3) Perform Troubleshooting Steps
Now you can perform all the troubleshooting steps.
After executing commands, you can reboot your system using the command “reboot -f”.
That’s it from this guide. We hope these instructions help you to boot RHEL 9 system into Rescue mode. Feel free to post your queries and feedback in below comments section.
Also Read: How to Install Docker on RHEL 9 (Step-by-Step Guide)