Nixos remote install via ssh: error: will not proceed with blocklists

I have installed nixos manually on the target system with the following disk config

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/9501a69b-01b2-4c99-9bfe-bea99a58942c";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/232F-3A24";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
    };

Disk config on the system

[sudo] password for admin:
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SAMSUNG MZVLW512HMJP-000H1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 08A14483-C5D9-404A-80CF-51A98F68087B

Device           Start        End   Sectors   Size Type
/dev/nvme0n1p1    4096    1052671   1048576   512M EFI System
/dev/nvme0n1p2 1052672 1000206899 999154228 476.4G Linux filesystem
lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0 476.9G  0 disk
├─nvme0n1p1 259:1    0   512M  0 part /boot
└─nvme0n1p2 259:2    0 476.4G  0 part /nix/store
                                      /

Now I want to install the remote system via ssh

 sudo nixos-rebuild switch --flake '.#envy' --upgrade --target-host admin@10.0.0.11 --use-remote-sudo   

This fails with

updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/disk/by-uuid/232F-3A24...
Installing for i386-pc platform.
/nix/store/hjzaq7kxqfyxbv7m52zp008qpp47r8gv-grub-2.12/sbin/grub-install: warning: File system `fat' doesn't support embedding.
/nix/store/hjzaq7kxqfyxbv7m52zp008qpp47r8gv-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/hjzaq7kxqfyxbv7m52zp008qpp47r8gv-grub-2.12/sbin/grub-install: error: will not proceed with blocklists.
/nix/store/ri94ajal897axrm23xs1k3g2brmmh82g-install-grub.pl: installation of GRUB on /dev/disk/by-uuid/232F-3A24 failed: No such file or directory
Failed to install bootloader

The config I have is

  boot.loader = {
    systemd-boot.enable = false; 
    efi.canTouchEfiVariables = true;
    grub = {
      #devices = [ "/dev/disk/by-uuid/232F-3A24" ];
      device = "/dev/disk/by-uuid/232F-3A24";
      efiSupport = true;
      efiInstallAsRemovable = false;
    };
  };

I also tried different variations for device

  • /dev/nvme0n1p1
  • /dev/nvme0n1

So I probably miss something!?

Similar posts:

I found this information

Possible Solutions

  1. Use a Different Bootloader: If GRUB is proving too problematic, consider using an alternative bootloader like systemd-boot or rEFInd, which may have better support for your setup.

So systemd-boot.enable = true and removing grub stuff, works. Still wonder if there is a possibility to use grub instead?

Shouldn’t you set "nodev" as device (you are not installing to a device old-style, you are installing to mounted EFI System Partition)? Looks like NixOS GRUB module takes the mountpoint from efi.efiSysMountPoint

(Not 100% sure because I minimise the contact with NixOS module system and generate my bootscript from hand-written templates, no problem installing UEFI GRUB2 like that…)

2 Likes

Yes, it should be "nodev" when using an ESP.

Though, systemd-boot generally works better, and I would wholeheartedly recommend it over grub.

1 Like