A bit of background: I built a new gaming PC last December, and stupidly put Windows 11 on it, and quickly learnt how horrible it was and decided to install EndeavourOS on the 2nd hard drive (it has 2 NVMe drives). Anyway, after using Linux I didn’t boot back into Windows even once, so it went more than 450 days or something without booting into Windows.
I know I should have just got rid of Windows since I wasn’t using it, but I just never got round to it. I will be doing that now.
What happened: I left my PC running (booted into Linux) whilst I was doing some stuff in the garden and in different parts of the house, for maybe an hour. When I came back, it was showing the Windows login screen?!!!
I was very confused, and restarted, but I couldn’t even get into the BIOS or boot menu any more, it just instantly booted into Windows. It had fully taken over. I had to do some searching to find out how to even get back into the BIOS, which basically involves going about 8 menus deep in Windows settings, behind lots of “advanced” and “troubleshooting” buttons/links, to find where you can tell it to do a special restart that lets you get into the BIOS.
Once in the BIOS, I could see that both hard drives had “Windows Boot Manager” listed as the UEFI boot option and EndeavourOS was not listed:
The last option there, SanDisk, is how I fixed it. I put EndeavourOS on a USB drive and booted into that.
My question is basically how did it happen? I assume this is just something Windows does: takes over the boot record on all connected hard drives? But presumably also Linux must have crashed… but how did it even end up booting into Windows, when the first option listed in the boot order has always been EndeavourOS? I don’t get it.
Is it possible that it crashed so badly that it failed to boot, or the UEFI boot record got corrupted, causing it to try the next boot option?
How I fixed it:
For anyone interested, I am very grateful to this guide I used: https://gist.github.com/andreibosco/b4f32090472f00c63c88149f11c2259a
For me bootctl update did not fix the problem (it said the boot record was already correct), it was the efibootmgr command which ultimately fixed it.
Full logs of the fix for me (done from live USB with chroot): https://pastebin.com/ai979aMC
