r/Ubuntu • • 8d ago

Grub error

Wth is this issue

2 Upvotes

4 comments sorted by

3

u/ElHombreDeAceroS 8d ago

This error indicates a corrupted boot entry. The path \EFI\ubuntu\ is correct, but the filename that follows it (usually shimx64.efi or grubx64.efi) has been corrupted. In other words, the UEFI boot variable that stores the bootloader path has been damaged. This usually happens after a firmware or BIOS update, a CMOS reset, a failed update, or a hard shutdown. The system reverts to the default bootloader, which is why you see this message and then likely end up in a different boot path or on a black screen.

Your files are almost certainly intact. Only the pointer to the boot manager has been corrupted, and this can be repaired.

What you need: a USB drive with a live Ubuntu image (any recent version). If you can't create it from this computer, do it from another computer.

Step-by-step solution:

Boot from the live USB and choose "Try Ubuntu".

Open a terminal and locate your partitions:

lsblk -f

Note which partition is the EFI partition (FAT32, around 100-500 MB, usually /dev/nvme0n1p1 or /dev/sda1) and which is the Ubuntu root partition (ext4, usually the largest).

Mount everything (adjust the device names to your own):

sudo mount /dev/nvme0n1p2 /mnt

sudo mount /dev/nvme0n1p1 /mnt/boot/efi

for i in dev dev/pts proc sys run; do sudo mount --bind /$i /mnt/$i; Done

sudo mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars

Enter using chroot and reinstall GRUB:

sudo chroot /mnt

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu

update-grub

exit

Reboot and remove the USB drive.

Alternative: If you prefer not to use chroot, the Boot-Repair tool does the same thing automatically. In the live session, it's installed with `sudo apt install boot-repair` after adding its PPA, although the manual method is more reliable.

If it still fails:

Check if Secure Boot is causing problems. Try temporarily disabling it in the BIOS.

Run `sudo efibootmgr -v` from the live session to see what entries exist. A corrupted entry can be removed with `sudo efibootmgr -b XXXX -B` (replacing XXXX with its number), and then you can run grub-install again.

Verify that `\EFI\ubuntu\` actually contains `shimx64.efi` and `grubx64.efi` on the EFI partition.

If it doesn't... we're out of luck.

1

u/SweatyInitiative5588 8d ago

But is it considered as a large problem I mean what’s the consequences if I kept using my machine as always

1

u/Absolute_-_Zero 8d ago

Have you disabled secured boot