Systemd-boot entry for windows (auto-detected) no longer working

Since today, when selecting the windows entry from the systemd-boot screen, instead of loading windows I go straight to the bios screen. I tried re-creating the entries with bootctl install, but that didn’t change anything.

Windows is installed on a separate disk, but systemd-boot automatically detected it after installing EOS, so I’ve never really have had to configure it.

I’ve tried searching the forums for a solution, but couldn’t really find anything applicable. I did find this, [Tutorial] Add a systemd-boot loader Menu entry for a Windows installation using a separate ESP Partition , but before going doing that route, I was wondering if there is a way to get my current setup working. Is there perhaps a command to re-create the windows entry?

As a side-node, now that I have run into problem I am curious how this automatic detection is working as there are no entry for windows for it under /efi/loader/entries but it is listed when running bootctl list (which basically shows me the same entries I see during boot).

Systemd-boot will add the entry on the fly if you have the windows bootfiles in a folder under the efi path . .

The bootfiles are under the efi path as can be seen below:

/efi
├── 231daf974b094991953a5502d1b5ae68
│   ├── 6.12.47-1-lts
│   │   ├── initrd
│   │   ├── initrd-fallback
│   │   └── linux
│   └── 6.16.7-arch1-1
│       ├── initrd
│       ├── initrd-fallback
│       └── linux
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── Linux
│   ├── Microsoft
│   │   ├── Boot
│   │   │   ├── BCD
│   │   │   ├── BCD.LOG
│   │   │   ├── BCD.LOG1
│   │   │   ├── BCD.LOG2
│   │   │   ├── bg-BG
│   │   │   ├── bootmgfw.efi
│   │   │   ├── bootmgr.efi
│   │   │   ├── boot.pnd.stl
│   │   │   ├── BOOTSTAT.DAT
│   │   │   ├── boot.stl
│   │   │   ├── CIPolicies
                // a whole bunch of language files
│   │   └── Recovery
│   │       ├── BCD
│   │       ├── BCD.LOG
│   │       ├── BCD.LOG1
│   │       └── BCD.LOG2
│   └── systemd
│       └── systemd-bootx64.efi
└── loader
    ├── entries
    │   ├── 231daf974b094991953a5502d1b5ae68-6.12.47-1-lts.conf
    │   ├── 231daf974b094991953a5502d1b5ae68-6.12.47-1-lts-fallback.conf
    │   ├── 231daf974b094991953a5502d1b5ae68-6.16.7-arch1-1.conf
    │   └── 231daf974b094991953a5502d1b5ae68-6.16.7-arch1-1-fallback.conf
    ├── entries.srel
    ├── keys
    ├── loader.conf
    └── random-seed

and the output from bootctl list:

  ❯ sudo bootctl list
         type: Boot Loader Specification Type #1 (.conf)
        title: EndeavourOS (6.12.47-1-lts)
           id: 231daf974b094991953a5502d1b5ae68-6.12.47-1-lts.conf
       source: /efi//loader/entries/231daf974b094991953a5502d1b5ae68-6.12.47-1-lts.conf (on the EFI System Partition)
     sort-key: endeavouros-6.12.47-1-lts
      version: 6.12.47-1-lts
   machine-id: 231daf974b094991953a5502d1b5ae68
        linux: /efi//231daf974b094991953a5502d1b5ae68/6.12.47-1-lts/linux
       initrd: /efi//231daf974b094991953a5502d1b5ae68/6.12.47-1-lts/initrd
      options: nvme_load=YES nowatchdog rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 systemd.machine_id=231daf974b094991953a5502d1b5ae68

         type: Boot Loader Specification Type #1 (.conf)
        title: EndeavourOS (6.12.47-1-lts-fallback)
           id: 231daf974b094991953a5502d1b5ae68-6.12.47-1-lts-fallback.conf
       source: /efi//loader/entries/231daf974b094991953a5502d1b5ae68-6.12.47-1-lts-fallback.conf (on the EFI System Partition)
     sort-key: endeavouros-6.12.47-1-lts-fallback
      version: 6.12.47-1-lts-fallback
   machine-id: 231daf974b094991953a5502d1b5ae68
        linux: /efi//231daf974b094991953a5502d1b5ae68/6.12.47-1-lts/linux
       initrd: /efi//231daf974b094991953a5502d1b5ae68/6.12.47-1-lts/initrd-fallback
      options: nvme_load=YES nowatchdog rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 systemd.machine_id=231daf974b094991953a5502d1b5ae68

         type: Boot Loader Specification Type #1 (.conf)
        title: EndeavourOS (6.16.7-arch1-1) (selected)
           id: 231daf974b094991953a5502d1b5ae68-6.16.7-arch1-1.conf
       source: /efi//loader/entries/231daf974b094991953a5502d1b5ae68-6.16.7-arch1-1.conf (on the EFI System Partition)
     sort-key: endeavouros-6.16.7-arch1-1
      version: 6.16.7-arch1-1
   machine-id: 231daf974b094991953a5502d1b5ae68
        linux: /efi//231daf974b094991953a5502d1b5ae68/6.16.7-arch1-1/linux
       initrd: /efi//231daf974b094991953a5502d1b5ae68/6.16.7-arch1-1/initrd
      options: nvme_load=YES nowatchdog rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 systemd.machine_id=231daf974b094991953a5502d1b5ae68

         type: Boot Loader Specification Type #1 (.conf)
        title: EndeavourOS (6.16.7-arch1-1-fallback)
           id: 231daf974b094991953a5502d1b5ae68-6.16.7-arch1-1-fallback.conf
       source: /efi//loader/entries/231daf974b094991953a5502d1b5ae68-6.16.7-arch1-1-fallback.conf (on the EFI System Partition)
     sort-key: endeavouros-6.16.7-arch1-1-fallback
      version: 6.16.7-arch1-1-fallback
   machine-id: 231daf974b094991953a5502d1b5ae68
        linux: /efi//231daf974b094991953a5502d1b5ae68/6.16.7-arch1-1/linux
       initrd: /efi//231daf974b094991953a5502d1b5ae68/6.16.7-arch1-1/initrd-fallback
      options: nvme_load=YES nowatchdog rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 rw root=UUID=b567675a-f85d-4be8-9f69-2000fe1db294 systemd.machine_id=231daf974b094991953a5502d1b5ae68

         type: Automatic
        title: Windows Boot Manager (default)
           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)

So just to be clear, the entry is there at boot, however, as of today, when selecting it it brings me straight to the bios screen. (yesterday it was still working)

This is a folder from windows that will simply get copied over to the new efi path to let systemd-boot show the boot entry, so you may have something changed on windows bootloader or an update changed it what would make it needs to recopy to the path from windows ESP efi partition?

Thanks for your response. I have not changed any (windows) bootloader files, so I’m guessing things might have changed via an update. There are slight differences between the windows efi files on the windows drive vs the one that are on my systemd-boot drive (the systemd-boot drive has changes on the 9th of September).


I think I have a slightly better idea what is going wrong. Looking back out the output from my command from bootctl list, the entry for auto-windows is identical to the entry from auto-reboot-to-firmware-setup, which explains why it goes straight into bios after it is being selected.

  • Just for my understanding, how did the efi Windows folder (which is on different drive) end up on the drive that is used for booting? I’m assuming there is some configuration from EndeavourOS (systemd-boot config) that copied this over?

So as far as can tell I have two options, given the following setup:

  ❯ lsblk -f
NAME        FSTYPE FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme1n1                                                                                  
├─nvme1n1p1 vfat   FAT32             50B3-2442                                           
├─nvme1n1p2                                                                              
├─nvme1n1p3 ntfs                     A8BCB59DBCB5670A                                    
└─nvme1n1p4 ntfs                     701E2EF41E2EB350                                    
nvme0n1                                                                                  
├─nvme0n1p1 vfat   FAT32             6EA8-EF60                             785,5M    23% /efi
└─nvme0n1p2 ext4   1.0   endeavouros b567675a-f85d-4be8-9f69-2000fe1db294  818,4G     5% /

/sys/firmware/efi/efivars🔒 
  ❯ sudo blkid | grep vfat
/dev/nvme0n1p1: UUID="6EA8-EF60" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI" PARTUUID="08ce914c-9bb1-4e3a-b2c3-bd618f6e2a74"
/dev/nvme1n1p1: UUID="50B3-2442" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="bf5a8742-8922-479f-b3fd-3dad95e993ff"
  1. Remove the /efi/EFI/Microsoft directory (on /dev/nvme0n1p1 mounted at /efi). Mount the windows efi partition (/dev/nvme1n1p1) and copy the entries from over there to the one used by systemd-boot (basically back into /efi/EFI/Microsoft). I’m not sure now how systemd-boot will add the entry on the fly, is this as simple as calling sudo bootctl install at this point?
  2. Adding an menu entry menually for systemd-boot loader as described in this tutorial, [Tutorial] Add a systemd-boot loader Menu entry for a Windows installation using a separate ESP Partition. In that case I’m not sure how I would get rid of the automacially added (broken) entry that is there now.

Is this a correct assessment? Is there a benefit for deciding on one over the other?

as of its autogenerated entry it still could be a change on windows causing it to fail to generate correct entry automatically.

there is no entry in the nvram and the one inside the systemd-boot menu is generated on the fly as far as i know, so if you replace the microsoft folder on the efi partition it should change the entry .. but not sure here. I know that if you remove the microsoft folder the entry in systemd-boot menu is not shown anymore

You probably have two EFI partitions.

Copy the windows files from the other partition to the one you have mounted at /efi

is it needed to run bootctl install after this? i do not remember at the moment.. i do baiscally remove it only, using nvram entries for dualboot.

But it should be easy as copy the Microsoft folder in place or any extra step needed?
Seems this is not working even if i rerun bootctl install.

No, you shouldn’t run bootctl install. You just copy the files.

There is almost never a need to run bootctl install after the initial install. Unless you erase your EFI partition it is difficult to get in a scenario where systemd-boot needs to be reinstalled.

yea true aside from using bootctl to rewrite nvram entry. But better to do with efibootmgr too.

Could be something changed on windows side too. But i tried here with windows on its own ssd and moving the folder it shows windows entry in systemd-boot menu but went back to the menu on try using it. will check if fresh install do the same.

fresh install does the same .. not able to boot windows over that entry..
Windows itself is running fine windows 11 latest updates..

We need to investigate more.

Maybe there are some changes on the Windows side preventing what we are doing during the install to work?

must be that, i know it was working still before last time i updated windows .. i can do some research later.

1 Like

There are also some UEFI issues with the latest systemd package. Might check if downgrading systemd fixes it.

1 Like

must be thats the culprit, tested downgrading systemd package son 3 installs and get windows booting again on all 3, but the 2 with newly written bootfiles needed to redo initial systemd-boot (bootinstall) to repair windows boot.

sudo downgrade systemd systemd-libs systemd-resolvconf systemd-sysvcompat and downgrading all 4 to previous version 257.9

Next show stopper ..

Does systemd 258-4 fix it? It may still be in test.

ah lets see .. will update now..
luckily current ISO does not have the issue :star_struck:

So will be back in 5 minutes to give result

not fully working with systemd packages from testing partly only, without bootctl install to reinstall the bootfiles it was not changed and using win entry simple loads nvram boot menu after redoing bootctl install it goes back to the systemd-boot menu and after using the windows entry again it was booting windows, but after reboot, and cold boot not again the same it goes back to nvram boot once menu selection each time now.

Do I understand correctly my issue is caused by an update to systemd-boot 258? I’m not entirely sure but I can vaguely recall I did do an update where systemd-boot was involved the day before I noticed the windows entry didn’t work correctly anymore.

From the thread I get the feeling that currently this won’t fix the issue.

As of the moment, is there anything I can do, or help out with?

i tested with downgrading and it makes windows entry working again, in case it needs to use bootctl install command too, if you have used it with current systemd version.
Not much we can do at the moment .. sadly

1 Like

Ok. At least thanks @dalto and @joekamprad for further investigating!

1 Like