0

I've dual booted my laptop to run both Windows & KDE Plasma. I had to install Ubuntu on an external SSD. After doing so I can't boot into my linux anymore. It instead boots into the grub terminal. When I connect the external hard drive then the bootloader opens correctly and I can boot into my linux. If I unplug the external SSD then my linux still works fine. But when I reboot (with the ssd unplugged) then it boots into Grub terminal again...

I've tried fixing it with Boot Repair which gives me an error. The log of my boot repair can be found here:

http://paste.ubuntu.com/p/yjxGVBbPXd/

Does anyone know what I can do to fix my bootloader?

2 Answers2

0

Grub has the requirement that every drive connected to the machine when it was run has to be present when you boot it again, even if it has nothing to do with the system you are to load getting loaded. Here is your problem from the the report.

 => No boot loader is installed in the MBR of /dev/nvme0n1.
 => No boot loader is installed in the MBR of /dev/sda.

Use the command below then as root or with sudo in front of the command. It appears you have secure boot enabled as this is the command the boot-repair uses but fails with because the external was not found but is still in the device map, I added the recheck option to make it scan again with the command used by the program. You do these commands while booted into your install containing the Linux while you have disconnected the external drive. This will re-install it to the drive and allow you to boot it on its own.

grub-install --recheck --efi-directory=/boot/efi --target=x86_64-efi --uefi-secure-boot /dev/sda
update-grub

Hopefully it works on the next reboot for the system. These commands are used in the Terminal. Now I have read it again it says the secure boot is disabled which confuses me a bit as to why the command included it in the first place you may want to remove it for the first try, if it fails then put it back in the command for a second attempt.

  • Thanks for the reploy. I've tried to run your commands, which executed successfully with sudo. However, I still get booted in to the Grub terminal – Jeroen Beljaars Feb 11 '21 at 17:51
  • Ok, if you are comfortable with doing it then install a different kernel, hopefully this will force it to do a proper job of updating grub. Or if you are good with getting me the contents of the files grub uses so I can see the settings it uses. We can try to get it going again or perhaps I just post the procedure once I get my meal, for that editing needed. –  Feb 11 '21 at 18:02
  • With UEFI boot you do not have grub in MBR and do not want grub in MBR. What you are missing is an ESP on external drive. Ubuntu's ubiquity installer always installs to first drive,usually internal drive. You need an ESP on external & install grub into that. Then remove Ubuntu entry in UEFI, make external first & internal second in boot order. https://askubuntu.com/questions/1296065/dual-booting-w10-ubuntu-with-2-separate-ssds-in-uefi-mode/1296153#1296153 https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator/1056079#1056079 – oldfred Feb 11 '21 at 18:59
0

I've managed to solve the problem! I made a small 8gb partition on my own ssd on which I installed Ubuntu. After doing so the bootloader is back, and I can select all my previous installed operating systems.

Thanks for thinking along!