Change boot order using efibootmgr

Solution 1:

First, a complaint that boot files are far from the start of the disk is irrelevant on an EFI-booting computer. There are limits under BIOS (which vary depending on how old the BIOS is), but even under a (modern) BIOS, your 750GB disk should pose no problems.

Second, you can change the BootOrder variable with efibootmgr's -o option, as in:

sudo efibootmgr -o 0,1,2

This command will set the two ubuntu instances first, followed by the Windows Boot Manager entry. That should do the trick. Unfortunately, some EFIs are buggy, and "forget" the BootOrder entry or otherwise misbehave. If you have problems, I recommend trying the following command in a Windows Administrator Command Prompt window:

bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi

(If you've disabled Secure Boot, you can replace shimx64.efi with grubx64.efi, although either should work with Secure Boot disabled.)

If that fails, then your firmware is probably defective. There may be an update available from HP. If not, or if it doesn't help, and if you're within the return period for your computer, return it for a refund and get something that's not broken. If you can't do that, then you're into the territory of really ugly workarounds, like renaming GRUB so that it pretends to be the Windows boot loader. See here for some information on that topic, albeit written specifically for rEFInd. The basic principles apply to anything, though.

Solution 2:

If you go into your BIOS options where you see just osmanager and USB, disk, etc. You have to highlight the osmanager and press enter you will get a menu of Ubuntu windows and any other distro. Use f5 and f6 to rearrange to your liking and click f10 to save it. If you use multi boot and only see one Linux distro in your grub menu, enter Linux and use

sudo grub-update 

Solution 3:

In my case the solution was:

sudo su
cd /boot/efi/EFI
mv BOOT BOOT_bak
cp -R ubuntu BOOT
cd BOOT
mv shimx64.efi bootx64.efi

Thanks to idimopoulos from dell forum