elitak / nixos-infect

[GPLv3+] install nixos over the existing OS in a DigitalOcean droplet (and others with minor modifications)
GNU General Public License v3.0
1.36k stars 221 forks source link

lightsail: /boot partition will not be mounted correctly #217

Open LostAttractor opened 1 month ago

LostAttractor commented 1 month ago

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.

LostAttractor commented 3 days ago

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.