elitak/nixos-infect

lightsail: /boot partition will not be mounted correctly

Closed this issue · 1 comments

In amazon-image.nix, ESP Partition mount to /boot via a file system label ESP.

fileSystems."/boot" = mkIf (cfg.efi || cfg.zfs.enable) {
  # The ZFS image uses a partition labeled ESP whether or not we're
  # booting with EFI.
  device = "/dev/disk/by-label/ESP";
  fsType = "vfat";
};

https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/virtualisation/amazon-image.nix#L41

But it seems nixos-infect doesn't try to set the label. So grub-install will fail during nixos-switch
I think it's simple to fix by using dosfslabel

However, the EFI partition will indeed be mounted to /efi by some reason. I did not find any clear definition or reason. This is not expected.

Looks like I made a mistake, EC2 only uses EFI on arm instances.
So there is no problem, but the ESP partition does exist. Maybe it would be better to set the label.