Talk:Systemd-boot

From ArchWiki

$esp pseudo-var

I'd suggest replacing $esp that's prominent in the article with the standard /boot, i.e. replace

$esp is used to denote the mountpoint in this article.

with

In this article, /boot is used as the mountpoint.

And replace $esp instances accordingly. Changing the mountpoint is immediate to anyone who wants to do so, so another pseudo-var isn't required.

In addition, it's confusing to those who wish to go with the recommended /boot mountpoint. -- Alad (talk) 10:33, 5 January 2016 (UTC)Reply[reply]

While that could make sense, we'd create an inconsistency with all the other boot loader articles, which do use $esp as well: GRUB, Syslinux, EFISTUB and rEFInd. Personally, I don't think that using a variable like that is creating confusion, especially after [1]. — Kynikos (talk) 07:12, 9 January 2016 (UTC)Reply[reply]
This would be potentially confusing to a user with $esp mounted at /efi (one of the three standard locations for $esp). Such a user would have both /boot and /efi. If they read the Wiki with your modifications, every time they read /boot they would have to translate it to /efi. The only problem is there's a few places where the Wiki really does mean /boot. How would they know not to do the translation there? PBS (talk) 12:11, 11 November 2021 (UTC)Reply[reply]

Keys inside the boot menu, clarification

once you use keys to change timeout (-,T,+,t), this setting is saved in a non-volatile EFI variable; in this way `loader.conf` setting is overridden; a) how to clear the non-volatile EFI variable? b) how to show values of non-volatile EFI variables? --nTia89 (talk) 14:22, 27 May 2016 (UTC)Reply[reply]

https://bbs.archlinux.org/viewtopic.php?pid=1733461#p1733461
a) maybe reflashing the bios ^^ or efivar -w (be carefully you can brick your motherboard) b) also with efivar --name var -p
—This unsigned comment is by Fallback (talk) 21:13, 31 August 2017‎. Please sign your posts with ~~~~!

The section about Windows 8+ overriding boot settings is incorrect

I have a dual boot with Windows 10 and it does not override your boot settings or make Windows the default at each boot as explained in the wiki (it might during a major upgrade that work more or less as a new install, like Windows 8 -> Windows 10).

The fact is that, Windows normally manage the default boot efi file $esp\boot\efi\bootx64.efi and keep it identical to $esp/EFI/Microsoft/Boot/bootmgfw.efi . This file is often updated (I don't know if it is at every boot, but very often). The default installation of systemd-boot put also a copy of itself at the default $esp\boot\efi\bootx64.efi and this can gives a conflict because it will be overwritten by Windows. If we manage to correctly put a default boot entry in the firmware that is not $esp\boot\efi\bootx64.efi, there will be no problems. If we have a motherboard that can only boot $esp\boot\efi\bootx64.efi then and only then we are in trouble and the work around described in the wiki can make sense. It would be safer not touching $esp\boot\efi\bootx64.efi, I think Windows expect we do not touch this file.

—This unsigned comment is by Olive (talk) 21:28, 1 July 2016‎ (UTC). Please sign your posts with ~~~~!Reply[reply]

splash

add a section which talks about splash feature. --nTia89 (talk) 09:40, 9 July 2016 (UTC)Reply[reply]

loader.conf: timeout 0?

Missing (for me) is what happens when "timeout 0" is set in loader.conf

—This unsigned comment is by Probackup-nl (talk) 11:09, 22 November 2017‎. Please sign your posts with ~~~~!

boot into windows once?

Does anyone know whether there is a way to reboot into windows once from linux using a command line. I.e. instead of "reboot", but "reboot-windows", which will boot into windows without me choosing anything at the boot menu. And on next reboot reboot into linux as the default sets?

—This unsigned comment is by Minxu (talk) 21:06, 28 January 2018‎. Please sign your posts with ~~~~!

run efibootmgr, note the number of the entry you want to boot next, run efibootmgr -n $number, that sets the boot entry as BootNext.Taifleh (talk) 11:20, 7 March 2018 (UTC)Reply[reply]
You can use systemctl reboot --boot-loader-entry=<entry name> to directly boot a specific entry. However, this does not work with the auto-detected Windows Boot Loader, you have to create a boot entry. To list available options, run systemctl reboot --boot-loader-entry=help. The advantage is that you don't need efibootmgr installed. Might be worth to include in Systemd-boot#Choosing next boot? --help as mentioned there did not work for me. Qw3ry (talk) 08:58, 31 January 2020 (UTC)Reply[reply]
Here, and at the time of this writing, bootctl is installed by systemd. With it, a regular user, and root, can record the id of the windows entry from the output of bootctl list. Suppose it is auto-windows. Then, as root, bootctl set-oneshot auto-windows will boot into windows once. Regid (talk) 18:37, 18 November 2021 (UTC)Reply[reply]

arch.conf explanation could use some clearing up

Wouldn't it make a lot more sense to have the example options as `options root=/dev/sdxY rw` as opposed to some label? Also, in the explanation above it says `initrd=efipath` is a required option but I have never used this and booting into Arch works fine. Tonij (talk) 10:12, 5 December 2018 (UTC)Reply[reply]

That's usually not a good idea, see Persistent_block_device_naming. -- Lahwaacz (talk) 23:03, 5 December 2018 (UTC)Reply[reply]

System Rescue CD on ESP

Just like the already here "GRML on ESP" i tried to do the same with System Rescue CD (version 5.3.2). And unexpectedly it works! I followed the steps in the GRML section [2]:

- copied these files to

/boot/srcd/initram.igz
/boot/srcd/rescue64
/boot/srcd/systemrescuecd-x86-5.3.2.iso

- added an entry

title   SRCD
linux   /srcd/rescue64
initrd  /srcd/initram.igz
options docache setkmap=it isoloop=srcd/systemrescuecd-x86-5.3.2.iso

Before promoting to the main page, I'd like to have some feedback, thank you.

nTia89 (talk) 08:02, 23 September 2019 (UTC)Reply[reply]

Let's not do this. As you have (unconsciously? why would you expect it not to work?) noticed yourself, the GRML section serves as an example that can be generalized easily enough. Robg (talk) 15:14, 23 September 2019 (UTC)Reply[reply]
It was unexpected to me because I have just used that instructions for SRCD but I do not know neither what those files do nor have a theoretical base... It could have been easily a fluke! That's the reason why I wrote here. If you know it is logic and generic to every other distro, I'd like to add it to the section: I do not want to add a section for SRCD, a section for another distro, etc. but rework the section making it generic and keep GRML as example, because currently the section does not talk about it is a generic procedure! nTia89 (talk) 15:38, 23 September 2019 (UTC)Reply[reply]
It is not generic, but you can easily find out yourself what are the proper file names for the kernel image and initial ramdisk, as well as what are the required kernel options. This page certainly won't become what we had before on the Multiboot USB drive page, one example is more than enough. -- Lahwaacz (talk) 20:59, 23 September 2019 (UTC)Reply[reply]
I absolutely agree with you Lahwaacz, a notice box is enough but needed as well. nTia89 (talk) 21:08, 23 September 2019 (UTC)Reply[reply]
I can live with a notice. Why don't you add one, NTia89, and me or Lahwaacz will adjust it if necessary. A single sentence of the kind "the below example can be generalized to..." should do. Robg (talk) 12:40, 24 September 2019 (UTC)Reply[reply]
Done nTia89 (talk) 12:51, 24 September 2019 (UTC)Reply[reply]

Installation update XBOOTLDR

The current wiki page states the installation section is out of date

--path is no longer referenced inside of the bootctl man pages.

There are 2 new arguments to use instead (from the man pages of bootclt):

--esp-path=
Path to the EFI System Partition (ESP). If not specified, /efi/, /boot/, and /boot/efi/ are checked in turn. It is recommended to mount the ESP to /efi/, if possible.
--boot-path=
Path to the Extended Boot Loader partition, as defined in the Boot Loader Specification. If not specified, /boot/ is checked. It is recommended to mount the Extended Boot Loader partition to /boot/, if possible.

the Extended boot loader is labeled guid bc13c2ff-59e6-4262-a352-b275fd6f7172 or Linux Extended Boot

This --boot-path allows for a new partition to be created and systemd-boot can read from that as well as from the ESP

This Linux Extended Boot partition should still be formatted to vfat, though it should be able to read other file systems as well.

This means kernels are no longer required to be installed on the esp and can instead be held on the new /boot partition which systemd-boot is able to read

You can now mount the ESP to /efi then mount the new Linux Extened Boot Partion to /boot and create a loader entry in /boot/loader/entries/arch.conf and systemd-boot will be able to read and boot it.

Longer write ups written by me can be found on reddit and on the fourms

Info about XBOOTLDR can be found here

Thegreatzach (talk) 19:40, 6 April 2020 (UTC)Reply[reply]

EDIT:

The systemd gpt auto generator will only mount partitions that are on the same physical device.

Meaning that the Extended Boot Loader partition must be on the same disk as the ESP

source

Thegreatzach (talk) 13:30, 29 May 2020 (UTC)Reply[reply]

A reference to formatting the XBOOTLDR as FAT would be helpful. I couldn't find reference to making it FAT on any other Wiki page. Callmejoe (talk) 05:46, 13 April 2021 (UTC)Reply[reply]
https://wiki.archlinux.org/index.php/File_systems Scimmia (talk) 11:41, 13 April 2021 (UTC)Reply[reply]
nothing on that page that refers to linux extended boot partitions and how they should be formatted related to systemd-boot Callmejoe (talk) 13:25, 13 April 2021 (UTC)Reply[reply]
You said nothing told you how to make a FAT partition. That page does. And stop marking your edits as 'minor'. Scimmia (talk) 05:31, 14 April 2021 (UTC)Reply[reply]
Why would anyone check the filesystems page if you want to create a XBOOTLDR partition? I also searched for my issue, until I found a thread in the forum, which links to here. - Thus I agree with Callmejoe, add a note that the filesystem for XBOOTLDR must be FAT. Loader009 (talk) 15:34, 30 March 2022 (UTC)Reply[reply]
The file system on XBOOTLDR is not limited to the ones that UEFI has builtin drivers for (i.e. FAT). Since systemd 250, systemd-boot supports loading UEFI drivers from the ESP. E.g. to use ext4 on XBOOTLDR, you just need to install efifs and copy /usr/lib/efifs-x64/ext2_x64.efi to esp/EFI/systemd/drivers/. -- nl6720 (talk) 10:32, 31 March 2022 (UTC)Reply[reply]

Could we update the XBOOTLDR section to also mentioned an example of how to set the referenced GUID? This to avoid external posts. I don't know what the best notation would be however.

Torxed (talk) 15:02, 16 July 2023 (UTC)Reply[reply]

You dont set the GUID, you set the correct partition type in your partitioning tool. Not something to be covered here. Scimmia (talk) 16:09, 16 July 2023 (UTC)Reply[reply]
GPT uses partition type GUIDs. Info about setting this depends on the user's favorite partitioning tool and it is described on pages like fdisk or gdisk. — Lahwaacz (talk) 16:24, 16 July 2023 (UTC)Reply[reply]

add link to aur:kernel-install-hook

see kernel-install(8)

tldr - kernel-install runs scripts in /usr/lib/kernel/install.d or /etc/kernel/install.d. It automatically installs kernel and initramfs in $BOOT/<MACHINE-ID>/<KERNEL-VERSION>/kernel and $BOOT/<MACHINE-ID>/<KERNEL-VERSION>/initrd respectively. It also installs boot entry to $BOOT/loader/entries/<MACHINE-ID>-<KERNEL-VERSION>.conf.

The kernel-install-hookAUR automatically runs kernel-install when needed.

This works well for me for with both dracut and mkinitcpio for initramfs.

Also make sure you only have one initramfs generator installed, otherwise it might generate two initramfs.

ENV25 (talk) 16:00, 21 March 2021 (UTC)Reply[reply]

I wrote a newer pacman hook. AUR: pacman-hook-kernel-installAUR
ENV25 (talk) 12:56, 20 July 2021 (UTC)Reply[reply]

Update systemd-boot#Configuration to use automatic tools bundled with systemd

Systemd bundles the kernel-install tool (as noted by ENV25 above) which makes it very easy to manage multiple kernels among different installs on a single ESP. I propose we rewrite the current configuration section to include this as an automatic method in a subsection, and move the current contents to a subsection as a manual method. The automatic section would include topics like how to mask the default mkinitcpio pacman hook to stop the kernels installing to /boot/vmlinuz and /boot/initramfs.img, making/installing1 pacman hooks to move new kernels on install, and how to make an initramfs (since mkinitcpio -P will no longer work) and patch other scripts that may use mkinitcpio -P.

1My current intent is to use kernel-install-hookAUR for the automation part because it includes kernel-reconfigure which makes new initramfs for all kernels on the currently booted install, so users have a drop-in replacement for mkinitcpio -P

If there's any support for or objection to writing this section and moving the current content into a subsection I'd like to hear it.

Lsdaniel (talk) 01:49, 20 July 2021 (UTC)Reply[reply]

So you want to add a section on how to disable defaults, install unsupported packages, and edit scripts, all to make things *easier*? Doesn't make a lot of sense to me.
Scimmia (talk) 02:30, 20 July 2021 (UTC)Reply[reply]
If all you're going to do is rant, just keep it to yourself. -- Alad (talk) 09:42, 20 July 2021 (UTC)Reply[reply]
Is kernel-install the officially suggested tool (by upstream) for kernel management with systemd-boot? If so, I suppose we can make it the main subsection under "Configuration". In any case, how about we include Lsdaniel's proposed explanations in a subsection following "Adding loaders"? We can always decide on making it the main subsection later on and for now focus on the content. Also, many thanks to Lsdaniel for the kind editorial offer! -- Robg (talk) 12:51, 20 July 2021 (UTC)Reply[reply]
The AUR package is only pacman hook to automatically run kernel-install every kernel upgrade. It can be installed without the package.
"Editing scripts" is only needed to disable the mkinitcpio pacman hooks that genereate /boot/initramfs-linux.img. You do the same when you install dracut.
ENV25 (talk) 13:20, 20 July 2021 (UTC)Reply[reply]

Initial ESP setup description is confusing

The first section has the following: https://wiki.archlinux.org/title/Systemd-boot#Installing_the_EFI_boot_manager "esp will be used throughout this page to denote the ESP mountpoint, e.g. /boot or /efi"

But the important bit about ESPs is only present after systemd-boot is installed and boot entry cofigured: https://wiki.archlinux.org/title/Systemd-boot#Adding_loaders "Note that entries in esp can only use files (e.g. kernels, initramfs, images, etc.) in esp. Similarly, entries in boot can only use files in boot."

I think this note should be a much more prominent _and_ earlier warning, as one could currently easily get the impression that a lone /efi mountpoint is possible without additional configuration, like is the case with GRUB and possibly other bootloaders.

C0rn3j (talk) 12:40, 1 November 2021 (UTC)Reply[reply]

From what I've been reading, it is possible to install systemd-boot without any additional configuration (setting up loader.conf, etc.) if you use something like Unified Kernel Images, or any kernel that follows the UEFI .efi binary executable format. systemd-boot will find these as long as they're in the right place on the esp. They'd need to be signed if Secure Boot is enabled, but systemd-boot doesn't need any extra configuration in the UKI case.
I plan to use this feature exclusively when I set up my new laptop later this year, with UKI and Secure Boot.
Ectospasm (talk) 11:34, 26 September 2023 (UTC)Reply[reply]

Mount point '/boot' which backs the random seed file is world accessible, which is a security hole

systemd-boot boot loader complains about the regular setup. Should we add a note? any problem telling everyone to have `/boot` being `ro`?

—This unsigned comment is by Gcb (talk) 15:22, 26 December 2023. Please sign your posts with ~~~~!

This is not a systemd-boot exclusive issue. There is a discussion already in Talk:EFI system partition#Mountpoint umask.
Hanabishi (talk) 16:47, 26 December 2023 (UTC)Reply[reply]

Boot_from_another_disk section seems to have a bunch of misinformation

I read and tried to follow what is written in section 4.2.2 Systemd-boot#Systemd-boot#Boot from another disk. None of what's written there about PARTUUID follows reality for me. Specifically, none of the aliases shown by the map command have anything to do with a PARTUUID. I've seen this on a few different machines, including ones with with gigabyte, dell and MSI motherboards. Greyltc (talk) 04:48, 5 February 2024 (UTC)Reply[reply]