How to add EFI entry by efibootmgr?

0

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.0.0:0<->0.0.0.0:0,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.

Googlebot

Posted 2014-08-23T11:14:18.550

Reputation: 846

Have you made sure that your EFI system partition (which must contain your bootlaoder) is FAT formated and have the "EFI-System" partitions lable (Code is: EF00)? Have you installed Ubuntu in UEFI-mode? This means you have actively selected the UEFI bootentry for the livecd in your UEFI-frimwares bootdevices screen. Ubuntu live-cds do NOT boot into UEFI mode by default. – paradoxon – 2014-08-23T13:47:36.007

@paradoxon I can boot into my OS too (but only once after adding HDD by efibootmgr via Live USB). I even added the HDD entry when I booted from the OS loaded from HDD. – Googlebot – 2014-08-23T14:19:09.967

This means your installed os runs in uefi mode, because it can access the UEFI-vars. Since this is a laptop, it was delivered with a preloaded Windows on it, wasn't it? Is secure boot enabled? – paradoxon – 2014-08-23T14:24:30.203

@paradoxon yes I've disabled secure boot. I added some new results to the question. – Googlebot – 2014-08-23T17:37:18.947

No answers