3
nixos-install
building the configuration in /mnt/etc/nixos/configuration.nix...
copying channel...
installing the boot loader...
setting up /etc...
updating GRUB 2 menu...
mktemp: failed to create directory via template ‘/tmp/os-prober.XXXXXX’: No such file or directory
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
installing the GRUB 2 EFI boot loader into /boot/efi...
Installing for x86_64-efi platform.
/nix/store/j5fn7ksaaxxjq5ljzaa2kirjnygfrd2d-grub-2.02/sbin/grub-install: error: failed to get canonical path of `/boot/efi'.
/nix/store/bj5abk7dpchvp9ajrmcy0px7zip9qpib-install-grub.pl: installation of GRUB EFI into /boot/efi failed

I have the follow config for boot:

  # Use the GRUB 2 boot loader.
  boot.loader.grub.enable = true;
  boot.loader.grub.useOSProber = true;
  boot.loader.grub.version = 2;
  boot.loader.grub.efiSupport = true;
  boot.loader.grub.efiInstallAsRemovable = true;
  boot.loader.efi.efiSysMountPoint = "/boot/efi";
  # Define on which hard drive you want to install Grub.
  boot.loader.grub.device = "nodev"; # or "nodev" for efi only
  boot.loader.systemd-boot.enable = true;
  #boot.extraModprobeConfig = "options nouveau noaccel=1 runpm=0 nofbaccel=1 modeset=1";
  #boot.kernelPackages = pkgs.linuxPackages_latest;

What might be causing this issue? What is a 'canonical' path?

2 Answers 2

1

I had to mount the boot partition at /boot as opposed to /mnt/boot...

1
  • 1
    This contradicts the NixOS manual and doesn't seem to make sense.
    – AleXoundOS
    Jun 17, 2022 at 18:51
1

Since the specified mountpoint for ESP partition is /boot/efi:

boot.loader.efi.efiSysMountPoint = "/boot/efi";

it must be mounted so below /mnt, i.e. /mnt/boot/efi, at the time of running nixos-install (same for nixos-rebuild). The error failed to get canonical path of '/boot/efi' tells that it is not the case.

A common mistake is to mount ESP in /mnt/boot, which you seem to encounter. Mounting ESP in /boot is wrong approach too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .