this post was submitted on 17 Dec 2024
84 points (96.7% liked)

Linux

48693 readers
1777 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] renzev@lemmy.world 5 points 1 week ago

If GRUB is too confusing, just uninstall it? You said you have a UEFI system, you don't need a bootloader. You can just put the vmlinuz and initramfs onto the ESP and boot into it directly. You can use efibootmgr to create the boot entry, something like this:

efibootmgr \
	--create \
	--disk /dev/sda \
	--part 1 \
	--index 0 \
	--label "Void linux" \
	--loader /vmlinuz-6.6.52_1 \
	--unicode " \
		root=PARTLABEL=VOID_ROOT \
		rw \
		initrd=\\initramfs-6.6.52_1.img \
		loglevel=4 \
		net.ifnames=0 \
		biosdevname=0 \
		nowatchdog \
		iomem=relaxed \
		"
  • --disk /dev/sda: What disk is the esp on?
  • --part 1 What partition number (counting from 1) is the esp on?
  • --index 0 At what index in the boot menu should the boot entry appear?
  • --loader Path to the vmlinuz file. These are normally in /boot, you have to move it to the esp yourself
  • root=PARTLABEL=VOID_ROOT this is the linux root partiion. I'm using PARTLABEL to identify mine, but you can use pretty much anything that /etc/fstab supports
  • initrd=\\initramfs-6.6.52_1.img Again, you have to move the initramfs file from /boot into the esp. For some reason this uses backslashes, not forward slashes as path separator (double backslashes in this case are to prevent the shell from interpreting it as an escape sequence)
  • The rest of the arguments are just misc kernel parameters that I use

Just search for EFISTUB for more info.