Recently I installed Debian 12 in a machine with EndeavourOS and the efi partition was overwritten (due to my carelessness). The structure of the partition was
By running the command sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS --force --recheck
I was able to recreate the EndeavourOS/grubx64.efi
But how to recreate the boot/bootx64.efi ?
Tip: If you use the option --removable then GRUB will be installed to esp/EFI/BOOT/BOOTX64.EFI (or esp/EFI/BOOT/BOOTIA32.EFI for the i386-efi target) and you will have the additional ability of being able to boot from the drive in case EFI variables are reset or you move the drive to another computer. Usually you can do this by selecting the drive itself similar to how you would using BIOS. If dual booting with Windows, be aware Windows usually places an EFI executable there, but its only purpose is to recreate the UEFI boot entry for Windows. If you are installing GRUB on a Mac, you will have to use this option. If you execute a BIOS update, this update might delete the existing UEFI boot entries. Therefore, it is a potential fallback strategy to have the “removable” boot entry enabled.
How does calamares do this during install? Couldn’t find the option “–removable” in UEFI grub install in /usr/lib/calamares/modules/bootloader/main.py
boot/bottx64.efi and EndeavourOS/grubx64.efi are exactly same in size? so are they the same with different names? if yes, then will copying one to the other work?
I am not familiar with all the Calamares’ ins and outs but I did take a quick look and found this:
Perhaps @dalto could shed some more light on this?
I guess you could do this as long as you rename the file and use the correct alternative boot path. However for it be “bootable”, I think you would need to write the boot entry to NVRAM manually using efibootmgr.