0

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

The EFI partition is set up properly as you can see:

~# efibootmgr 
BootCurrent: 0006
Timeout: 2 seconds
BootOrder: 0006,0002,0003,0001,0000,0005
Boot0000* ubuntu
Boot0001* Windows Boot Manager
Boot0002* grub
Boot0003* Windows Boot Manager
Boot0005* GRUB 
Boot0006* UEFI:  SA04G PMAP
  • How exactly did you "mess it up"? What did you do to it? – Mokubai Apr 21 '17 at 10:14
  • I don't know exactly because I updated Ubuntu and shrinked the EFI partition in the same session. Then I restored the original size trying to fix it but it didn't worked – skdys Apr 21 '17 at 10:24
  • Try unmounting the EFI System Partition (ESP) and running dosfsck on it. It could be that it's damaged. In a worst-case scenario, backing up the files (with tar, zip, or simply cp), creating a fresh filesystem on the partition, and then restoring the files may be necessary. – Rod Smith Apr 21 '17 at 18:57
1

Looking at partitions numbers is seems Ubuntu was installed first, occupying fist few partitions (including ESP) and then Windows was installed (MS reserved is partition 5).

If you have a Windows installation/recovery USB/DVD try fixing boot with:

bcdboot N:\windows /s M: /f UEFI

where N: is Windows partition, M: is ESP (use diskpart.exe to assign drive letters as needed) - drive letters in example are just for the example, use the drive letters from you mappings when executing command.

If command finishes successfully Windows will boot by default. Eventually an error message will tell you what's wrong with ESP.

  • I fixed the problem formatting the ESP partition. Then I recreated EFI windows entry with the command you cited. For Ubuntu I used 'grub-install' and then adjusted the '/etc/fstab' with the new UUID of the ESP partition. – skdys Apr 26 '17 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.