hello,
I don’t know if this is the right place to ask this question but could someone explain me how a UEFI system boots, I couldn’t find a guide online. I want to know because I don’t understand certain GRUB commands and how it get installed.
I just copy paste commands from Arch wiki and it just magically works without me knowing anything about it.
all the different distros use different grub command parameter and it’s so confusing. eg, Arch and Gentoo.
Arch command: grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB Gentoo command: grub-install --efi-directory=/efi
why both command is different? exactly where does grub gets installed?
sorry if this is a naive question but i really don’t understnad GRUB.
Since you use UEFI, you don’t have to use GRUB. It basically consists 90% of cruft left over that was needed for BIOS boot, and has a lot of moving parts and bad design (such as a single config file which has to be shared between OSes, which is so complex it needs a generator for it).
Try systemd-boot, it’s lightweight and well designed.
Anyway, looks like the target parameter is default now, the “esp” in the arch command is supposed to be substituted for the ESP path, for example /efi, so the only difference is bootloader-id. Which looks like that’s the label that show up in your UEFI setup for the boot entry.
Yeah I know everyone likes to hate on systemd, but I like systemd-boot way more than GRUB. It just does its job and stays out of the way, I never have to fart about with it at all.
https://wiki.archlinux.org/title/EFI_system_partition#Typical_mount_points
(Efi System Partition)GRUB gets installed on your harddisk in your root partition, it’s configuration file on the boot partition and finally into your boot sector if I’m correct. UEFI is a standard for your firmware located outside your harddisk. You go from firmware -> partition layout -> bootloader (grub) -> kernel.
The firmware is closed source under BIOS or UEFI or if you’re hardcore open source, libreboot/coreboot/‘other options’ and is located somewhere on your motherboard on some chip.
Then there’s the partition layout and bootloader that are located inside/dev/sda
I believe, so inside the device itself, which can be read if you want to take a peek at it.Now the bootloader located in the boot sector
/dev/sda
loaded by the firmware located in some chip in the motherboard, has access to the boot partition, where it loads the bootloader’s configuration file usually located at/boot/grub/grub.cfg
for GRUB. I remember UEFI having some kind of standard bootloader by itself, so it doesn’t even need a bootloader if I can remember correctly.This what I recall as it was quite complicated for me too. Especially with software being called firmware and not being called motherbootware or pre-bootware or anything that indicates that this piece of software is the very first thing that starts running during boot.
But you look at
/boot
and what you can find there. There will be at least two files there called initramfs and vmlinuz, which were also part of the boot process, but I forgot what role those two played.I’m pretty sure UEFI systems don’t make use of a boot sector anymore. They look for the bootloader in the form of an .efi file in the ESP or EFI System Partition, of each sata drive (maybe other block devices too).
also, the disk it uses is not necessarily “/dev/sda”. first because it can be on any of the disks, second because that’s not a persistent ID but something that depends on detection order
Especially with software being called firmware and not being called motherbootware or pre-bootware or anything that indicates that this piece of software is the very first thing that starts running during boot.
firmware is a pretty common term for things like this (code on chip that manages low level startup)
firmware is a pretty common term for things like this (code on chip that manages low level startup)
It’s still a stupid term no matter how common it is. It has little to nothing to do with firms.