Unix & Linux
boot grub2 uefi
Updated Mon, 18 Jul 2022 01:16:09 GMT

UEFI not recognising EFI partition: no booting options


I messed up the EFI partition and now when I boot my computer it opens the BIOS interface without any boot option, as if my disk has been erased. However using a live USB (which is correctly recognised and booted) and using grub command line I've been able to boot my principal OS (Ubuntu). However I don't know how to fix this problem. I've tried running grub-install /dev/sda but it didn't changed anything.

The EFI partition seems completely fine: it has the correct flag (esp, boot) and there are all the correct files inside.

tree /boot/efi/
 EFI
     Boot
        bootx64.efi
     Microsoft
        Boot
       .....
     ubuntu
         fbx64.efi
         fw
         fwupx64.efi
         grub.cfg
         grubx64.efi
         mmx64.efi
         shimx64.efi

What I should check? What I'm missing?

This is my partition table:

parted /dev/sda print
Model: ATA Crucial_CT525MX3 (scsi)
Disk /dev/sda: 525GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  1612MB  1611MB  fat32        EFI System Partition          boot, esp
 2      1612MB  87.9GB  86.3GB  ext4         Ubuntu
 3      87.9GB  281GB   193GB   ext4         Home
 5      290GB   290GB   16.8MB               Microsoft reserved partition  msftres
 6      290GB   405GB   115GB   ntfs         Basic data partition          msftdata
 8      405GB   500GB   94.4GB  ntfs         Data                          msftdata
 9      500GB   525GB   25.3GB  ext4         Backup OS



Solution

I resolved the problem simply formatting the partition (FAT32 with boot flag as obviously), mounting it and running grub-install. Then I had only to update the UUID in /etc/fstab. For Windows I had to use a USB with the installer and use the utility bcdboot to rewrite the EFI.