When adding a new partition for Ubuntu 24.04 causes GRUB to fail booting your dual-partition setup, the issue usually stems from mismatched UUIDs or an unupdated bootloader configuration. You can resolve this by chrooting into the new installation and running update-grub to regenerate the correct boot entries based on the actual filesystem identifiers.
This problem often arises when users manually create partitions without letting the installer handle the bootloader integration, leading to GRUB pointing to non-existent or incorrect disk identifiers. If you are experiencing similar confusion between different Ubuntu versions in your boot menu, reviewing how GRUB selects kernels can provide additional context on why specific entries might be missing or failing.
Diagnosing the Boot Failure
The first step is to determine exactly where the process fails. When you power on your machine, does the screen go black, or do you see the GRUB menu appear? If the menu appears but selecting the new Ubuntu 24.04 entry results in an error like "No bootable device" or drops you into a GRUB shell, the bootloader is present but misconfigured. If the system skips GRUB entirely and boots directly into the old OS or Windows, the BIOS/UEFI boot order may need adjustment, or the EFI System Partition (ESP) is not being recognized correctly.
In cases where the GRUB shell starts unexpectedly, it indicates that the bootloader cannot find its configuration files or the kernel image. This is distinct from issues where GRUB loads but fails to hand off control to the kernel due to initramfs errors. Understanding the difference between a GRUB startup failure and a module loading failure helps narrow down whether the issue is at the bootloader level or deeper in the system initialization.
Preparing the Recovery Environment
To fix the GRUB configuration, you must access the file system of the new Ubuntu 24.04 installation. The most reliable method is to boot from an Ubuntu Live USB. Once the live environment loads, open a terminal and identify your partitions. Use the command lsblk or sudo fdisk -l to list all block devices. Look for the partition that contains your root filesystem for the new installation. It is crucial to identify the correct partition by checking its size and label rather than assuming a specific path like /dev/sda1, as device names can change between reboots.
Once you have identified the root partition, mount it to a temporary directory. For example, if your root partition is sdb2, you would run sudo mount /dev/sdb2 /mnt. If you have separate partitions for /boot/efi and /boot, you must mount those as well. The EFI partition typically needs to be mounted at /mnt/boot/efi. Without mounting these critical directories, any subsequent commands will not interact with the correct parts of the new installation.
Binding System Directories
Before entering the chroot environment, you need to bind the virtual file systems so that the chrooted environment has access to hardware information and processes. Run the following commands in sequence:
sudo mount --bind /dev /mnt/devsudo mount --bind /dev/pts /mnt/dev/ptssudo mount --bind /proc /mnt/procsudo mount --bind /sys /mnt/sys
These steps ensure that when you enter the chroot, the system sees the same hardware and process table as the live session, which is essential for generating accurate GRUB configurations.
Reinstalling and Updating GRUB
Enter the chroot environment by running sudo chroot /mnt. Inside this environment, you are effectively operating as if you are logged into the new Ubuntu 24.04 installation. The primary command to fix the bootloader is update-grub. This script scans the system for kernels and initial ramdisks and generates a new grub.cfg file in the EFI partition.
If update-grub reports errors, check the output carefully. Common issues include missing kernel images or incorrect UUID references. In some cases, you may need to reinstall the GRUB package explicitly using apt install --reinstall grub-efi-amd64 followed by grub-install. Ensure you specify the correct target device and EFI directory during installation. For instance, grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu is a standard command for UEFI systems, but verify your architecture and mount points.
After updating GRUB, exit the chroot with exit and unmount the partitions in reverse order: sudo umount /mnt/sys, sudo umount /mnt/proc, etc. Reboot the system and remove the Live USB. The new Ubuntu 24.04 entry should now appear in the GRUB menu and boot successfully.
Preventing Future Boot Issues
To avoid this situation in future upgrades or installations, always allow the installer to manage the bootloader unless you have a specific reason not to. If you are performing manual partitioning, ensure that the ESP is correctly formatted and mounted before proceeding. Additionally, keep your BIOS/UEFI firmware updated, as older versions may have bugs related to handling multiple Linux installations or large storage devices.
If you encounter persistent issues after following these steps, consider checking the integrity of your EFI partition. Accidental deletion or corruption of the EFI partition is a common cause of boot failures that require recovery from scratch. Referencing guides on recovering deleted UEFI partitions can be helpful if your boot structure is severely damaged.
Frequently Asked Questions
Why does GRUB show "error: unknown filesystem"?
This error occurs when GRUB cannot read the partition containing the kernel or configuration files. It is often caused by using a filesystem type that GRUB does not support natively, such as Btrfs without proper modules loaded, or by having the wrong UUID hardcoded in the config. Running update-grub inside the chroot usually resolves this by detecting the correct filesystem and updating the config dynamically.
Can I fix this without a Live USB?
If your current system still boots, you can use the existing installation to repair the new one. Mount the new root partition and the EFI partition, then use chroot into the new partition and run update-grub. However, if neither system boots, a Live USB is necessary to access the file system and perform the repairs.
What if the GRUB menu doesn't appear at all?
If the GRUB menu is skipped, check your BIOS/UEFI settings to ensure the correct drive is set as the primary boot device. Sometimes, the EFI entry for the new installation is missing from the NVRAM. You can add it manually using efibootmgr from the Live USB, pointing to the shimx64.efi or grubx64.efi file in the EFI partition.
Is it safe to delete old Ubuntu entries from GRUB?
Yes, you can safely remove old entries to clean up the menu. Edit the /etc/default/grub file in the active installation and adjust the GRUB_TIMEOUT or use grub-customizer to hide unwanted entries. After making changes, remember to run update-grub to apply the modifications to the bootloader configuration.
How do I know if I am using UEFI or Legacy BIOS?
You can determine the boot mode by checking if an EFI System Partition exists. In the Live USB terminal, run lsblk -f and look for a partition with the FAT32 filesystem type and the boot, esp flags. If you see this partition, you are using UEFI. If there is no such partition and you rely on a boot sector in the MBR, you are likely using Legacy BIOS.