You are not logged in.

#1 2025-01-02 19:20:55

joaocandre
Member
Registered: 2013-02-23
Posts: 166

[SOLVED] systemd-boot entry won't show up / be detected during boot

I'm trying to set up a dual-boot system with Windows 11 and Archlinux, but for some reason, after finishing installation (including installing the bootloader) I get no 'Linux' entry during boot or any register of it on the Motherboard's boot section in the UEFI "BIOS" page.

I've installed Windows 11 first with a 1Gb EFI partition, then Archlinux, and lastly initramfs and the bootloader to the EFI partition.
I've checked that Fast Startup and Secure boot are disabled, and there are no errors when installing the bootloader, I get the /boot/EFI/systemd/systemd-bootx64.efi` entry as supposed.
I can boot into a USB live install of Arch and chroot into the local installation just fine (thus I assume the MB configuration is OK, Secure Boot is disabled), but reinstalling the bootloader produces no effect, it still won't boot or even show the systemd-boot entry (thus it isn't a case of Windows just being loaded first).

I see no information on the Wiki about such a scenario, is there something obvious I'm missing here?

EDIT: I am aware that I can attempt to create the boot entry directly with `efibootmgr`, but I am trying to understand what may be the issue here, considering I get no error during bootloader installation.

Last edited by joaocandre (2025-01-26 02:43:52)

Offline

#2 2025-01-02 20:10:46

u53r
Member
Registered: 2024-04-29
Posts: 4

Re: [SOLVED] systemd-boot entry won't show up / be detected during boot

