There are some circumstances like where Linux user forget his / her password, or filesystem got corrupted or want to fix /etc/fstab errors, so to resolve these issues Linux geeks must boot their system into rescue mode or emergency mode. Rescue mode in Ubuntu Linux is also known as single user mode.
In this article we will demonstrate how to boot your Ubuntu 20.04 LTS system into a rescue mode and emergency mode.
Booting Ubuntu 20.04 LTS into Rescue Mode (Single User Mode)
1) Reboot the system and go to grub bootloader screen
During the boot, press ‘ESC’ key to go to bootloader screen,
Choose first option “Ubuntu” and then press ‘e’ key to edit
2) Append the string “systemd.unit=rescue.target” to the line which starts with ‘linux’ word.
Note: Before appending the string remove the word “$vt_handoff” if it exist in the line which begins with “linux”
3) Now Press ‘CTRL-x’ or F10 to boot the system in rescue or single user mode.
In the following screen, press enter and run your troubleshooting steps and commands to recover your system. In my case, I have reset forgotten password of user “pkumar” and verify the entries of /etc/fstab file.
We can run almost all the commands here as all the file systems are mounted in read-write mode. Once you are done with troubleshooting steps, use ‘systemctl reboot’ command to restart the system.
Booting Ubuntu 20.04 LTS in Emergency Mode
In emergency mode, all the files system of a Linux system are mounted in read-only mode. This mode is generally used in the situations where we can’t boot the system in rescue mode, may be due to some file system corruptions.
Refer below steps to boot Ubuntu 20.04 in emergency mode:
1) Reboot Your system and go to Grub Bootloader Screen
2) Press ‘e’ and look for the line which begins with “linux” word and append string “systemd.unit=emergency.target”
Now press “Ctrl-x” or F10 to enter into emergency mode
Here you can try repairing the file system and do other troubleshooting steps. If you want to mount / (slash root) in read-write mode then issue the following command,
# mount -o remount,rw /
After executing all the troubleshooting steps, reboot the system by issuing the command “systemctl reboot”
That’s conclude the article. I hope these steps helps you to boot your Ubuntu 20.04 LTS system into rescue and emergency mode. You can share your feedback and comments in the comment section below.