Bootloader: Difference between revisions

imported>Gnidorah
No edit summary
imported>Samueldr
Reviews section to be more factual and explains the difference with default settings.
Line 22: Line 22:
</syntaxhighlight>
</syntaxhighlight>


=== How to deal with full /boot in case of EFI ===
=== Limiting amount of entries with grub ===


systemd-boot (gummiboot) can't store kernels, initrd and other big stuff on root partition, so switch to grub
The grub module has an option to limit the number of configurations made available in the boot partition, {{nixos:option|boot.loader.grub.configurationLimit}}. Setting this to a lower amount than the default may help reduce the occasions where too many different kernels and initrds are added to the <tt>/boot</tt> partition or <tt>ESP</tt>.
 
=== Keeping kernels/initrd on the main partition ===
 
For these instructions, GRUB will be required; systemd-boot cannot reference boot files from the root partition. This will differ from the default expectation of NixOS on EFI, where <tt>/boot/</tt> is the <tt>ESP</tt>.


{{file|/etc/nixos/hardware-configuration.nix|nix|<nowiki>
{{file|/etc/nixos/hardware-configuration.nix|nix|<nowiki>
fileSystems."/boot/efi" = ...
fileSystems."/boot/efi" = ... # ← mount your ESP here instead of at /boot/.
</nowiki>}}
</nowiki>}}
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
boot.loader = {
boot.loader = {
   efi = {
   efi = {
     canTouchEfiVariables = true;
     canTouchEfiVariables = true;
     efiSysMountPoint = "/boot/efi";
     efiSysMountPoint = "/boot/efi"; # ← use the same mount point here.
   };
   };
   grub = {
   grub = {
Line 43: Line 46:
};
};
</nowiki>}}
</nowiki>}}
=== Limiting amount of entries with grub ===
The grub module has an option to limit the number of configurations made available in the boot partition, {{nixos:option|boot.loader.grub.configurationLimit}}. Setting this to a lower amount than the default may help reduce the occasions where too many different kernels and initrds are added to the <tt>/boot</tt> partition or <tt>ESP</tt>.
== Troubleshooting ==
== Troubleshooting ==