I recently migrated my system to UEFI boot.

The system is a HP EliteBook 840 G1, with a SATA hard disk. Ubuntu is the only operating system.

I converted the disk to GPT, added the necessary partitions, installed grub-efi-amd64, then ran grub-install --target=x86_64-efi /dev/sda. (Based on my bash history – this was done a while back.)

When I rebooted the system, it booted right into Ubuntu.

However, after the first cold boot, the system did not boot properly: first it tried to boot from LAN, then presented me with a message that there was no OS installed and prompted me to press F2 for system diagnostics. I did that, exited the diagnostics tool, and Ubuntu came up.

I tried messing with the boot order in BIOS setup. There is no option to boot from the SATA disk (but one to boot from the M.2 SSD, if one were installed). So I moved OS boot manager to the top, but to no avail – I still get the same error.

What gives?

1 Answer 1


After comparing partition tables with another system in GParted, I noticed my EFI system partition had incorrect flags set: msftdata was set while boot and esp were missing.

In addition to that, I undid the earlier workaround attempt and moved OS Boot Loader to the top of the boot order.

The system has now been through multiple shutdowns and came up with no need for manual intervention every time.

The earlier approach (shown below) seemed to work once, but at the next attempt, the old behavior was back.

I solved the issue by adding a custom boot entry with the following path:


Things may look different on your system; try browsing /boot/efi (which should point to your EFI partition) and look for .efi files there. Strip the initial /boot/efi (e.g. /boot/efi/EFI/ubuntu/grubx64.efi becomes \EFI\ubuntu\grubx64.efi) and configure that as a custom boot entry.

Make sure the custom boot entry is in your list, preferably at the top (so the system does not accidentally try to boot from something other than you intended).

Now the system boots right into Ubuntu even after a cold boot.

Note: on my system, there is also another entry at \EFI\BOOT\BOOTX64.EFI; no idea if that is different from the grub entry.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .