How to Resolve GRUB Shell and Kernel Issues in Ubuntu OS

Prev Next

After installing an Ubuntu system update, some machines may boot directly into a GNU GRUB Shell. This indicates that the system bootloader could not be loaded or located correctly and the machine is unable to boot into the operating system.

This issue arises when:

  • The latest Ubuntu system kernel is corrupted and hence, the bootloader fails to identify the correct boot partition. This can happen when a system update is interrupted (e.g., due to unexpected power shutdown).

  • Selecting incorrect settings or misconfigured partitions during the update process.

Scope

Workstations or NavVis mapping devices running Ubuntu OS.

Troubleshooting procedure

  1. Reinstall Ubuntu 22.04

    Follow these instructions to install Ubuntu 22.04 : https://knowledge.navvis.com/docs/how-to-install-ubuntu-2204

Note

  • Follow the official Ubuntu installation guide.

  • Reserve partitions separating boot partition, system partitions (for Ubuntu OS), and Data partition (mapping and processed data), to ensure that future system failures do not affect your stored data.Your content goes here

  1. Fix the Kernel and GRUB Bootloader

    This method is useful if your data is stored in the same partition as the Ubuntu system and if reinstalling would erase it.

The following procedure describes how to manually fix the kernel and GRUB bootloader.

An alternative, user-friendly approach to this method can also be found here: https://www.youtube.com/watch?v=FIAxzzE45Sg

Steps for Troubleshooting

Execute the following commands in the GRUB shell:

1 Find the /boot partition

  1. At the GRUB prompt, run:

ls

This displays a list of available disks and partition, for example,(hd0,gpt1) (hd0,gpt2)

  1. Next, inspect each partition:

ls (hd0,gpt2)/

Look for directories such as /boot and /etc. This indicates the root partition, make a note of it.

  1. Execute the following on the boot partition:

ls -l (hd0,gpt2)/

The output would be similar to:

Partition hd0,gpt2: Filesystem type ext2, UUID <uuid>
  1. Make a note of the UUID (disk identifier). This is required for the bootloader to locate the filesystem.

2 Configure the Root Partition, Kernel and Initrd

  1. Execute the following:

set root=(hd0,gpt2)
  1. Replace the (hd0,gpt2) with your identified partition from step 1.

  2. Run:

linux /boot/vmlinuz-6.xx.xx-generic root=UUID=<your-root-uuid> ro rootdelay=10

This will designate the linux kernel to the bootloader.

  1. Type linux /boot/vm and then press the “TAB“ key to auto-complete.

  2. Choose an older kernel version, not the latest one. Example: if you see 6.8.80 and 6.8.60, choose 6.8.60, as the the newest version is the one likely corrupted.

  3. Next, execute:

initrd /boot/initrd.img-6.xx.xx-generic
  1. Ensure that the version number here matches the one in the previous command.

  2. Execute this command to boot the system:

boot
  • If successful, Ubuntu should load normally.

  • If it fails:

    • A temporary initramfs shell will display the error message and cause of failure. Make a screenshot for easier troubleshooting.

    • Inspect the error and check for typographical mistakes ( for e.g., on the UUID, or the kernel paths).

    • In case there are not typographical errors, repeat step 2 with another kernel version.

3 Repair the Bootloader on the system disk

  1. After booting into Ubuntu, open a terminal and execute the following:

sudo grub-install /dev/sda    # replace /dev/sda with your system disk, no numbers
sudo update-grub
  1. To confirm on the main system partition: Open “Disks” application on Ubuntu.

  2. Select the partition in which the Ubuntu system is installed.

  3. Check the “Device“ field for the correct disk path.

Note
Replace /dev/sda with the correct system disk (not a numbered partition).
Example: /dev/sda is valid, /dev/sda1 is not.