What a GRUB Error Means
GRUB errors in Ubuntu manifest in several forms:
grub>screen — a minimal GRUB command-line interface that appears when it cannot find thegrub.cfgconfiguration file.grub rescue>screen — an even more limited mode, activated when the core bootloader or partition is damaged.error: no such partitionmessage — GRUB cannot find the partition with the installed system.- Ubuntu missing from the menu — the system does not appear in the boot list, even though it is installed.
- Hanging on a black screen after selecting an item — likely a corrupted configuration or kernel.
These symptoms mean the bootloader cannot properly read the configuration or hand over control to the Linux kernel. Most often, the problem occurs after:
- Interrupting a system or kernel update.
- Manually changed GRUB settings (e.g., in
/etc/default/grub). - Partition damage (disk failure, incorrect partition table modification).
- Reinstalling Windows, which overwrote the MBR/ESP.
- Errors during disk cloning or moving the system to a different drive.
Common Causes
- Corrupted
grub.cfgfile — the configuration file may be deleted, damaged, or not updated after a new kernel installation. - Incorrect settings in
/etc/default/grub— errors in parameters (e.g.,GRUB_CMDLINE_LINUXorGRUB_TIMEOUT) can make GRUB non-functional. - Windows bootloader overwrite — during Windows installation or recovery, its bootloader overwrites the MBR (in BIOS) or the EFI partition entry (in UEFI), removing GRUB.
- Partition table changes — moving, deleting, or changing the types of partitions where GRUB resides (especially
/bootor the EFI system partition). - Insufficient space in
/boot— when the/bootpartition fills up, kernel updates may not install completely, breaking the boot process. - GRUB module errors — damage to files in
/boot/grub(e.g.,core.img) due to disk failure or interrupted writes. - Boot mode mismatch (BIOS/UEFI) — if Ubuntu was installed in UEFI mode but the BIOS is set to Legacy, or vice versa, GRUB will not be found.
Solutions
Method 1: Restore GRUB with Boot-Repair (Graphical Method)
Boot-Repair is a utility that automatically diagnoses and fixes most GRUB problems. Suitable for beginners and quick resolution.
- Boot from an Ubuntu Live USB/DVD (as described in the
howToStepsabove). - Connect to the internet (via Wi-Fi or wired).
- Open a terminal and run:
sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt update sudo apt install boot-repair boot-repair - In the window that opens, click "Recommended repair".
- Wait for completion (may take 5-10 minutes). The utility will automatically reinstall GRUB, update the configuration, and fix common errors.
- After completion, close the window, reboot, and remove the Live USB/DVD.
⚠️ Important: If Boot-Repair offers to create a report (paste URL), save it — it will help with further diagnostics if the problem persists.
Method 2: Manual GRUB Restoration via chroot (Command Line)
This method gives full control and works when Boot-Repair fails or precise configuration is needed.
- Boot from an Ubuntu Live USB/DVD and open a terminal.
- Identify the Ubuntu partition (see
howToSteps, step 2). Assume it is/dev/sda3. - Mount the root partition:
If you have a separatesudo mount /dev/sda3 /mnt/bootpartition, mount it:
If using UEFI, mount the EFI system partition (usually FAT32, 100-500 MB):sudo mount /dev/sdaX /mnt/boot # replace X with your /boot partition numbersudo mount /dev/sdaY /mnt/boot/efi # replace Y with your EFI partition number - Mount virtual filesystems:
sudo mount --bind /dev /mnt/dev sudo mount --bind /proc /mnt/proc sudo mount --bind /sys /mnt/sys - If using chroot with IPv6 addressing, you may also mount
/run:sudo mount --bind /run /mnt/run - Perform chroot:
You are now in your installed Ubuntu.sudo chroot /mnt - For BIOS (Legacy) systems:
For UEFI systems:grub-install /dev/sda update-grub
If thegrub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck update-grubgrub-installcommand fails, check if the EFI partition is mounted and contains theEFI/ubuntufolder. - Exit chroot:
exit. - Unmount all partitions:
sudo umount -R /mnt - Reboot.
Method 3: Reinstall GRUB (If Previous Methods Fail)
Sometimes a complete GRUB reinstall with cleanup of old data helps.
- Complete steps 1-6 from Method 2 (chroot).
- Remove old GRUB files:
rm -rf /boot/grub rm -rf /boot/efi/EFI/ubuntu # UEFI only - Reinstall GRUB as in step 7 of Method 2.
- Update the configuration:
update-grub - Exit, unmount, and reboot.
Method 4: Fix GRUB Configuration (If the Error is in the Config)
If GRUB loads but cannot find the kernel or shows errors like error: file '/boot/vmlinuz-...' not found, the issue may be in the configuration file.
- Boot into Ubuntu (via Rescue mode or if booting partially works).
- Open the
/etc/default/grubfile:
Check parameters:sudo nano /etc/default/grubGRUB_CMDLINE_LINUX— should not contain invalid options.GRUB_TIMEOUT— a reasonable value (e.g., 5-10 seconds).GRUB_DISTRIBUTORandGRUB_OS_PROBER— usually left at defaults.
- If you recently edited this file, try temporarily commenting out changes (add
#at the start of the line). - Update the configuration:
sudo update-grub - Reboot.
If the system still does not boot, the kernel files may be the issue. Check for files in /boot:
ls -la /boot
Ensure files like vmlinuz-<kernel-version> and initrd.img-<kernel-version> exist. If not, reinstall the kernel:
sudo apt install --reinstall linux-image-generic
sudo update-grub
Prevention
To avoid recurring GRUB errors:
- Do not interrupt system updates — especially processes involving the kernel (
linux-image-*) or GRUB (grub-pc,grub-efi). Usesudo apt update && sudo apt upgradein a stable state. - Back up critical partitions (e.g.,
/bootand the EFI partition) before major changes. A simple way:sudo cp -a /boot /boot-backup sudo cp -a /boot/efi /boot-efi-backup # for UEFI - Avoid manually editing files in
/boot/grub— changes should be made via/etc/default/grubandupdate-grub. - Maintain consistent boot mode — do not switch between BIOS and UEFI without reinstalling the system. Check the current mode:
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS - Monitor free space on
/boot— when it fills up (over 90%), remove old kernels:
Or manually:sudo apt autoremove --purgedpkg -l 'linux-image*' | grep '^ii' # list installed sudo apt remove linux-image-<old-version> - When installing Windows alongside Ubuntu — always boot from a Live USB and restore GRUB after completing the Windows installation.
Following these recommendations significantly reduces the risk of bootloader errors. If a problem occurs, start with Boot-Repair — it solves up to 80% of cases. In complex situations, use manual recovery via chroot.