Search this blog

Tuesday, October 25, 2016

howto crudely override the uefi boot order on HP pavilion

As past readers of this blog may remember, this  hardware is not intuitive as far as work with  multiple os-loaders goes.  These days I'm mostly using Linux. still, on occasion I try thing on Windows, and an experiment gone wrong (how to minimize a Windows 10 partition) created a very sad situation in which Windows OS loader, which as far as UEFI cares has become the computer's OS-loader, was no longer able to boot into a functional Windows 10. I could have cared more, and use whatever recovery mean necessary to bring this computer's Windows installation to working order. But it just doesn't seem logical to put that time in. First - I have a well functioning Windows 7 working on another computer (for whatever needs of the communicating with the world variety). And second - because if I do any serious Microsoft-related work on this computer, it would be to install windows 7 on it (which would probably turn out a rather tedious task, considering the fact that it is a Windows8-era machine). 

All this introduction came as an attempt to explain that what I actually needed was to over-run the uefi boot order so that my linux would boot up first, and had no special need to get the entire uefi setup into order, or make sure that windows would be easy to boot into as well. 

A nice discussion on AskUbuntu provided the answer which summed up in short to a replacement of the efi boot file used to boot into the MS Os-loader, with the efi boot file used to boot into Grub (paths may vary according to specific installation). 

The steps: 
1. backup the Microsoft efi file 
    cd /boot/efi/EFI/Microsoft/Boot/
    sudo mv bootmgfw.efi bootmgfw.efi.bak
2. overwrite the Microsoft efi file with the grub file 
   sudo cp /boot/efi/EFI/ubuntu/grubx64.efi  bootmgfw.efi

And now the machine boots into Linux with no delays.