Search code examples
linuxubuntuunixgrub

Grub can't find grub.cfg file -- Stuck at GRUB Command Line


I am using GPT/UEFI system. I installed KDE Neon and I was using it without any problem since the summer. Then today, I deleted /EFI/ubuntu/ and after I reboot the system, it stuck at grub command line "grub> ".

1- I can boot the system by writing following command to the grub command line

configfile (hd0,gpt1)/EFI/neon/grub.cfg

2- Also following command works

configfile (hd0,gpt2)/boot/grub/grub.cfg

3- Also following command works

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

4- I tried followings to fix by booting the system but non of them works

- boot-repair program
- update-grub
- apt install --reinstall grub-efi && update-grub

So this is the situation. How can I fix the problem ?

Thanks in advance.


Solution

  • I have just fixed the problem!

    1. I boot the system manually by entering command to grub> command line. (one of the command that I mentioned in the question)
    2. I opened a terminal.
    3. cd /boot/efi/EFI
    4. cp -r ./neon ./ubuntu
    5. Reboot and it works fine.

    I think the problem is specific for KDE Neon because it gave me exactly same problem when I installed it to a new computer. Grub is not looking inside the "/EFI/neon" directory. Instead, it is looking inside "/EFI/ubuntu" but cannot find it so it causes problem.

    BTW, the reason I named new folder as "ubuntu" is that KDE Neon is Ubuntu based.