Bootctl does not create boot entry (after Windows update has shot bootloader)

Hi everyone,

on my laptop, which I dual boot with Windows 11 and EOS, a forceful Windows update has smashed my boot manager … again.

Windows 11 now boots all by itself and prevents me from booting EOS. I use systemd-boot and I am aware of a solution to my problem, because a Windows Update has done the same :face_with_symbols_on_mouth: just 6 months ago, and thanks to the EOS community I could restore my boot manager by booting a Live System from a USB drive, chroot-ing into my system and installing it from there.

But a problem occurs: When I try to install the boot manager with the command bootctl install, a EFI boot entry “Linux Boot Manager” is not created.
This is what I have done in the terminal from the live system:

(1. Checking Partitions) 
[liveuser@eos-2024.06.25 ~]$ lsblk -o name,type,fstype,size,UUID,mountpoint
NAME        TYPE FSTYPE     SIZE UUID                                 MOUNTPOINT
loop0       loop squashfs   2.4G                                      /run/archiso/airootfs
sda         disk iso9660    3.8G 2024-06-25-11-30-26-00               
├─sda1      part iso9660    2.5G 2024-06-25-11-30-26-00               /run/archiso/bootmnt
└─sda2      part vfat       155M AAB1-DE1A                            
nvme0n1     disk          476.9G                                      
├─nvme0n1p1 part vfat       260M BC5F-8EF9                            
├─nvme0n1p2 part             16M                                      
├─nvme0n1p3 part ntfs       133G 8446612946611D64                     
├─nvme0n1p4 part ntfs       919M 8202B55B02B5553F                     
├─nvme0n1p5 part ntfs     156.2G 3E50573450DDCE9E                     
├─nvme0n1p6 part vfat      1000M 28E5-655A                            
├─nvme0n1p7 part ext4     184.6G 5204093e-8a85-4af2-a41a-fc768d9d07fd 
└─nvme0n1p8 part vfat       260M 0CB6-52FC                            
(2. Mounting my EOS root partition)
[liveuser@eos-2024.06.25 ~]$ sudo mkdir /mnt/root && sudo mount /dev/nvme0n1p7 /mnt/root
(3. chroot into my EOS root partition)
[liveuser@eos-2024.06.25 ~]$ sudo arch-chroot /mnt/root
(4. Mounting EFI system partition)
[root@EndeavourOS /]# mount /dev/nvme0n1p6 /efi
(5. Trying to install systemd-boot)
[root@EndeavourOS /]# bootctl install
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/BOOT/BOOTX64.EFI".
⚠ Mount point '/efi' which backs the random seed file is world accessible, which is a security hole! ⚠
⚠ Random seed file '/efi/loader/random-seed' is world accessible, which is a security hole! ⚠
Random seed file /efi/loader/random-seed successfully refreshed (32 bytes).
[root@EndeavourOS /]# bootctl status
System:
Not booted with EFI

Available Boot Loaders on ESP:
          ESP: /efi
         File: ├─/EFI/systemd/systemd-bootx64.efi (systemd-boot 257.5-2-arch)
               └─/EFI/BOOT/BOOTX64.EFI (systemd-boot 257.5-2-arch)

Boot Loader Entries:
        $BOOT: /efi
        token: endeavouros

Default Boot Loader Entry:
         type: Boot Loader Specification Type #1 (.conf)
        title: EndeavourOS (6.12.26-1-lts)
           id: eb88892fd9944ca0b68ac444c17241dc-6.12.26-1-lts.conf
       source: /efi//loader/entries/eb88892fd9944ca0b68ac444c17241dc-6.12.26-1-lts.conf (on the EFI System Partition)
     sort-key: endeavouros-6.12.26-1-lts
      version: 6.12.26-1-lts
   machine-id: eb88892fd9944ca0b68ac444c17241dc
        linux: /efi//eb88892fd9944ca0b68ac444c17241dc/6.12.26-1-lts/linux
       initrd: /efi//eb88892fd9944ca0b68ac444c17241dc/6.12.26-1-lts/initrd
      options: nvme_load=YES nowatchdog rw root=UUID=5204093e-8a85-4af2-a41a-fc768d9d07fd systemd.machine_id=eb88892fd9944ca0b68ac444c17241dc
