r/archlinux • • 1d ago

SUPPORT Windows keeps deleting my Grub entry

I've been using arch alongside windows for more than a year now and this happened to me s few days ago, never happened before.

Reinstalling grub fixes it, but every time I boot windows it deletes it from my UEFI/BIOS and (for some reason) it shows me OS entries that no longer exist (ubuntu and fedora if that's relevant).

I've tried doing the "bcdedit.exe" fix, tried putting a shim on my grub, updating the BIOS and tried to uninstall the newer versions of windows (for some reason, I can't uninstall KB5124008 nor KB5126052 and after rebooting windows it shows me that it is being updated).

I also thought of my BIOS battery running out but since the internal clock/date is OK and i have my desktop plugged in all the time I discarded that option.

Does anyone know what is happening to it? I know that if im present I can reinstall grub at any time but since I use a VNC server (on both OS) with a wakeup on LAN I could not go back to linux after going into windows.

16 Upvotes

24 comments sorted by

21

u/Confident_Hyena2506 1d ago

There is only one default spot on the efi partition - whatever occupies the bootx64.efi spots takes it. Windows will insist on this.

If you make explicit entries then you can select what you want, but don't rely on the default. Stop sharing same partition as windows if you don't want this to happen.

-5

u/Nylon2006 1d ago

I have two EFI partitions... But thank you trying to help me!

14

u/Confident_Hyena2506 1d ago

Windows does not touch your grub config. You should check what is actually on your efi partitions. Note that having a second one on same drive is not really well defined - some bios may just ignore the second one.

Also when you update bios on some systems the boards loses it's entries, then only the default gets used.

0

u/gmes78 1d ago

Note that having a second one on same drive is not really well defined - some bios may just ignore the second one.

It is allowed.

7

u/Confident_Hyena2506 1d ago

In the version you linked to. In reality the implementation does not follow the standard and people do not update their bios.

0

u/gmes78 1d ago

In the version you linked to.

Since UEFI 2.2, from 2010, actually.

In reality the implementation does not follow the standard and people do not update their bios.

But that is not what you said.

-3

u/Nylon2006 1d ago

I know what is in my Linux EFI partition, but don't know what is on Windows, how can I see it?

I have to say that in more than one and a half year I didn't have problems with dual booting (other OS).

This problem appeared a few days ago so I don't think it is a BIOS issue (nothing goes wrong when I boot arch, just when I do it on windows) .

10

u/Confident_Hyena2506 1d ago

There is no "linux efi partition" or "windows efi partition" - that's not how it works.

Instead just follow exactly how your computer is booting. What does the bios run when it starts up? It has to run something off some efi partition - either something you have configured or it falls back to bootx64.efi. Your issue right now is it's using that bootx64.efi somewhere.

https://wiki.archlinux.org/title/Dual_boot_with_Windows

These "phantom entries" are the fallback bootloaders, if there is a bootx64.efi on some efi partition then the bios will recognise that.

-1

u/Nylon2006 1d ago

I was referring on which OS uses each EFI.

When booting up uses grubx64.efi on my "linux" EFI. Then, I select which OS do I want to boot: linux does not modify anithing and Windows messes it up.

9

u/Confident_Hyena2506 1d ago edited 1d ago

You are omitting details like how you are setting up grub, if you use the extra option it will copy itself to fallback bootx64.efi. The only thing windows will change is also this bootx64.efi which would lead to your complaint.

To figure it out carefully examine the entire boot chain once system is booted, for both windows and linux. In particular check if it ran from fallback bootloader or explicit entry.

On linux "sudo bootctl" would show all this, not sure what is windows equivalent.

3

u/agmatine 1d ago

but don't know what is on Windows, how can I see it?

Just mount that partition within Linux.

3

u/archover 1d ago

FYI, that key additional info should have been in your original top post.

Good day.

4

u/BigSappari 1d ago

Had the same issue. For me it was the final nail in the coffin and reason enough to get rid of Windows for good.

Install Grub on a separate EFI partition with --removable, and with any luck, while it no longer boots automatically, it can still be selected in the bios boot menu, saving you the trouble of using some USB stick or other.

3

u/One-Yellow9778 1d ago

are you sure it's windows?

because that sounds more like a misbehaving motherboard firmware.

I had one bad motherboard in the past that suddenly started doing that and I couldn't rely on NVRAM entries at all. I had to install bootloader in default fallback EFI boot path (--removable option in grub) to work.

the issue is documented here, maybe that's what happening to you https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#UEFI_boot_loader_does_not_show_up_in_firmware_menu

9

u/Gustav__Mahler 1d ago

Have you tried deleting Windows?

5

u/3PoundsOfFlax 1d ago

Windows will never stop doing this. The best, permanent fix is to use a dedicated physical disk for each OS.

2

u/tjj1055 1d ago

windows has nothing to do with this.

7

u/[deleted] 1d ago

[removed] — view removed comment

4

u/tjj1055 1d ago

its not standard everything, windows does not delete grubx64.efi. he has 2 efi partitions which some UEFI dont handle well or dont support at all. what sometimes happens is that UEFI updates reset the boot entries.

1

u/Nylon2006 1d ago

I deleted those phantom entries again and again but they keep appearing.

Also, I disabled windows from the BIOS and only enabled Grub, but it keeps disappearing and booting the BIOS instead (since it can't boot windows). I also did it with efibootmgr tool from the ISO and still did nothing.

I'll try to do what you told me in the last part, where can I find more info?

1

u/onefish2 1d ago

Use rEFInd. I use that bootloader on all my systems that are dual boot/multi-boot with or without Windows. I have never had an issue "losing" a boot entry in 10 plus tears.

1

u/retiredwindowcleaner 1d ago

Highly doubt that, unless you have moved your arch efi files into the /EFI/Microsoft folder.

1

u/Mathisbuilder75 5h ago

I have been having the exact same issue lately. I dual booted for years and never had this problem.