Grub Loader

Just upgraded my Ubuntu Linux version and now the Grub Loader does not show Linux as a boot option. I have a dual-boot setup with Windows and Ubuntu. After upgrade, Grub only lists Windows as boot option. How can I restore Ubuntu as the default boot option in the Grub Loader?

1 Like

Perhaps these can shed some light.
It might be as easy as sudo update-grub
https://itsfoss.com/no-grub-windows-linux/
https://ubuntuforums.org/showthread.php?t=2359388
https://askubuntu.com/questions/809258/how-to-use-grub-loader-to-dual-boot-windows-and-ubuntu-14-04

I wish it were that simple. However, if I can’t access Ubuntu, I don’t have access to a command line, and therefore I can’t run any update commands. Windows is my only option currently listed on the Grub menu.

Here’s how you can fix it. You will need “live” install media, on a USB stick, CD, or similar.

Step 1: Boot from a Live USB or CD
Create a live Ubuntu USB or CD if you don’t have one. Boot from it by selecting the appropriate boot option during startup.

Step 2: Open a Terminal
Once you’ve booted into the live environment, open a terminal window.

Step 3: Identify Your Partitions
Use the following command to list your partitions and identify the one with Ubuntu installed:
sudo fdisk -l

or

sudo parted -l

Look for the partition with the Linux filesystem. It’s usually formatted as ext4.

Step 4: Mount the Ubuntu Partition
Assuming your Ubuntu partition is /dev/sda1 (replace with the actual partition you found), mount it:
sudo mount /dev/sda1 /mnt

If you have a separate boot partition, you should mount it as well:
sudo mount /dev/sdaX /mnt/boot
Replace /dev/sdaX with the correct partition for your boot.

Step 5: Mount the Essential Directories
For the chroot environment to work, you need to mount some additional directories:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys

Step 6: Chroot into Your Ubuntu System
Now, chroot into your system:
sudo chroot /mnt

Step 7: Reinstall GRUB
Reinstall GRUB to your primary hard drive (usually /dev/sda, but ensure it is your drive where the MBR needs to be installed):
grub-install /dev/sda

After installing GRUB, update its configuration file:
update-grub

Step 8: Exit and Reboot
Type exit to leave the chroot environment and then use the following commands to unmount the filesystems:
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

Now you can reboot your system:
sudo reboot

Now, remove your live media so that you can boot into your hard drive.

After these steps, you should see GRUB with Ubuntu listed as a boot option.

1 Like

Thank you for the instructions! I completed the following command and got an error on the grub-install command.

ubuntu@ubuntu:~$ sudo mount /dev/sdb5 /mnt
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount --bind /dev/pts /mnt/dev/pts
ubuntu@ubuntu:~$ sudo mount --bind /proc /mnt/proc
ubuntu@ubuntu:~$ sudo mount --bind /sys /mnt/sys
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.

Here is my fdisk information. I’m not familiar with how EFI works.

Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: MKNSSDEL256GB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8F6EF3A2-BCD3-418C-97BE-09D32C8C2FDD

Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 239615 32768 16M Microsoft reserved
/dev/sda3 239616 498582158 498342543 237.6G Microsoft basic data
/dev/sda4 498583552 500117503 1533952 749M Windows recovery environment

Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA DT01ACA2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xffc3820a

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 2925482699 2925480652 1.4T 7 HPFS/NTFS/exFAT
/dev/sdb2 * 2925484032 2926532607 1048576 512M ef EFI (FAT-12/16/32)
/dev/sdb3 2926534654 3907028991 980494338 467.5G 5 Extended
/dev/sdb5 2926534656 3907028991 980494336 467.5G 83 Linux

Partition 3 does not start on physical sector boundary.

Disk /dev/sdc: 7.47 GiB, 8019509248 bytes, 15663104 sectors
Disk model: USB 2.0 FD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcd5ff50c

Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 15597567 15595520 7.4G 7 HPFS/NTFS/exFAT
/dev/sdc2 15597568 15663103 65536 32M ef EFI (FAT-12/16/32)

Disk /dev/mapper/ventoy: 3.56 GiB, 3826831360 bytes, 7474280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9240A165-D190-4AB6-8A10-46DC207B42EE

Device Start End Sectors Size Type
/dev/mapper/ventoy-part1 64 7465119 7465056 3.6G Microsoft basic data
/dev/mapper/ventoy-part2 7465120 7473615 8496 4.1M EFI System
/dev/mapper/ventoy-part3 7473616 7474215 600 300K Microsoft basic data

Disk /dev/loop8: 46.96 MiB, 49242112 bytes, 96176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Not sure if this is the issue but thought worth noting based your system not finding EFI partition.

When you choose a boot option at start-up with the intention of installing Linux, it very important to note what MODE start-up will take.

  • A. Legacy BIOS?
  • B. EFI (UEFI)?

IF you don’t start-up in EFI the install will be in Legacy mode.

This was a real stumble for me till I figured out that I should have installed in EFI mode from the start.

It also seems to me that you could have started the Ubuntu from the Boot Option menu, rather than the USB live disk?

Additionally trust Timeshift. I have regular backups daily,weekly, monthly and take Snapshots before any new installs or big upgrades.

Restoring a snapshot resets the Grub menu (biased for the Linux you are running at the time.)

Hoping this helps get you going.

Linux is awesome!