r/archlinux • • 4d ago

QUESTION Firmware update wiped NVRAM, the fallback loader was ignored, and only Window was bootable. What's the right dual-boot setup to prevent this?

TL;DR: An MSI BIOS update wiped my UEFI boot entries. Afterwards the firmware only offered "Windows Boot Manager", even though \EFI\BOOT\BOOTX64.EFI existed on the same ESP. I got back in with efibootmgr from a live USB. How should I set things up so the next BIOS/firmware update doesn't lock me out again?

  • Disk 1: NVMe: Arch + Mint, one ESP mounted at /boot. Windows boot files (\EFI\Microsoft\) are on this ESP too.
  • Disk 2: SSD: Windows 11, no ESP of its own.
  • Boot loader: GRUB. At the time of the update, the fallback BOOTX64.EFI was Mint's shim (with fbx64.efi next to it), but no Mint entry got recreated either.
  • The update also turns Secure Boot back on by default. Turning it off alone didn't help, not 100% sure if this is related to the problem.

My guess is that the firmware rescanned the NVMe, found bootmgfw.efi, and created a "Windows Boot Manager" entry for it without ever trying the fallback. Last year's BIOS update with the same layout (Mint + Windows on this ESP) went fine, but I wasn't using Arch back at t he time.

I'm also planning to move from GRUB to systemd-boot. Is there any recommended setup which can survive the next firmware update?

From what I can tell, the only sure fix is to give Windows its own ESP on the SSD and remove it from the Linux ESP. The downside is that Windows won't show up in the systemd-boot menu, so I'd have to pick it from the firmware's boot menu (F11) instead.

2 Upvotes

21 comments sorted by

7

u/Zizaerion 4d ago

picking from the F11 boot menu and having two separate drives with their own ESP's is the only solution that will work for a dual boot with windows. Since the only option that will work to survive a firmware update is the fallback bootloader path. You can make it so that grub is also copied on the drive as the fallback bootloader path with the --removable flag in the grub install command. systemd-boot automatically installs itself as the fallback boot path so that's why it works.

0

u/thecatishungry 4d ago

What you're saying kind of matches what I've been researching, though one thing I don't understand.

Isn't the fallback path supposed to be exactly where the uefi firmware should look for bootloaders, in case there are no current entries in its NVRAM? In my case `\EFI\BOOT\BOOTX64.EFI` was there (I even replaced it with Arch's GRUB later) before the update, but the firmware still only offered Windows Boot Manager. Why did that take priority over everything else?

Either way, I will most likely take your advice and move the windows files to their own ESP on a separate disk.

2

u/tokillthelight 4d ago

Windows likes to be stupid and breaks things, keeping it on a separate drive is the only reliable way to stop it.

One thing you MIGHT want to consider doing when you install windows is remove the Linux drive from your computer to make sure it sets itself up entirely on its own drive, then you can use grub update (forget the exact command) to swt things up properly.

2

u/Particular-Poem-7085 4d ago

In fact make sure the windows drive is the only connected drive, the windows bootloader can be installed on a random one.

0

u/thecatishungry 4d ago

Windows likes to be stupid and breaks things, keeping it on a separate drive is the only reliable way to stop it.

Yeah, I'm well aware, that's why I keep it on a separate disk in first place. But the issue here happens even before you get the chance to boot into Windows (after the NVRAM wipe) for the first time.

I suspect that the UEFI firmware scans the ESP to rebuild it's entries, and for some reason if the windows loader is present there, it takes priority over the fallback file, and then it just stops adding more entries. This is speculation on my part, but at least it's what I think is happening.

2

u/tokillthelight 4d ago

I installed both windows & Arch Linux on their own with the other drive not present so the installers didnt have access to the other operating system.

1

u/thecatishungry 4d ago

That sounds like a good idea, but how does it relate to my problem?

2

u/tokillthelight 4d ago

Oh I have no idea why it happens, thats just what I had to do so it stopped occuring. You can try ask ai for reasons it occurs, I find googling the issue will lead to a while string of questions leading down a rabit hole.

I was focused on a work around/fix, if you want extra I dont have any insights. Best of luck, I stopped using windows a few months ago.

4

u/gmes78 4d ago

Thing is, you can recover this from Windows, using bcdedit. See here.

