UEFI and Linux

The UEFI (Unified Extensible Firmware Interface) is an example of a good idea developed, enforced, and implemented in the wrong way. What was meant to help us protecting our computer, turned into some kind of kidnapper that prevented us to use the OS of our choice.

Installing a different OS to the provided by the manufacturer is a, sometimes impossible, sometimes painful, task. Some manufacturers simply don’t contemplate the use of anything different from Windows 8 or 10 in their machines (ajem, HP, ajem), forcing us to press the Boot-order-selection key during the booting of OUR devices in order to being able to start, let’s say, Linux. Every single time. I repeat. Every. Single. Time. And it’s curious how, no matter which procedure you use, and how many times you change the UEFI boot order, Windows always comes to the top.

Although I have not been able to fix this problem in my HP machine (well, I know the solution, not buying HP products anymore), I successfully managed to fix it in 2 Lenovo machines. The procedure is quite easy -but use it under your own responsibility. Presuming that Linux has been installed in UEFI mode correctly (there are different methods to check this, but the easiest is to check if you have a boot/efi folder using the command df -h –local | grep /boot), you just need to install boot-repair:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install boot-repair
boot-repair

Just the quick setup should do the magic. However, in my experience, it was not so easy, and the machine was still booting into Windows. I had to boot into Windows and execute the following command in the command line with administrative privileges:

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

That seems to work in the Lenovo machines, but not for HP (such a surprise).