Bootloader: Difference between revisions

imported>Winny
tidy up boot parameters section and make it its own section
imported from old wiki
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{expansion|Explain what the bootloader does and which bootloader exists. Also explain Legacy Boot vs. UEFI and bootloaders for ARM platforms (with links)}}
== FAQ ==


== FAQ ==
=== What is a bootloader? ===
 
A bootloader is a type of software that manages the loading of the operating system (OS) on the computer at startup. It is responsible for preparing the system before passing control to the OS. Here are the types of bootloaders commonly used in NixOS:
* '''GRUB (Grand Unified Bootloader)''': Widely used, supports multiple operating systems, and provides a boot menu to select how the system boots.
* '''systemd-boot''': Simple UEFI-only bootloader, formerly known as gummiboot.
* '''EFISTUB''': Utilizes the UEFI firmware itself to boot the kernel, without the need for a traditional bootloader.
 
=== Legacy Boot vs UEFI ===
 
Legacy Boot and UEFI are two different methods of starting a computer. Legacy Boot, also known as BIOS, uses the Master Boot Record (MBR) to start the system, while UEFI (Unified Extensible Firmware Interface) uses the GUID Partition Table (GPT) and is the modern standard. UEFI supports larger hard drives, faster boot times, and more security features compared to Legacy Boot. Additionally, UEFI provides a better user interface and a more robust pre-boot environment.
 
=== Bootloaders for ARM platforms ===
 
On ARM platforms, the bootloader options can vary significantly based on the architecture and specific hardware. Common bootloaders include:
* '''U-Boot''': Universal Boot Loader, widely used in ARM devices.
* '''EFI ARM bootloaders''': Some ARM devices support UEFI, allowing the use of standard UEFI bootloaders like GRUB or systemd-boot.
 
For more detailed information on NixOS and ARM architecture, refer to the [https://nixos.wiki/wiki/NixOS_on_ARM NixOS on ARM] docs.


=== Am I booted in Legacy or UEFI? ===
=== Am I booted in Legacy or UEFI? ===
Line 65: Line 82:
* <code>boot.debug1mounts</code> stop after mounting file systems.
* <code>boot.debug1mounts</code> stop after mounting file systems.
* <code>boot.panic_on_fail</code> panics on failure.
* <code>boot.panic_on_fail</code> panics on failure.
* <code>console=</code> set the console to something
* <code>console=</code> set the console to something.
* <code>root=</code> If a root device is specified on the kernel command line, make it available through the symlink /dev/root.
* <code>root=</code> If a root device is specified on the kernel command line, make it available through the symlink /dev/root.
* <code>findiso=</code> if an iso name is supplied, try to find the device where the iso resides on.
* <code>findiso=</code> if an iso name is supplied, try to find the device where the iso resides on.
Line 73: Line 90:


* Something happened, and the bootloader doesn't work as expected.  
* Something happened, and the bootloader doesn't work as expected.  
* The ESP was re-made and nothing was kept
* The ESP was re-made and nothing was kept.
* 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.


==== From a running system ====
==== From a running system ====


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo nixos-rebuild --install-bootloader switch
sudo nixos-rebuild --install-bootloader boot
</syntaxhighlight>
</syntaxhighlight>


Line 188: Line 205:


If you have some problems with installation, report them on [https://matrix.to/#/#nix:nixos.org #nix:nixos.org on Matrix].
If you have some problems with installation, report them on [https://matrix.to/#/#nix:nixos.org #nix:nixos.org on Matrix].
[[Category:Booting]]