Bootloader: Difference between revisions
imported>Samueldr Reviews section to be more factual and explains the difference with default settings. |
imported>Sfultong adding instructions for binding virtual file systems |
||
Line 54: | Line 54: | ||
* The ESP wasn't mounted and I want to re-generate the menu entries | * The ESP wasn't mounted and I want to re-generate the menu entries | ||
Booting from the installation media, mount the root partition, and the boot partition under <code>/mnt</code>. Next, run the [https://github.com/NixOS/nixpkgs/blob/e140d71d6330786c40b4bd9c0d59af7ad1a5e86a/nixos/modules/installer/tools/nixos-install.sh#L191-L192 command that the installer would run]. This will re-install the bootloader. | Booting from the installation media, mount the root partition, and the boot partition under <code>/mnt</code>. Next, bind system virtual file systems under <code>/mnt</code>. Finally, run the [https://github.com/NixOS/nixpkgs/blob/e140d71d6330786c40b4bd9c0d59af7ad1a5e86a/nixos/modules/installer/tools/nixos-install.sh#L191-L192 command that the installer would run]. This will re-install the bootloader. | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mount /dev/[root partition] /mnt | mount /dev/[root partition] /mnt | ||
mount /dev/[boot partition] /mnt/boot | mount /dev/[boot partition] /mnt/boot | ||
for i in dev proc sys; do mount --rbind /$i /mnt/$i; done | |||
NIXOS_INSTALL_BOOTLOADER=1 chroot /mnt \ | NIXOS_INSTALL_BOOTLOADER=1 chroot /mnt \ | ||
/nix/var/nix/profiles/system/bin/switch-to-configuration boot | /nix/var/nix/profiles/system/bin/switch-to-configuration boot |