Linux – How to add EFI entry by efibootmgr


I installed stand alone Ubuntu on my laptop by formatting the HDD. Now HDD is not in my EFI menu. From a Live USB environment, I added the EFI entry, even by chroot. However, the EFI menu is reset to the original after shutdown.

Upon restarting the computer, booting from HDD works, as EFI HDD is still on the list, but if shutting down the computer, the menu would be reset.

How can I add EFI HDD entry to the EFI menu permanently?

NOTE: my BIOS setting is very simple with almost no option to be changed in this regard. This is about efibootmgr commands.

UPDATE: I am booting into HDD now, but strangely on every boot I add a HDD entry via efibootmgr and the previous one is removed upon rebooting. This means that every EFI entry has a lifetime of one rebooting.

This is output of efibootmgr -v

BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0003,0004,2003,2001
Boot0001* UEFI: IP4 Realtek PCIe FE Family Controller   ACPI(a0341d0,0)PCI(1c,2)PCI(0,0)MAC(0c54a5b1f8be,0)IPv4(<->,0, 0..BO
Boot0002* UEFI: IP6 Realtek PCIe FE Family Controller   ACPI(a0341d0,0)PCI(1c,2)PCI(0,0)MAC(0c54a5b1f8be,0)030d3c000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000..BO
Boot0003* Ubuntu 7  HD(1,800,100000,0af63fdd-2949-4624-8410-9889ab0360a0)File(\EFI\ubuntu\grubx64.efi)
Boot2001* EFI USB Device    RC
Boot2003* EFI Network   RC

The strange thing is that UEFI does not detect the HDD.