0

I have Ubuntu 19.10(which is primary) and Windows 10 on my laptop and I decided to install Lubuntu on my external HDD(I want to use this HDD in my old PC and this is the only option to install OS, for some reason I wasn't able to install OS via usb plugged in that old PC).

Be aware that I'm not an expert in Linux. So I've created bootable usb and started installing Lubuntu. When it came to partitions, I've made root and home partitions on my external HDD(for some reason I had no opportunity to create swap, I think this is because I have swapfile for my primary Ubuntu) and since I am sort of newbie, I made this external HDD as a device for boot loader(I think this was a mistake that led to everything that I'm going to describe below). I installed Lubuntu on my external HDD, rebooted laptop and first thing was that my screen, where I choose between systems(where I choose if I use my primary Ubuntu or Win10, I suppose that this is exactly the boot loader) is now black instead of purple colors and I can choose between primary Ubuntu 19.10, fresh-installed Lubuntu and Win10. When I plugged out external HDD and rebooted laptop, instead of my habitual purple boot loader I got grub prompt on. I started googling my occasion but then I've got, that I don't really understand, what I have to google in order to tackle this problem. Then I checked BIOS, my primary Ubuntu was first in a list. I've changed to Win10 and came here to describe my problem.

Can anyone help me to figure out how to return my habitual purple-colored boot loader and finally boot my Ubuntu 19.10 without using external HDD(when external HDD plug in, I can boot my primary Ubuntu without any problem). Thanks.

1 Answer 1

0

You have installed the GRUB boot loader on the portable HDD, which takes precedence at boot now.

To remedy, boot into your 19.10 system, make sure that your internal HDD is /dev/sda by issuing a fdisk -l and investigating the output. Use fdisk -l | head -n2 to just see the disk information and not the partitions.

After verification that everything is correct, use sudo grub-install /dev/sda to install GRUB on your internal HDD again.

A restart should now boot your internal HDD again with the external HDD removed.

To remove phantom entries like the USB HDD from the GRUB menu, run sudo update-grub when you have booted into your system again without the external HDD. This keeps your GRUB boot menu free of outdated entries.

8
  • Thank you, I'll try this out right now. Apr 28, 2020 at 14:39
  • Can you elaborate on fdisk -l? I ran it with sudo and got some output but I don't know what I should look at. When I was booting, boot loader showed that my primary ubuntu is /dev/sda5 btw. Apr 28, 2020 at 14:46
  • Also I decided that my system is on /dev/sda(because I can't see anything that would change my opinion on that) and ran your command. The output is: sudo: grub-setup: command not found. Apr 28, 2020 at 14:56
  • 1
    Okay, so I got some courage and used sudo grub-install /dev/sda, rebooted my laptop and I got my lovely purple bootloader and everything seems fine now. I still haven't ran sudo update-grub though(Did I get it correct, that if I run it, i'll loose System Setup entry in bootloader?). Anyways, thank you! Apr 28, 2020 at 15:28
  • When you run fdisk -l, you get information about your disks in each header line for the attached disks. You can then decide which device is internal, and which external. You got your proof by other means, you can skip this step. Also, I need to correct my instructions. grub-install is now correct. So, you did everything you needed to do. update-grub is run often by the system during updates, no harm done. It just removes entries which are not present anymore from the menu, like your USB drive.
    – emk2203
    Apr 29, 2020 at 7:52

You must log in to answer this question.

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