Change the boot order with no option in UEFI settings

bootmulti-bootuefi

I have got a Lenovo MIIX 310-ICR 2-in-1 with Windows 10 preinstalled. I installed Ubuntu on it, but to boot into Ubuntu I have to either restart while holding Shift in Windows 10 to get to its boot list, or when turned off, hold Power and Volume + until I see the UEFI boot list, and choose Ubuntu from there.

What I want is to make it boot from the Ubuntu partition by default, so then I could choose which OS to boot from grub. I do not mind using another boot manager like rEFInd, or none at all; since I want to uninstall Windows once I get this sorted out. Although I would prefer keeping grub just in case I screw up Ubuntu and need to switch kernels or boot in recovery mode easily.

I went to the UEFI settings to change the boot order, but there is no option for that, so I think the only way to do it is not going to be through the UEFI settings.

BIOS version: 1HCN44WW

UPDATE:

Output of efibootmgr:

BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0002,0003,0001,2001,2002,2003
Boot0001* Windows Boot Manager
Boot0002* rEFInd Boot Manager
Boot0003* ubuntu
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network

Output of sudo ls /boot/efi/EFI:

Boot  Insyde  Microsoft  refind  tools  ubuntu

Best Answer

The solution described in my first answer is valid in general cases, but it seems that InsydeH2O UEFIs may ignore boot order. Many laptop manufacturers use Insyde firmware, so many models are affected by this issue. Yours uses Insyde UEFI too, as indicated by the presence of EFI/Insyde directory on the EFI System Partition (ESP, mounted as /boot/efi under Linux).

A question about similar issue was asked on AskUbuntu. Its OP analysed how this UEFI looks for boot candidates on ESP. The order is:

  1. EFI/Microsoft/Boot/fwbootmgr.efi
  2. EFI/*/grubx64.efi
  3. EFI/Boot/bootx64.efi

They have described their experiments and final setup in their self-answer, so I won't repeat that knowledge here.

Keep in mind that Windows may not be able to properly restore from hibernation/hybrid shutdown after messing with its boot files, as noted by another user in a comment.

Note that you can access the ESP under Windows too by mounting it using the diskpart tool:

  1. Launch diskpart by typing its name in the Start menu.
  2. List partitions and find ESP: list partition Enter. Look at partition labels and sizes, ESP will typically be under 600 MB.
  3. Select ESP: select partition <x> (<x> is number from the previous list)
  4. Mount the partition: assign letter=Z. A new drive Z: will appear.
Related Question