Bootloader: Difference between revisions

copy from old wiki
m oopsie, fix iso url
 
(5 intermediate revisions by 4 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 ==
 
=== 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 ===


== FAQ ==
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://wiki.nixos.org/wiki/NixOS_on_ARM NixOS on ARM] docs.


=== Am I booted in Legacy or UEFI? ===
=== Am I booted in Legacy or UEFI? ===
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 ====
Line 143: Line 160:


Some laptops, mostly those based on Intel Atom (and first-gen 2006-2007 Intel Macs), have a very strange setup: x86_64 CPU, 2-4GB of RAM, and ia-32 bootloader. They usually come with 64-bit Windows 10, which is slow and jerky on such configurations. Installing Linux on these systems is trivial, because most of the time you can just install 32-bit versions, which come with 32-bit UEFI bootloader, and not lose practically anything as amount of RAM is small enough for 32 bits of address. This is not the case with NixOS, though, because by choosing a 32-bit version you lose the prebuilt packages from nixos cache. To install a full 64-bit system with 32-bit bootloader, you need to take the following steps:
Some laptops, mostly those based on Intel Atom (and first-gen 2006-2007 Intel Macs), have a very strange setup: x86_64 CPU, 2-4GB of RAM, and ia-32 bootloader. They usually come with 64-bit Windows 10, which is slow and jerky on such configurations. Installing Linux on these systems is trivial, because most of the time you can just install 32-bit versions, which come with 32-bit UEFI bootloader, and not lose practically anything as amount of RAM is small enough for 32 bits of address. This is not the case with NixOS, though, because by choosing a 32-bit version you lose the prebuilt packages from nixos cache. To install a full 64-bit system with 32-bit bootloader, you need to take the following steps:
# Download both latest "Minimal installation CD, 32-bit Intel/AMD" and "Minimal installation CD, 64-bit Intel/AMD" from https://nixos.org/nixos/download.html.
# Download both latest "Minimal installation CD, 32-bit Intel/AMD" and "Minimal installation CD, 64-bit Intel/AMD" from https://nixos.org/download/#nixos-iso.
# Flash 32-bit version on USB stick and boot it. If it does not boot, then you probably have a 64-bit bootloader and do not need to worry about this tutorial.
# Flash 32-bit version on USB stick and boot it. If it does not boot, then you probably have a 64-bit bootloader and do not need to worry about this tutorial.
# Note: if your system hangs randomly when booted, you can try adding <nowiki>intel_idle.max_cstate=1</nowiki> to kernel parameters before booting (press e when you see systemd-boot prompt to enter editing mode).
# Note: if your system hangs randomly when booted, you can try adding <nowiki>intel_idle.max_cstate=1</nowiki> to kernel parameters before booting (press e when you see systemd-boot prompt to enter editing mode).
Line 174: Line 191:
</nowiki>}}
</nowiki>}}
to the grub section of your configuration.
to the grub section of your configuration.


=== Manually adding EFI boot entry ===
=== Manually adding EFI boot entry ===
Line 188: Line 204:


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]]