GRUB starts in command line after reboot

boot-loaderdual-bootgrub2uefi

I installed Linux Mint on my laptop along with a pre-installed Windows 10. When I turn on the computer, the normal GRUB menu appears most of the time:

GRUB menu

But after booting either Linux or Windows then rebooting, I GRUB starts in command line mode, as seen in the following screenshot:

GRUB command line

There is probably a command that I can type to boot from that prompt, but I don't know it. What works is to reboot using Ctrl+Alt+Del, then pressing F12 repeatedly until the normal GRUB menu appears. Using this technique, it always loads the menu. Rebooting without pressing F12 always reboots in command line mode.

I think that the BIOS has EFI enabled, and I installed the GRUB bootloader in /dev/sda.

Why is this happening and how can I ensure that GRUB always loads the menu?

Edit

As suggested in the comments, I tried purging the grub-efi package and reinstalling it. This did not fix the problem, but now when it starts in command prompt mode, GRUB shows the following message:

error: no such device: 6fxxxxx-xxxx-xxxx-xxxx-xxxxxee.
Entering rescue mode...
grub rescue>

enter image description here

I checked with the blkid command and that is the identifier of my linux partition. Maybe this additional bit of information can help figure out what is going on?

Best Answer

The boot process can't find the root partition (the part of the disk, that contains the information for starting up the system), so you have to specify its location yourself.

I think you have to look at something like this article: how-rescue-non-booting-grub-2-linux

short: in this grub rescue> command line type

ls

... to list all available devices, then you have to go through each, type something like (depends what is shown by the ls command):

ls (hd0,1)/
ls (hd0,2)/ 

... and so on, until you find

(hd0,1)/boot/grub   OR (hd0,1)/grub

In case of efi

(hd0,1)/efi/boot/grub OR (hd0,1)/efi/grub

... now set the boot parameters accordingly, just type this with the correct numbers and after each line press return

set prefix=(hd0,1)/grub

or (if grub is in a sub-directory)

set prefix=(hd0,1)/boot/grub

Then continue with

set root=(hd0,1)
insmod linux
insmod normal
normal

Now it should boot. Start a commandline now (a terminal) and execute

sudo update-grub

... this should correct the missing information and it should boot next time.

If not, you have to go through the steps again an might have to repair or install grub again (look at this article: https://help.ubuntu.com/community/Boot-Repair)

Related Question