4

I got a problem that is after rebooting grub CLI always appears instead of grub menu. For me the problem is not being unable to boot into any kernels (it is simple: type exit and enter twice do the job and the grub menu reappear). What I want is to boot into grub menu instead of CLI. Is there any way to fix this?

I'm using Ubuntu 18.04 with GRUB2.

1
  • Once you boot, run sudo update-grub
    – defalt
    Commented May 12, 2018 at 13:26

3 Answers 3

4

I had the same issue apart from that it was booting not at all. Reason: My fresh install of Ubuntu 18.04, 17.10 and Mate 18.04 had all put the wrong uuid in /boot/efi/EFI/ubuntu/grub.cfg.

Version 1 (grub-cmd):

From grub shell, find root folder by peeking into the outputs of ls (e.g. ls (hd0,gpt2)/) and make sure to know on which partition your system was installed! For me, it was sda2 since ESP is recommended to be the first.

set root=(hd0,gpt2)
linux /boot/vmlinuz-number-generic root=/dev/sda2
initrd /boot/initrd.img-number-generic
boot

If booting is successful now, you can get your uuid's (not partuuid) by typing blkid and verify that the correct one is noted in /boot/efi/EFI/ubuntu/grub.cfg.

For me:

search.fs_uuid <uuid> root hd0,gpt2
...

Version 2 (install-stick):

If you happen to have a bootable linux-stick, you can also boot that, mount your ESP and change the uuid there:

# Create folder to mount ESP
mkdir /tmp/esp

# Mount ESP (assuming sda1) to esp
sudo mount /dev/sda1 /tmp/esp

# Get UUID's of devices
sudo blkid

# Ensure correct `uuid` is set in `/tmp/esp/efi/EFI/ubuntu/grub.cfg`

reboot
1

I had the issue of booting into the grub command line prompt instead of the boot loader menu. In my case I was trying to boot into Linux and the problem was that after reformatting the Linux partition, an older ubuntu folder was left in the EFI partition (in the EFI folder) - even after I deleted its entry from the EFI boot list - and the UEFI was booting that old entry instead of the new one that had the correct Linux partition UUID.

The first thing to know - the GRUB command prompt isn't that scary. If you know your way around a Linux shell, GRUB isn't a problem - you basically want to load a GRUB configuration file that exists somewhere on your drive, using the configfile command, and you can find it using the ls command. The main difference from a Linux shell, is that there's a special syntax to access a drive and partition:

  1. use just ls to list the drives.
  2. Pick the correct drive, likely the first, it should be named hd0, and list its partitions using ls (hd0).
  3. Pick the correct partition - in my case it was the 6th GPT partition - and list it, for example: ls (hd0,gpt6).
  4. This should show you the content of the partition and you can list folders inside it using (for example) ls (hd0,gpt6)'/boot'
  5. After locating the grub.cfg file, load it (for example) like so: configfile (hd0,gpt6)'/boot/grub/grub.cfg', and that should show the familiar boot menu and you can run your OS from there.

In my case the permanent solution was to remove the old EFI/ubuntu directory from the EFI partition and set the UEFI boot order correctly.

0

You say you can get into your Ubuntu install, so it should be simple enough to update/reinstall grub and see if that fixes the issue.

First, try simply using sudo update-grub if you haven't already, then reboot to check if that fixed it.

If this doesn't work, try manually reinstalling it with sudo grub-install /dev/sd## (replace ## with the current location of grub). This should be enough to reset any files that might be causing your issue.

Note: if you customized your grub install originally, this may reset those changes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .