You are not logged in.

#1 2025-10-25 02:06:27

HaloSlayer255
Member
Registered: 2015-02-11
Posts: 31

[Solved] Duplicated Systemd-bootloader entries?

Hello everyone,

I don't know how this happened but it seems that I have duplicate boot loader entries for Arch Linux and Windows 11.

Output of bootctl command:

[robert@RobertsFrameWork ~]$ bootctl
System:
      Firmware: UEFI 2.80 (INSYDE Corp. 0.776)
 Firmware Arch: x64
   Secure Boot: enabled (user)
  TPM2 Support: yes
  Measured UKI: yes
  Boot into FW: supported

Current Boot Loader:
       Product: systemd-boot 258.1-1.1-arch
     Features: ✓ Boot counting
               ✓ Menu timeout control
               ✓ One-shot menu timeout control
               ✓ Default entry control
               ✓ One-shot entry control
               ✓ Support for XBOOTLDR partition
               ✓ Support for passing random seed to OS
               ✓ Load drop-in drivers
               ✓ Support Type #1 sort-key field
               ✓ Support @saved pseudo-entry
               ✓ Support Type #1 devicetree field
               ✓ Enroll SecureBoot keys
               ✓ Retain SHIM protocols
               ✓ Menu can be disabled
               ✓ Multi-Profile UKIs are supported
               ✓ Loader reports network boot URL
               ✓ Support Type #1 uki field
               ✓ Support Type #1 uki-url field
               ✓ Loader reports TPM2 active PCR banks
     Partition: /dev/disk/by-partuuid/4567eee4-9c44-43da-a43e-76d047b4966f
        Loader: └─/boot//EFI/systemd/systemd-bootx64.efi
 Current Entry: arch-linux.efi

Current Stub:
      Product: systemd-stub 258.1-1.1-arch
     Features: ✓ Stub reports loader partition information
               ✓ Stub reports stub partition information
               ✓ Stub reports network boot URL
               ✓ Picks up credentials from boot partition
               ✓ Picks up system extension images from boot partition
               ✓ Picks up configuration extension images from boot partition
               ✓ Measures kernel+command line+sysexts
               ✓ Support for passing random seed to OS
               ✓ Pick up .cmdline from addons
               ✓ Pick up .cmdline from SMBIOS Type 11
               ✓ Pick up .dtb from addons
               ✓ Stub understands profile selector
    Partition: /dev/disk/by-partuuid/4567eee4-9c44-43da-a43e-76d047b4966f
         Stub: └─/EFI/Linux/arch-linux.efi

Random Seed:
 System Token: set
       Exists: yes

Available Boot Loaders on ESP:
          ESP: /boot (/dev/disk/by-partuuid/4567eee4-9c44-43da-a43e-76d047b4966f)
         File: ├─/boot//EFI/systemd/systemd-bootx64.efi (systemd-boot 258.1-1.1-arch)
               └─/boot//EFI/BOOT/BOOTX64.EFI (systemd-boot 258.1-1.1-arch)

Boot Loaders Listed in EFI Variables:
        Title: Linux Boot Manager
           ID: 0x0001
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/4567eee4-9c44-43da-a43e-76d047b4966f
         File: └─/boot//EFI/systemd/systemd-bootx64.efi

        Title: Windows Boot Manager
           ID: 0x0002
       Status: inactive, boot-order
    Partition: /dev/disk/by-partuuid/4567eee4-9c44-43da-a43e-76d047b4966f
         File: └─/boot//EFI/Microsoft/Boot/bootmgfw.efi

Boot Loader Entry Locations:
          ESP: /boot (/dev/disk/by-partuuid/4567eee4-9c44-43da-a43e-76d047b4966f, $BOOT)
       config: /boot//loader/loader.conf
        token: arch

Default Boot Loader Entry:
         type: Boot Loader Specification Type #2 (UKI, .efi)
        title: Arch Linux (6.17.4-arch2-1.1)
           id: arch-linux.efi
       source: /boot//EFI/Linux/arch-linux.efi (on the EFI System Partition)
     sort-key: arch
      version: 6.17.4-arch2-1.1
        linux: /boot//EFI/Linux/arch-linux.efi
      options: root=UUID=ae2b9616-fe29-4255-ae6e-9f2299257433 rw

Output of bootctl list command:

[robert@RobertsFrameWork ~]$ bootctl list
         type: Boot Loader Specification Type #2 (UKI, .efi)
        title: Arch Linux (6.17.4-arch2-1.1) (default) (selected)
           id: arch-linux.efi
       source: /boot//EFI/Linux/arch-linux.efi (on the EFI System Partition)
     sort-key: arch
      version: 6.17.4-arch2-1.1
        linux: /boot//EFI/Linux/arch-linux.efi
      options: root=UUID=ae2b9616-fe29-4255-ae6e-9f2299257433 rw

         type: Boot Loader Specification Type #1 (.conf)
        title: Arch Linux (6.17.4-arch2-1.1) (1e0c26436b1344af943093801982e93d)
           id: 1e0c26436b1344af943093801982e93d-6.17.4-arch2-1.1.conf
       source: /boot//loader/entries/1e0c26436b1344af943093801982e93d-6.17.4-arch2-1.1.conf (on the EFI System Partition)
     sort-key: arch
      version: 6.17.4-arch2-1.1
   machine-id: 1e0c26436b1344af943093801982e93d
        linux: /boot//1e0c26436b1344af943093801982e93d/6.17.4-arch2-1.1/linux
       initrd: /boot//1e0c26436b1344af943093801982e93d/6.17.4-arch2-1.1/initrd
      options: root=UUID=ae2b9616-fe29-4255-ae6e-9f2299257433 rw systemd.machine_id=1e0c26436b1344af943093801982e93d

         type: Boot Loader Specification Type #2 (UKI, .efi)
        title: Arch Linux (Rescue Image 20251018063249)
           id: archlinux-rescue.efi
       source: /boot//EFI/Linux/archlinux-rescue.efi (on the EFI System Partition)
     sort-key: archlinux-rescue
      version: 20251018063249
        linux: /boot//EFI/Linux/archlinux-rescue.efi

         type: Boot Loader Specification Type #1 (.conf)
        title: Windows 11
           id: windows.conf
       source: /boot//loader/entries/windows.conf (on the EFI System Partition)
          efi: /boot//EFI/Microsoft/Boot/bootmgfw.efi

         type: Boot Loader Specification Type #1 (.conf)
        title: Reboot
           id: reboot.conf
       source: /boot//loader/entries/reboot.conf (on the EFI System Partition)
          efi: /boot//reboot.efi

         type: Boot Loader Specification Type #1 (.conf)
        title: POWER OFF
           id: poweroff.conf
       source: /boot//loader/entries/poweroff.conf (on the EFI System Partition)
          efi: /boot//poweroff.efi

         type: Boot Loader Specification Type #1 (.conf)
        title: Memtest86+
           id: memtest.conf
       source: /boot//loader/entries/memtest.conf (on the EFI System Partition)
          efi: /boot//memtest86+/memtest.efi

         type: Automatic
        title: Windows Boot Manager
           id: auto-windows
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f (on the EFI System Partition)

         type: Automatic
        title: Reboot Into Firmware Interface
           id: auto-reboot-to-firmware-setup
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f (on the EFI System Partition)

Contents of Mkinitcpio.conf

[robert@RobertsFrameWork ~]$ cat /etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(usbhid xhci_hcd)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No RAID, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect modconf block filesystems fsck)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev modconf block filesystems fsck)
#
##   This setup assembles a mdadm array with an encrypted root file system.
##   Note: See 'mkinitcpio -H mdadm_udev' for more information on RAID devices.
#    HOOKS=(base udev modconf keyboard keymap consolefont block mdadm_udev encrypt filesystems fsck)
#
##   This setup loads an lvm2 volume group.
#    HOOKS=(base udev modconf block lvm2 filesystems fsck)
#
##   This will create a systemd based initramfs which loads an encrypted root filesystem.
#    HOOKS=(base systemd autodetect modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr and fsck hooks.
HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used for Linux ≥ 5.9 and gzip compression is used for Linux < 5.9.
# Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

# MODULES_DECOMPRESS
# Decompress loadable kernel modules and their firmware during initramfs
# creation. Switch (yes/no).
# Enable to allow further decreasing image size when using high compression
# (e.g. xz -9e or zstd --long --ultra -22) at the expense of increased RAM usage
# at early boot.
# Note that any compressed files will be placed in the uncompressed early CPIO
# to avoid double compression.
#MODULES_DECOMPRESS="no"

Contents of mkinitcpio.d/linux.preset file

[robert@RobertsFrameWork ~]$ cat /etc/mkinitcpio.d/linux.preset 
# mkinitcpio preset file for the 'linux' package

#ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
#ALL_microcode=(/boot/*-ucode.img)

#PRESETS=('default' 'fallback')
PRESETS=('default')

#default_config="/etc/mkinitcpio.conf"
#default_image="/boot/initramfs-linux.img"
default_uki="/boot/EFI/Linux/arch-linux.efi"
default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"

#fallback_config="/etc/mkinitcpio.conf"
#fallback_image="/boot/initramfs-linux-fallback.img"
#fallback_uki="/boot/EFI/Linux/arch-linux-fallback.efi"
#fallback_options="-S autodetect"

As a side note I do have secure boot enabled and working with pacman-hooks from the aur.

Output of yay -Ss hook | grep Installed

[robert@RobertsFrameWork ~]$ yay -Ss hook | grep Installed
aur/systemd-efi-pacman-hook 1-7 (+0 0.00) (Installed)
aur/list-orphans-hook 1.0-6 (+1 0.00) (Installed)
aur/reflector-pacman-hook-git r81.9d5f298-1 (+2 0.00) (Installed: r100.14a278a-1)
aur/patch-kernel-pacman-hook 1-1 (+2 0.00) (Installed)
aur/pacman-hook-reload-modules 1-1 (+3 0.00) (Installed)
aur/pacman-hook-list-installed-packages latest-1 (+3 0.00) (Installed)
aur/pacman-hook-list-systemd-units 1.4-1 (+5 0.43) (Installed)
aur/sync-pacman-hook-git r81.9d5f298-1 (+5 0.00) (Installed: r100.14a278a-1)
aur/yaycache-hook 0.1.0-2 (+5 0.02) (Installed)
aur/pipewire-enable-bluez5 1.0-1 (+5 0.00) (Installed)
aur/find-the-command-git 2.0.r2.gfecba1a-1 (+5 0.00) (Installed: 2.0.1.r0.gfecba1a-1)
aur/pacman-backup-hook 1.0.1-2 (+9 0.00) (Installed)
aur/systemd-cleanup-pacman-hook 9-1 (+11 0.43) (Installed)
aur/check-broken-packages-pacman-hook-git r92.ae70a79-1 (+21 0.35) (Installed: r100.14a278a-1)
aur/pacdiff-pacman-hook-git r81.9d5f298-1 (+24 0.27) (Installed: r100.14a278a-1)
aur/pacman-hook-kernel-install 0.16.0-1 (+29 1.48) (Installed)
aur/pacman-cleanup-hook 1.1-1 (+57 0.07) (Installed)
aur/systemd-boot-pacman-hook 3-1 (+185 3.30) (Installed)
extra-x86-64-v3/proxychains-ng 4.17-2.1 (31.5 KiB 87.9 KiB) (Installed)
extra/python-pluggy 1.6.0-1 (44.6 KiB 203.8 KiB) (Installed)
extra/python-pyproject-hooks 1.2.0-3 (22.4 KiB 100.1 KiB) (Installed)
extra/proxychains-ng 4.17-2 (29.5 KiB 79.9 KiB) (Installed: 4.17-2.1)

If there are any more outputs needed let me know and I will post them.

I wonder what could be causing the duplicates, how I can identify any duplicate processes and safely remove the duplicate files?

Thank you in advance for any assistance and have a good day/evening!

HaloSlayer255

Last edited by HaloSlayer255 (2025-10-25 03:37:14)

Offline

#2 2025-10-25 03:11:47

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,724

Re: [Solved] Duplicated Systemd-bootloader entries?

Look at /boot//loader/entries/. Figure out WHY you have anything that's there. There's nothing there by default, YOU create the files.

Offline

#3 2025-10-25 03:21:10

HaloSlayer255
Member
Registered: 2015-02-11
Posts: 31

Re: [Solved] Duplicated Systemd-bootloader entries?

Contents of /boot/loader/entries/1e0c26436b1344af943093801982e93d-6.17.4-arch2-1.1.conf

# Boot Loader Specification type#1 entry
# File created by /usr/lib/kernel/install.d/90-loaderentry.install (systemd 258.1-1.1-arch)
title      Arch Linux
version    6.17.4-arch2-1.1
machine-id 1e0c26436b1344af943093801982e93d
sort-key   arch
options    root=UUID=ae2b9616-fe29-4255-ae6e-9f2299257433 rw systemd.machine_id=1e0c26436b1344af943093801982e93d
linux      /1e0c26436b1344af943093801982e93d/6.17.4-arch2-1.1/linux
initrd     /1e0c26436b1344af943093801982e93d/6.17.4-arch2-1.1/initrd

Contents of /boot/loader/entries/memtest.conf

title Memtest86+
efi /memtest86+/memtest.efi

Contents of /boot/loader/entries/poweroff.conf

title POWER OFF
efi /poweroff.efi

Contents of /boot/loader/entries/reboot.conf

title Reboot
efi /reboot.efi

Contents of /boot/loader/entries/windows.conf

title Windows 11
efi /boot/EFI/Microsoft/Boot/bootmgfw.efi

It looks like systemd is creating the machine-name-archkernelversion.conf file, maybe I have a duplicate hook running in pacman. Will check shortly and post again when I find it.

--- Edit ---

I think it was leftover files from when I first installed arch that the bootloader was picking up on, I've deleted them and the entry with the machine-id is gone now. My UKI entry works and now there is no more clutter.

Last edited by HaloSlayer255 (2025-10-25 03:35:19)

Offline

Board footer

Powered by FluxBB