[root@EndeavourOS /]# bootctl list
         type: Boot Loader Specification Type #1 (.conf)
        title: EndeavourOS (6.12.26-1-lts) (default) (not reported/new)
           id: eb88892fd9944ca0b68ac444c17241dc-6.12.26-1-lts.conf
       source: /efi//loader/entries/eb88892fd9944ca0b68ac444c17241dc-6.12.26-1-lts.conf (on the EFI System Partition)
     sort-key: endeavouros-6.12.26-1-lts
      version: 6.12.26-1-lts
   machine-id: eb88892fd9944ca0b68ac444c17241dc
        linux: /efi//eb88892fd9944ca0b68ac444c17241dc/6.12.26-1-lts/linux
       initrd: /efi//eb88892fd9944ca0b68ac444c17241dc/6.12.26-1-lts/initrd
      options: nvme_load=YES nowatchdog rw root=UUID=5204093e-8a85-4af2-a41a-fc768d9d07fd systemd.machine_id=eb88892fd9944ca0b68ac444c17241dc

         type: Boot Loader Specification Type #1 (.conf)
        title: EndeavourOS (6.12.26-1-lts-fallback) (not reported/new)
           id: eb88892fd9944ca0b68ac444c17241dc-6.12.26-1-lts-fallback.conf
       source: /efi//loader/entries/eb88892fd9944ca0b68ac444c17241dc-6.12.26-1-lts-fallback.conf (on the EFI System Partition)
     sort-key: endeavouros-6.12.26-1-lts-fallback
      version: 6.12.26-1-lts-fallback
   machine-id: eb88892fd9944ca0b68ac444c17241dc
        linux: /efi//eb88892fd9944ca0b68ac444c17241dc/6.12.26-1-lts/linux
       initrd: /efi//eb88892fd9944ca0b68ac444c17241dc/6.12.26-1-lts/initrd-fallback
      options: nvme_load=YES nowatchdog rw root=UUID=5204093e-8a85-4af2-a41a-fc768d9d07fd systemd.machine_id=eb88892fd9944ca0b68ac444c17241dc

When running bootctl install, the line “Created EFI boot entry "Linux Boot Manager".” is missing in the output. How to create the EFI boot entry?

One guess: Is probably something wrong with the EFI partition? Mounting /dev/nvme0n1p6 as my EFI partition and not another one of the three vfat partitions has been pure guesswork based on last time (I have no clue why then nvme0n1p5 is now nvme0n1p6, why nvme0n1p6 is now nvme0n1p7 and so on).

Because it is probably already there.

You have 2 EFI partitions. You probably just need to change the boot priority in your BIOS or using efibootmgr.

Thank you, @dalto , for your reply.
It seems not to be there:

[root@EndeavourOS /]# efibootmgr
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0003,0000,0001
Boot0000* Windows Boot Manager  HD(1,GPT,6d881e10-d25f-4fe3-8b5e-58fdbfb3a0ef,0x800,0x82000)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d000000ca260100000010000000040000007fff0400
Boot0001* Windows Boot Manager  HD(6,GPT,3dca7a3a-2361-47c9-9c5b-cd8a149822f3,0x244b7000,0x1f4000)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI0000424f
Boot0002* UEFI:  USB DISK 2.0 PMAP      PciRoot(0x0)/Pci(0x8,0x1)/Pci(0x0,0x4)/USB(1,0)/CDROM(1,0x519980,0x4da98)0000424f
Boot0003* UEFI:  USB DISK 2.0 PMAP, Partition 2 PciRoot(0x0)/Pci(0x8,0x1)/Pci(0x0,0x4)/USB(1,0)/HD(2,MBR,0xe06d72b0,0x519980,0x4d800)0000424f

It could be due to this

https://wiki.archlinux.org/title/Systemd-boot#Installing_the_UEFI_boot_manager

You would need to create an entry manually.

