Sometimes, things go wrong, even on Linux systems, and you need a way to get your computer back to full functionality. On Windows, Safe Mode is usually the first choice for getting back in and fixing a problem. However, on Linux there really isn’t a direct counterpart. On most Linux distributions the solution involves using a live CD to access files on your hard drive or even use a chroot. Ubuntu has come up with a clever solution in recovery mode. It lets you perform several key recovery tasks, including booting into a root terminal to give you full access to fix your computer.
Note: This will only work on Ubuntu, Mint, and other Ubuntu-related distributions.
Booting Recovery Mode
As you’re booting your computer, wait for the manufacturer logo to flash from the BIOS. If your computer boots too quickly, you’re going to need to do this immediately after powering it on. Quickly press either the Shift or Escape key. On newer computers it’s probably Escape. The timing has to be near perfect on some computers, so you may have to press it repeatedly.
With any luck you’ll arrive at Ubuntu’s GRUB boot menu. Just below your regular boot option you’ll see an entry for “Advanced Options.” Select it and press Enter.
GRUB will take you to a new menu. Towards the bottom you’ll see one of the entries with “Recovery” listed in parentheses.
You’ll arrive on a simple screen with a blue background and a box containing a series of recovery options. This is the main recovery menu for Ubuntu, and it allows you to do many of the common tasks that you’d need to fix a broken system.
The Root Terminal
A good amount of problems can only be solved as root, and they require more manual intervention than what the default options in the recovery menu provide. When it looks like you’re dealing with one of these cases, select “Drop to root shell prompt” to boot into a root terminal.
As soon as you select it, you’ll see the bottom of your screen switch to a terminal and log in as root. Before you can do much, you’re going to need to remount the root partition of your drive. By default, it’s mounted read-only for safety purposes, but you’ll probably need to modify something. To remount it with write permissions, run the following command.
If you have additional partitions that you need to work on, you’ll need to remount them as well. That includes when your “/home” directory is on a separate partition. You can remount them all at once simply with:
Now you’re ready to dig around in your system and resolve the problem that’s preventing you from booting normally. You’ll have access to everything on your system as root, so be careful not to damage anything in the process. Making backups, even just copies of the files you modify, is a great idea. Once you’ve uncovered and remedied the problem, reboot your system and boot normally.