GRUB Menu not Installing On B650 MOBO

Hello everyone,

I recently upgraded from a B550 MOBO to a B650 MOBO. I previously had GRUB working but it reset back to systemd-boot after upgrade.

Steps taken (with no result)

  • Fresh reinstall of nixos
  • Using boot.loader.grub.efiInstallAsRemovable and booting from it’s UEFI entry in the MOBO
  • Changing boot.loader.grub.device to point to my NVME ssd
  • Changing the boot order in efibootmgr
  • Booting with both Linux Boot Manager and UEFI OS entries in the boot menu

My configuration.nix looks like the following:

  boot.loader = {
   efi = {
     canTouchEfiVariables = true;
     efiSysMountPoint = "/boot/efi";
    };
    grub = {
      enable = true;
      efiSupport = true;
       # efiInstallAsRemovable = true; # in case canTouchEfiVariables doesn't work for your system
      device = "nodev";
    };
  };

efibootmgr output:

BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0007,0002,0000
Boot0000* Windows Boot Manager	HD(1,GPT,f7e569fa-2130-4aac-ae92-fa8229f775e3,0x800,0x32000)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000064000100000010000000040000007fff0400
Boot0002* Linux Boot Manager	HD(1,GPT,51c58a1d-f4b7-45ca-ae5d-e93ab9ad2b2d,0x1000,0x100000)/\EFI\systemd\systemd-bootx64.efi
Boot0007* UEFI OS	HD(1,GPT,51c58a1d-f4b7-45ca-ae5d-e93ab9ad2b2d,0x1000,0x100000)/\EFI\BOOT\BOOTX64.EFI0000424f

How can I get GRUB to install correctly again?

Any help is appreciated, thanks in advance!

I would set device = "nodev";, I would not set efiInstallAsRemovable, and I would manually delete systemd-boot from the ESP because NixOS won’t do that for you. Finally, run nixos-rebuild --install-bootloader boot. That should take care of everything

(as an aside, I do genuinely find systemd-boot to be more reliable, so maybe consider using it).

Thanks for the response. I know it’s a bit of a novice question but I did fiddle around with efibootmgr and I wasn’t able to remove it from my ESP. I ran efibootmgr -A -b 0002 and it returned

efibootmgr: Boot entry 2 not found
Could not set active state for Boot0002: No such file or directory

I might try and use it actually, it’s really quick. The only reason I want to use GRUB is for themeing.

I figured out how to remove the entry for systemd-boot, I ran sudo efibootmgr -b 0002 -B. Then I ran sudo nixos-rebuild --install-bootloader boot --flake /etc/nixos#default. This created the new entry for GRUB.

efibootmgr output:

BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0001,0007,0000
Boot0000* Windows Boot Manager	HD(1,GPT,f7e569fa-2130-4aac-ae92-fa8229f775e3,0x800,0x32000)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000064000100000010000000040000007fff0400
Boot0001* NixOS-boot-efi	HD(1,GPT,51c58a1d-f4b7-45ca-ae5d-e93ab9ad2b2d,0x1000,0x100000)/\EFI\NixOS-boot-efi\grubx64.efi
Boot0007* UEFI OS	HD(1,GPT,51c58a1d-f4b7-45ca-ae5d-e93ab9ad2b2d,0x1000,0x100000)/\EFI\BOOT\BOOTX64.EFI0000424f

However, this EFI entry does not survive system reboot

Typically that means the entry fails to boot. i.e. The UEFI tried to boot the new entry, it failed immediately, and so it erased the bad boot entry.

1 Like

Welp, I’m out of ideas. Guess I’m using Systemd-boot despite how ugly it is. I really do appreciate the help tho

My solution to that has been setting boot.loader.timeout = 0;, which causes systemd-boot to not appear at all. Whenever I want a boot menu, I can just hold spacebar during boot to cause it to show up despite timeout = 0

1 Like

Ooh, I like that idea. Thanks for the heads up!