Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "boot.loader.grub.devices" with EFI configuration #981

Open
lupoalberto12 opened this issue Feb 18, 2025 · 2 comments
Open

No "boot.loader.grub.devices" with EFI configuration #981

lupoalberto12 opened this issue Feb 18, 2025 · 2 comments

Comments

@lupoalberto12
Copy link

Hi.
It's not an "issue" but I have no idea how to solve the problem.
I've been trying to use Disko for a while and, starting from the basic configurations:
with a "grub MBR" configuration like in single-disk-ext4 it works, no problem
with an "EFI" configuration simple-efi.nix I have always this error:

       error:
       Failed assertions:
       - You must set the option ‘boot.loader.grub.devices’ or 'boot.loader.grub.mirroredBoots' to make the system bootable.

In general, with any configuration without the "boot" part for grub MBR, the installation does not proceed because it does not find the "/boot" partition.

In the Quickstart Guide I read this:

e) If you chose the hybrid-partition scheme, then choose grub as a bootloader, otherwise follow the recommendations in Step 4 of the Installation section of the NixOS manual. The following configuration for grub works for both EFI and BIOS systems. Add this to your configuration.nix, commenting out the existing lines that configure systemd-boot. The entries will look like this:

Note: It's not necessary to set boot.loader.grub.device here, since Disko will take care of that automatically.

...

#boot.loader.systemd-boot.enable = true;
#boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.efiInstallAsRemovable = true;

...

and in my "configuration.nix" file I have:

imports =
    [
      ./hardware-configuration.nix                              # Hardware configuration
      "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix"
      ./disk-config.nix
    ];

Any suggestion?
Thanks.
Regards.

@rahatarmanahmed
Copy link

rahatarmanahmed commented Feb 28, 2025

I ran into this, too, while playing around with nixos-anywhere to install on a VM. My complete flake here: https://gist.github.com/rahatarmanahmed/4b0ef70f80c3551a91d0fbbefedbed74

I tried setting grub.devices manually to /dev/vda, that let the installation continue up until it failed to install. Then I tried /dev/vda1 since that was the boot partition that was created but same error. The error looked like this:

installing the boot loader...
setting up /etc...
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/vda1...
Installing for i386-pc platform.
/nix/store/psjdqahqppg41j8gq9vjhbyz82zl5ric-grub-2.12/sbin/grub-install: warning: File system `fat' doesn't support embedding.
/nix/store/psjdqahqppg41j8gq9vjhbyz82zl5ric-grub-2.12/sbin/grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/nix/store/psjdqahqppg41j8gq9vjhbyz82zl5ric-grub-2.12/sbin/grub-install: error: will not proceed with blocklists.
/nix/store/p9bjxsff2v3z3gcc5c9rjrfl68w55qj2-install-grub.pl: installation of GRUB on /dev/vda1 failed: No such file or directory
Failed to install bootloader

@rahatarmanahmed
Copy link

Update for me:

I figured out what I had wrong with my own setup:

  1. My virt-manager VM was set up with a BIOS firmware and I had to make a new one with UEFI
  2. I had to set boot.loader.grub.device to "nodev" and maybe include efiInstallAsRemovable. See this thread: https://discourse.nixos.org/t/configure-grub-on-efi-system/2926/10

Still, maybe the action item here is to update the example config that we copied or at least add a note about what to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants