Failed to open \EFI\BOOT\grubx64.efi – Not Found

Centos logo

Après une installation d’une Centos 7.2 sur une clé USB sur un HP EliteBook, ou après un yum upgrade qui touche au kernel (donc au grub) je me suis retrouvé avec un boot qui m’affichait :

Failed to open \EFI\BOOT\grubx64.efi - Not Found
Failed to load image \EFI\BOOT\grubx64.efi: Not Found
start_image() returned Not Found

La faute à EFI/UEFI et secureboot qui s’intercale entre BIOS et BootLoader (Grub dans mon cas). Je vous passe la littérature abondante qui traite des différents moyens de contourner cette brique, mais je traiterai directement du moyen de récupérer un boot fonctionnel.

On commence par récupérer une distribution linux live qui bootera proprement puis direction la console.

Après un passage en root on va récupérer les informations de la clé usb (ou du hdd).

[liveuser@localhost liveuser]# su
[root@localhost liveuser]# fdisk -l /dev/sdb
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdb: 62.7 GB, 62746787840 bytes, 122552320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt


#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648      1435647    500M  Microsoft basic 
 3      1435648    122550271   57.8G  Linux LVM       

Ensuite on monte la partition qui contient l’EFI

[root@localhost liveuser]# mkdir /mnt/efi
[root@localhost liveuser]# mount /dev/sdb1 /mnt/efi
[root@localhost liveuser]# ll /mnt/efi/
total 8
drwxr-xr-x. 4 root root 4096 Feb  3  2017 EFI
drwxr-xr-x. 2 root root 4096 Feb 23  2017 System Volume Information
[root@localhost liveuser]# ll /mnt/efi/EFI/
total 8
drwxr-xr-x. 2 root root 4096 Sep 14 07:01 BOOT
drwxr-xr-x. 3 root root 4096 Sep 14 07:04 centos
[root@localhost liveuser]# ll /mnt/efi/EFI/BOOT/
total 1348
-rwxr-xr-x. 1 root root 1296176 Aug 31 21:30 BOOTX64.EFI
-rwxr-xr-x. 1 root root   79048 Aug 31 21:30 fbx64.efi

Les fichiers attendus ne sont pas présents … par contre …

[root@localhost liveuser]# ll /mnt/efi/EFI/centos/
total 6108
-rwxr-xr-x. 1 root root     134 Aug 31 21:30 BOOT.CSV
-rwxr-xr-x. 1 root root     134 Aug 31 21:30 BOOTX64.CSV
drwxr-xr-x. 2 root root    4096 Sep 14 06:58 fonts
-rwxr-xr-x. 1 root root    5909 Sep 14 07:04 grub.cfg
-rwxr-xr-x. 1 root root    5894 Mar  5  2017 grub.cfg.1494933862.rpmsave
-rwxr-xr-x. 1 root root    5068 Jul  7 10:46 grub.cfg.1505371668.rpmsave
-rwxr-xr-x. 1 root root    1024 Sep 14 07:04 grubenv
-rwxr-xr-x. 1 root root 1052032 Aug 17 18:00 grubx64.efi
-rwxr-xr-x. 1 root root 1262816 Aug 31 21:30 mmx64.efi
-rwxr-xr-x. 1 root root 1296176 Aug 31 21:30 shim.efi
-rwxr-xr-x. 1 root root 1297120 Aug 31 21:30 shimx64-centos.efi
-rwxr-xr-x. 1 root root 1296176 Aug 31 21:30 shimx64.efi

Les fichiers sont ailleurs dans /EFI/centos/ !!! Qu’à cela ne tienne :)

[root@localhost liveuser]# cp /mnt/efi/EFI/centos/grub* /mnt/efi/EFI/BOOT/
[root@localhost liveuser]# cp -r /mnt/efi/EFI/centos/fonts /mnt/efi/EFI/BOOT/
[root@localhost liveuser]# ll /mnt/efi/EFI/BOOT/
total 2408
-rwxr-xr-x. 1 root root 1296176 Aug 31 21:30 BOOTX64.EFI
-rwxr-xr-x. 1 root root   79048 Aug 31 21:30 fbx64.efi
drwxr-xr-x. 2 root root    4096 Sep 19 09:40 fonts
-rwxr-xr-x. 1 root root    5909 Sep 19 09:40 grub.cfg
-rwxr-xr-x. 1 root root    5894 Sep 19 09:40 grub.cfg.1494933862.rpmsave
-rwxr-xr-x. 1 root root    5068 Sep 19 09:40 grub.cfg.1505371668.rpmsave
-rwxr-xr-x. 1 root root    1024 Sep 19 09:40 grubenv
-rwxr-xr-x. 1 root root 1052032 Sep 19 09:40 grubx64.efi

Voila les fichiers sont au bon endroit, démontage et reboot ;)

[root@localhost liveuser]# umount /mnt/efi
[root@localhost liveuser]# shutdown -r 0

A la vue des différents posts que j’ai pu lire sur le sujet c’est transposable aux autres distributions linux.

Zephilou

5 Responses

  1. Un gros merci. Cela marche très bien.
    Je trouve cela fou que ce n’est pas commenté sur le wiki ou forum CentOS !!!!

  2. Thank you very very much….
    very simple and to the point solution.
    Best solution i found on the net.
    10/10!!

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Post comment