Suppose you forgot your password and you haven't configured the root account on Ubuntu then how would you recover your password?
The answer is to use the recovery mode.
Sure, there is a lot more that you can do with the recovery mode and in this tutorial, I will walk you through the following:
- How to get into recovery mode in Ubuntu
- Use of recovery mode options
So let's start with the first one.
How to get into the recovery mode in Ubuntu
You can get into the boot mode from the Grub bootloader.
But if you're using Ubuntu in VM, then, you won't see a grub screen and you'll directly boot into your system.
To display the grub screen while you boot from Ubuntu, all you have to do is press and hold the
Shift button when you start your system.
Once you get to see the grub screen, select the second option
Advanced options for Ubuntu to get into the recovery mode:
It will show you a list of the kernels you have on your system.
And each kernel name will be repeated twice one with the normal boot and one with the recovery mode.
So from here, you need to select from which kernel you want to start the recovery mode:
It will boot your system with that kernel but in recovery mode and show you screen multiple options:
Now, let's have a look at what each option is used for.
What is the use of recovery mode options?
There are a total of 8 options:
resume: Resumes to the normal boot with the selected kernel.
clean: As the name suggests, it is used to free up some storage space.
dpkg: If you installed a package and due to some reason, it wasn't installed properly, or is broken and your system is malfunctioning, then, you can use this option.
fsck: It will perform an intensive file check on your drives and attempt to solve if found any.
grub: Update the grub config file.
network: Activates the internet so you can perform all the operations like updating packages, or upgrading to a new version of Ubuntu, etc.
root: Drops you in the root shell with all the privileges you would ever need to modify or troubleshoot the system.
system-summary: Prints system information including partitions, RAM, network config, and more.
Pretty helpful. Right?
Reset forgotten password with recovery mode
I have used the recovery mode several times to reset my forgotten password, for that, all you have to do is select the
root option, make the filesystem writable, and change the password.
Sounds complex? Here's the detailed guide:
And if you're in a hurry, you can refer to our video as well:
I hope you will find this guide helpful.