Some similar issue:

It could be due to this

https://wiki.archlinux.org/title/Systemd-boot#Installing_the_UEFI_boot_manager

I guess you would need to create an entry manually:

https://wiki.archlinux.org/title/Systemd-boot#Manual_entry_using_efibootmgr

Some similar issue:

All it took for me, personally, was 3 muggings by Windows on Linux before I learned they don’t belong together. Ever. I don’t know what your pain threshold is for this. Ive’ had WIN updates sandbag boot like yours, network manager, screw up the time. Maybe 3 muggings.

Lecture over.

I would just get into a live environment and fix the boot with chroot personally. I know there’s an easier way, but chroot is usually blunt and effective,

Oh, thanks a lot for the information.

Just to make very sure, this would be the command in my case, right?

# efibootmgr --create --disk /dev/nvme0n1p6 --part Y --loader '\EFI\systemd\systemd-bootx64.efi' --label "Linux Boot Manager" --unicode 

If that is the issue, you could just create the chroot manually instead of running arch-chroot

I guess that could be a way to work around this issue.

--disk should point to the disk. I guess that would be /dev/nvme0n1

--part Y Y needs to be replaced buy the the number of your ESP. If that is 6 then that’s it.

Double check!

1 Like

The true solution is what @drunkenvicar alluded to. Get rid of dat Windows. I admit I still have mine, but I very very seldom go there and/or update it. I simply haven’t had any need for it in almost a year now…but I do own a valid license…so just in case? Since I don’t boot into it, it doesn’t cause me problems :wink:

1 Like

Thanks, @cactux! To double check:

# efibootmgr --create --disk /dev/nvme0n1 --part 6 --loader '\EFI\systemd\systemd-bootx64.efi' --label "Linux Boot Manager" --unicode 
1 Like

@dbarronoss , @drunkenvicar

I guess you’re right. At the moment, I still use Windows for gaming, the only thing that I still get to work better on Windows than on Linux. For everything else that I use, I love EOS, especially after using Windows again for some time.
This time, my pain threshold has been touched but not crossed, but let’s give Windows one more chance. If the same happens again in half a year, it might be time to free the space on that 133GB partition.

2 Likes

laptops rarely (I think) come with 2 drives so I understand. I have a desktop, and like @dbarronoss I keep an in-case-of-emergency separate SSD of WIN10 unplugged, and rarely updated. but it’s there just in case. If your pain threshold has not been crossed then ignore me and rock on!

It has partly worked. I am back in my EOS root system now with an installed Linux Boot Manager.

But the Linux Boot Manager now boots right into EOS without showing the boot menu. I have tried a few times and the boot menu where the OS can be selected is not shown. I am trying to find the solution by myself, but what I find is too technically complicated for my understanding.

How can I restore the boot menu?

One idea of whre the problem might lie: I can only list the bootloader entries as root. Is that normal?

$ bootctl list
Failed to open '/efi//loader/loader.conf': Permission denied

Edit /efi/loader/loader.conf and set timeout 3

Yes. That is normal.

Thank you! Now everything is working again.

Summary for anyone who has this problem (or for myself when Windows has its next update):

  • Problem: Windows Update had destroyed my bootloader. When booting, only Windows starts and my Linux OS can not be selected.

  • Solution if you use systemd-boot: Reinstall the boot manager. I did it by accessing my EOS root partitition with arch-chroot and creating the boot entry again.

Since a systemd update, bootctl does not create the boot entry in the old way anymore. The boot entry has to be created manually:

# efibootmgr --create --disk /dev/[DISK] --part [NUMBER] --loader '\EFI\systemd\systemd-bootx64.efi' --label "Linux Boot Manager" --unicode
  • [DISK] is the harddrive and [NUMBER] the number of the EFI partition.

Now the Linux Boot Manager is back. If this experience has not convinced you yet to ditch Windows, you can continue dual booting and show the boot menu again by editing /efi/loader/loader.conf. Add (or uncomment) the line timeout 3 and when booting, the boot menu to select the OS is shown for 3 seconds.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.