How to get Linux Mint Recovery Mode

0
(0)

Linux Mint Recovery Menu

If Linux Mint is installed on the computer and no other operating systems are available, the Grub Boot menu is hidden by default. In order to get the Grub menu at startup, the right Shift key has to be pressed after switching on, unfortunately this does not work with virtual machines, here you have to set up the Grub menu persistently.

Enable Grub Menu on Linux Mint

If the Grub menu should appear at each start to get the recovery menu for system repairs, or to pass kernel parameters, edit the file 90_custom.cfg as root:

First become root with sudo su –

$ vi /etc/default/grub.d/90_custom.cfg

and add the following lines:

GRUB_TIMEOUT="5"
GRUB_TIMEOUT_STYLE="menu"

If the file 90_custom.cfg does not exist, simply create it with an editor of your choice.

After editing, run the following command:

$ sudo update-grub

Reboot:
The grub boot menu will appear the next time you start

Grub Menu

Choose the second entry “Advanced options for Linux Mint 20”.

Grub Recovery Menu

The recovery menu with repair options and the root shell appears promptly.

Root shell prompt

Choose “Drop to root shell prompt” that opens the Single Mode Console.

Drop to root shell prompt

Recovery Mode (Single Mode)

Enter in maintenance console. Here you are root and have write permissions on the file system. The single-user runlevel is the lowest operating state for maintenance, in which only system resources such as hard drives or file systems are active.

root password forgotten

Here are some of the most self-inflicted errors. If the root password has been forgotten, a new one can now be assigned.

root@localhost:# passwd root

sudo rulebook plugin could not be initialized

Improper changes to the sudoers file may result in errors.

$ sudo visudo
>>> /etc/sudoers: syntax error near line 24 <<<
sudo: parse error in /etc/sudoers near line 24
sudo: no valid sudoers sources found, quitting

If sudo is no longer possible in the standard runlevel and you have locked out yourself as root, sudo can be restored.

Before /etc/sudoers can be changed, the file must be given write permission.

$ chmod u+w /etc/sudoers && vi /etc/sudoers

After editing, sudoers must be protected again.

$ chmod u-w /etc/sudoers

Here is the sudoers original file of Linux Mint 20 in case it has been changed to unusable.

Note! Changes should always only be made with visudo.

#
This file MUST be edited with the 'visudo' command as root.
#
Please consider adding local content in /etc/sudoers.d/ instead of
Directly modifying this file.
#
See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

Host alias specification

User alias specification

Cmnd alias specification

User privilege specification
root ALL=(ALL:ALL) ALL

Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Hard drive has no free space

If there is no more free disk space, the logs can no longer be saved, which leads to system downtime, here the space allocation can be checked in the Single User Mode Console to create free space again.

$ tree -ah /var/log -L 1
$ tree --you -d -shaC | grep -Ev '[^ ]( ** ){2}

If the tree command does not exist on the system, one of the following (disk usage) commands can help.

$ sudo du -hc --max-depth=0 /var
$ sudo du -ah /var | sort -n -r | head -n 5
$ sudo du /home -Sh | sort -rh | head -5

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply

Your email address will not be published. Required fields are marked *