Ubuntu 18.04 booting is stuck at GNU GRUB version 2.04 [Partially solved]

18.04grub2

Dear fellow ubuntu Users,

I have an Alienware laptop that has a dual boot with Windows 10 and Ubuntu 18.04. I use Ubuntu as my main operating system. After a fail in booting, I used boot-repair program from an Ubuntu 20.04 via live USB. (for the previous part of the problem that caused me to run boot-repair, see my other question)

After removing the USB and booting again caused me to run into Grub minimal version.

I encounter a minimal BASH-like interface that is GNU GRUB version 2.04. grub>

My boot priority order is ubuntu, USB, and windows in order.

Exit directs me to boot Windows 10 booting successfully if USB is not connected, in case of USB connected it directs me to grub in USB which has ubuntu in it.

My Ubuntu installation is at hd0 gpt5 and I can see there is boot/grub folder there. However, the following lines do not work. They basically keep me on the same screen without reaction.

set prefix=(hd0,gpt5)/boot/grub
set root=(hd0,gpt5)
insmod normal
normal

Besides these, I tried to boot ubuntu from the USB, and chroot and update grub in my local Ubuntu installation. I also tried to run boot-repair again but both trials did not change anything.

One more note is while booting Ubuntu from live USB, the system checks the disk for files and at the end, it says Check finished: errors found in 1 file! You might encounter errors. without clarifying exactly what is wrong.

Edit 1:

ls output:
(proc) (hd0) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

Solution:
I added a solution as an answer to my post.
This helped me to get rid of that menu. However, the result turned my problem back into my initial problem.
Booting stuck at emergency mode as in my previous question.

Best Answer

use ls to see partition names. Set the one you are trying to boot. for my case it was hd0 and gpt5. (As I learned we can omit the gpt part or keep it while writing a command.)

So booting happened with the following set of commands from the tutorial.

grub> set root=(hd0,5)
grub> linux /boot/vmlinuz-x.x.x-x-generic root=/dev/nvme0n1p5
grub> initrd /boot/initrd.img-x.x.x-x-generic
grub> boot 
Related Question