There's probably something wrong with your entries files, but without seeing them it is impossible to tell exactly what.
Try to post here /boot/loader/loader.conf and your /boot/loader/entries/* files.

Offline

#3 2025-01-02 21:21:06

joaocandre
Member
Registered: 2013-02-23
Posts: 166

Re: [SOLVED] systemd-boot entry won't show up / be detected during boot

I've noticed that `bootctl` complains the system is not booted with EFI, which is strange considering the MB has legacy BIOS boot disabled and `/sys/firmware/efi/efivars` exists - I wonder if that's related with `arch-chroot`?


System:
Not booted with EFI

Available Boot Loaders on ESP:
    ESP: /boot
    File |_ /EFI/systemd/systemd-bootx64.efi (systemd-boot 257.1-1-arch)
         |_ /EFI/BOOT/bootx64.efi (systemd-boot 257.1-1-arch)

Boot Loader Entries"
    $BOOT: /boot
    token: arch

0 entries, no entry could be determined as default.

`/boot/loader/loader.conf` only has two commented lines:

#timeout 3
#console-mode keep

and  I have no entries under `/boot/loader/entries`.
To this point, having tried to manually add a boot entry with `efibootmgr`, the resulting boot screen from systemd-boot only has a 'Windows 11' entry.

Last edited by joaocandre (2025-01-02 21:21:39)

Offline

#4 2025-01-03 05:33:51

Nyctfall
Member
Registered: 2023-04-03
Posts: 45

Re: [SOLVED] systemd-boot entry won't show up / be detected during boot

joaocandre wrote:

I've noticed that `bootctl` complains the system is not booted with EFI, which is strange considering the MB has legacy BIOS boot disabled and `/sys/firmware/efi/efivars` exists - I wonder if that's related with `arch-chroot`?

Hmm... If "Legacy"/"CSM" or similar options are already disabled in the motherboard's UEFI settings, try checking some EFI settings to see what's going on:

  1. What is the output of:

    $ ls -lahF /sys/firmware/efi/efivars
  2. What is the output of:

    $ efivar --list
  3. What is the output of (as the "root" user, or with `sudo`):

    # efibootmgr --unicode
  4. What is the output of (depending on the filesystem mountpoint of the EFI System Partition on the drive):

    $ findmnt /efi
    $ findmnt /boot
    $ findmnt /boot/efi

    And also:

    # ls -lahF -R /boot /efi
  5. What is the output of:

    $ cat /sys/firmware/efi/fw_platform_size
joaocandre wrote:

To this point, having tried to manually add a boot entry with `efibootmgr`, the resulting boot screen from systemd-boot only has a 'Windows 11' entry.

Linux is not auto-detected by systemd-boot, using Arch Wiki > Systemd-boot > 7: "Configuration" as a reference.

Arch default systemd-boot example template:

$ cat /usr/share/systemd/bootctl/arch.conf
joaocandre wrote:

I've installed Windows 11 first with a 1Gb EFI partition, then Archlinux, and lastly initramfs and the bootloader to the EFI partition.

  1. First, find the location of the linux initramfs in the ESP (as root, or with `sudo`):
    Replace '/efi' with '/boot' if the ESP is mounted on '/boot'.

    # find /efi -name '*init*' -print
  2. Then, since there was no mention of moving a linux kernel image to the ESP, copy a kernel image to the ESP (as root, or with  `sudo`):
    Name the file something you can keep track of manually on the ESP (like using the kernel version and distro in the filename), unless you want to use a separate /boot partition and systemd-boot XBOOTLDR.

    # cp -vi /boot/vmlinuz-linux /efi/arch-linux-vmlinuz-linux-6.12.7.arch1-1
  3. Make a systemd-boot entry (and create the directories on the ESP, if necessary) using the file location of the linux kernel image and initramfs relative to the root of the ESP (or XBOOTLDR) partition:

    Make something like:
    esp/loader/entries/arch.conf:

    title   Arch Linux
    linux   /arch-linux-vmlinuz-linux-6.12.7.arch1-1
    initrd  /initramfs-linux.img
    options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw

    Then replace 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' with the UUID of the root partition:

    $ findmnt /

Rodsbooks "Managing EFI Boot Loaders for Linux" series is a very useful resource when dealing with UEFI booting. This in particular is essential to reference when managing default "fallback" boot entries: "Managing EFI Boot Loaders for Linux: Using fallback.efi" by Rod Smith

Last edited by Nyctfall (2025-01-03 06:36:36)

Offline

#5 2025-01-15 00:29:39

joaocandre
Member
Registered: 2013-02-23
Posts: 166

Re: [SOLVED] systemd-boot entry won't show up / be detected during boot

Sorry for the late reply!

In the end, I had to 1) create the Archlinux entry ''arch.conf" manually, pointing to the initramfs image generated by the 'mkinitcpio -P', as @Nyctfall describes on the second half of his comment; and 2) add a UEFI entry with 'efibootmg --create ...', basically everything 'bootctl install' should do (the issue of no archlinux entry in my previous comment was due to a malformed 'arch.conf' file).
The process is quite straighforward and well documented in the wiki; however I still haven't got a clue why 'bootctl install' did not work - nor why it complained about not being loaded with UEFI - and I haven't found any reference to a similar bug.
In relation to the suggestions in @Nyctfall's comment, I was sure that I was booting the live-USB in UEFI mode, I don't think that's the issue.
Nevertheless, for reference, I get the extensive list of EFI variables in 1) and 2);
3) prints the EFI bootloaders:

BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002, 0000
Boot0000* Windows Boot Manager HD(1, GPT,  <EFI Partition>/\EFI\Microsoft\Boot\bootmgfw.efi
Booot002* Linux Boot Manager   HD(1, GPT,  <EFI Partition>/\EFI\systemd\systemd-bootx64.efi

4) does not produce any output and  and 5) simply prints '64'.

Offline

#6 2025-01-24 03:20:50

Nyctfall
Member
Registered: 2023-04-03
Posts: 45

Re: [SOLVED] systemd-boot entry won't show up / be detected during boot

Since the primary issue is solved, please mark the thread as solved by editing the title to prepend it with "[SOLVED]".

As far as the further problems with `bootctl install` go, it would be more helpful and easier (in addition to much faster) if any applicable or requested files, logs, or command outputs were also provided in the post, or a pastebin service if very large.

joaocandre wrote:

I still haven't got a clue why 'bootctl install' did not work - nor why it complained about not being loaded with UEFI - and I haven't found any reference to a similar bug.

Assuming it's not some odd motherboard issue with UEFI booting USB drives, how is the Arch installer USB setup?
Is it a MBR or GPT formated drive?
What is the version of the Arch installer USB and it's packages?
Have you tried using `bootctl` from the PC's installed Arch setup on the internal drive partition?

You can try to see any errors from `bootctl install` or `bootctl update` by checking the shell return code variable '$?' immediately after, by running:

$ echo "$?"

Then, if the return code is non-zero, look up what the error return code means for `bootctl`. Both the `bootctl install` and the `bootctl update` commands should add systemd-boot to the motherboard's NVRAM EFI variables, so that should show if they're working without any errors. You could also try running them with `gdb` or 'DEBUGGER=gdb' too.

joaocandre wrote:

I get the extensive list of EFI variables in 1) and 2);
3) prints the EFI bootloaders:

BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002, 0000
Boot0000* Windows Boot Manager HD(1, GPT,  <EFI Partition>/\EFI\Microsoft\Boot\bootmgfw.efi
Booot002* Linux Boot Manager   HD(1, GPT,  <EFI Partition>/\EFI\systemd\systemd-bootx64.efi

4) does not produce any output and  and 5) simply prints '64'.

As far as the efivars situation goes, try checking what these EFI variables are:

From man 5 loader.conf:

The following configuration are supported by the loader.conf configuration file:

default
    A glob pattern to select the default entry. The default entry may be changed in the boot menu itself, in which case the name of the selected entry will be stored as an EFI variable, overriding this option.

    If set to "@saved" the chosen entry will be saved as an EFI variable on every boot and automatically selected the next time the boot loader starts.
Table 1. Automatically detected entries will use the following names:

Name                          | Description
--------------------------------------------------------------
auto-efi-default 	      | EFI Default Loader
auto-efi-shell 	              | EFI Shell
auto-osx 	              | macOS
auto-poweroff 	              | Power Off The System
auto-reboot 	              | Reboot The System
auto-reboot-to-firmware-setup | Reboot Into Firmware Interface
auto-windows 	              | Windows Boot Manager

Last edited by Nyctfall (2025-01-24 04:14:44)

Offline

#7 2025-01-24 16:59:52

GeorgeJP
Member
From: Czech Republic
Registered: 2020-01-28
Posts: 189

Re: [SOLVED] systemd-boot entry won't show up / be detected during boot

joaocandre wrote:

...4) does not produce any output ...

... then your EFI partition is not mounted, please post your

/etc/fstab

Offline

Board footer

Powered by FluxBB