So I don't think making a separate ESP is worth it, since this rarely happens and can easily be fixed. And, if you want to switch to systemd-boot, you only option is to stay with a single ESP, as sd-boot cannot boot Windows installations on other ESPs.

2

u/thecatishungry 4d ago

Thing is, you can recover this from Windows, using bcdedit.

I understand this, but it's still annoying having to deal with that any time I decide to upgrade the firmware.

And, if you want to switch to systemd-boot, you only option is to stay with a single ESP, as sd-boot cannot boot Windows installations on other ESPs.

I wasn't even aware that systemd-boot (or any other boot loader for that matter) could boot installations outside of it's own ESP, like on a different disk.

But if you have two separate ESPs, you can still use the BIOS boot menu (F11/F12) or settings and switch the operating system that way, no?

1

u/gmes78 4d ago

I understand this, but it's still annoying having to deal with that any time I decide to upgrade the firmware.

It's a one minute fix every few months, at most.

But if you have two separate ESPs, you can still use the BIOS boot menu (F11/F12) or settings and switch the operating system that way, no?

You can, but unless you rarely use Windows, it's very annoying to do every time.

1

u/thecatishungry 4d ago

It's a one minute fix every few months, at most.

Well, I don't want to make it long, but it's not just that. For starters, I don't like the idea of getting locked out of my OS (Linux) in first place. At least not when I don't fully understand the technical reasons behind why it happens. I read docs and wikis, asked LLMs and posted this thread. Still not exactly sure exactly why it's happening.

And also, I don't like using any kind of Windows/Microsoft tooling for important system modifications. That's why I opted for live USB instead, as I noted in the description.

You can, but unless you rarely use Windows, it's very annoying to do every time.

I only use Windows a couple of times a year, so no big deal for me.

1

u/gmes78 4d ago

For starters, I don't like the idea of getting locked out of my OS (Linux) in first place. At least not when I don't fully understand the technical reasons behind why it happens.

It's very simple: firmware updates tend to clear the boot entries in NVRAM. The firmware is hardcoded to keep/recreate the Windows boot entry.

It's perfectly normal, and recreating the Linux boot entry will restore things to how they were. There are no side effects.

And also, I don't like using any kind of Windows/Microsoft tooling for important system modifications. That's why I opted for live USB instead, as I noted in the description.

The bcdedit commands used here are the Windows equivalent of efibootmgr. It works perfectly fine.

You can check the boot entries afterwards with efibootmgr.

1

u/thecatishungry 4d ago

The firmware is hardcoded to keep/recreate the Windows boot entry.

This is my current understanding of the situation too. Basically:

  1. Look for an ESP
  2. Check if EFI/Microsoft/Bootexists there
  3. If it does, then use that and call it a day

If it doesn't, keep looking and eventually it will reach the fallback at \EFI\BOOT\BOOTX64.EFI. Presumably this is why removing the Windows Boot loader from the ESP is necessary.

Kinda unfortunate how hardware is designed with Windows-first in mind, though I understand the reason behind that.

2

u/archover 4d ago

With a multi drive system, I hit F12 (UEFI boot menu) and simply choose the disk I want to boot. But, I don't run Windows. An option, maybe. IIRC, the UEFI system scans the drives, and presents bootable ones. No special config required.

Good day

1

u/thecatishungry 4d ago

That's what I will settle for I guess. My question was if there is a way or a particular setup to avoid that and just have everything on a single ESP while also surviving firmware updates, but I suppose not. Back when I was only using Mint, it survived firmware updates, so I thought I'm missing something obvious here.

Either way, not the end of the word if I have to use F11/F12.

1

u/archover 4d ago

I hear you. Most people don't want to hit F12. But, it's muscle memory for me now :-)

I have a dedicated laptop for Windows.

Hope you resolve it, and good day.

1

u/thecatishungry 4d ago

But, it's muscle memory for me now :-)

For me it's kinda the opposite. I boot into Windows so rarely, that the fear is forgetting how to even do it haha.

But yeah, have a lovely one.

1

u/archover 3d ago

Have fun, and good day.

2

u/ava1ar 4d ago

I have dual-boot with rEFInd as main bootloader - it is repairable from both Linux and Windows.

1

u/FigMan 3d ago

I keep my Arch ESP completely separate from Windows and never had any issues with rEFInd