You are not logged in.

#1 2021-05-23 19:06:47

EmiSocks
Member
Registered: 2021-05-23
Posts: 2

[SOLVED] GRUB EFI entry keeps seemingly getting deleted

Hi all, sorry if this is not the correct place to post this, I'm not 100% convinced if this is a laptop-specific issue or not.

I've been running Arch on this laptop (Lenovo IdeaPad S340) for a little under a year now, with no real issues, dual booting with Windows using two partitions of the same disk. A couple days ago I started having this issue where rebooting the computer would cause it to boot immediately into Windows, instead of into the GRUB selection menu. Going into the EFI boot menu reveals that the GRUB option just... isn't there, only Windows remains. A friend guided me through the process of reinstalling GRUB by booting into an Arch install USB stick, which seemed to fix the problem... except after rebooting, the option was gone again, and I booted into Windows.

A few things that might be important:

* The first time it happened, the system actually crashed, but that hasn't happened since. I was using Arch normally (in the middle of a game, but I don't think it matters) when the system froze and I got a message saying something like "no bootable device found" (unfortunately I couldn't get a picture of it before it disapperared). This hasn't happened since, and I haven't been able to reproduce it. I don't think I've made any recent changes beyond just a full Pacman upgrade.
* The problem is inconsistent. Sometimes I can reboot the computer several times and GRUB is still there. Sometimes it has disappeared. Sometimes, not even installing GRUB fixes it, and I have to go through the process several times and hope one works.
* I doubt this problem is related to Windows at all. The crash happened while I was on Arch, and the entry gets deleted even when I don't boot into Windows in the first place.
* The files in the /efi partition seem to be intact. I can mount it and look at them and the GRUB directory is in there. It's the entry in the boot menu that disappears. I saw a note on the wiki saying that by passing --removable into grub-install you can boot from the drive in case EFI variables are reset, but this doesn't seem to have done anything.

I have no clue how to even start to debug an issue like this. Any help would be greatly appreciated!

Last edited by EmiSocks (2021-05-26 06:32:19)

Offline

#2 2021-05-25 07:53:25

autumnontape
Member
Registered: 2021-05-25
Posts: 1

Re: [SOLVED] GRUB EFI entry keeps seemingly getting deleted

What a weird problem! It seems like the EFI variables must be getting at least partially reset somehow, since the GRUB entry in the boot menu is disappearing altogether, and it seems like it's somehow happening before any boot loader even launches, since it sometimes happens even on the first power-on after you've repaired it.

Since the content of the EFI partition is apparently intact, I think you were on the right track with using --removable. You can boot Windows from GRUB, right? If you overwrite the Windows boot loader and put GRUB in its location, it will hopefully launch even after whatever is happening to your EFI variables happens. You should be able to find its path (starting with \EFI\) in the output of `efibootmgr -v`

I'm not the most knowledgeable about this stuff, so this solution might be nonsense to someone who is, but if you back up whatever you overwrite, you should be able to reverse your changes if it goes wrong.

Offline

#3 2021-05-25 09:53:23

Maniaxx
Member
From: .de
Registered: 2014-05-14
Posts: 420

Re: [SOLVED] GRUB EFI entry keeps seemingly getting deleted

Its a known problem with some BIOS roms (i'm affected as well). The real culprit is Windows though that forcefully wants it's nvram entry on top position (#1). Otherwise it deletes grub. Its doing that when you boot up Windows. The workaround is to let it do so, disable(!) it (set inactive with efibootmgr) and place grub below.


sys2064

Offline

#4 2021-05-26 06:30:47

EmiSocks
Member
Registered: 2021-05-23
Posts: 2

Re: [SOLVED] GRUB EFI entry keeps seemingly getting deleted

Here's an update:

I seem to have fixed it now. What I did was go into the UEFI shell and create an entry for GRUB manually with the help of this page on the wiki. I have no clue why the entry created by grub-install was getting deleted and this one is not, but I waited a day to make sure and it still seems to work, so... yeah.

If it stops working for whatever reason, I'll try what the post above suggests (I don't think it's that because it happened even when I never booted into Windows, but it's worth a shot). Thank you for the help!

Offline

#5 2021-05-26 08:18:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 12,992

Re: [SOLVED] GRUB EFI entry keeps seemingly getting deleted

Windows doesn't touch your EFI settings, every misbehaviour here comes from wonky UEFI vendor implementations, that they don't persist "externally" created entries is somewhat of a common one..

Online

#6 2021-05-26 12:33:00

Maniaxx
Member
From: .de
Registered: 2014-05-14
Posts: 420

Re: [SOLVED] GRUB EFI entry keeps seemingly getting deleted

This one might help as well. That's how it's broken on my side.
https://forums.fedoraforum.org/showthre … ng-Windows


sys2064

Offline

Board footer

Powered by FluxBB