Systemd-boot - Only windows as boot option

Hello,

A few days ago I realized that I was no longer able to boot into my endeavouros install. (Let me just append that this occured after I stupidly updated my BIOS after going to Windows for the first time since I installed linux on this computer) The systemd-boot option was not available in my BIOS to change BootOrder. I search it up on google and found some stuff about efibootmgr and I created a new entry which successfully got me to the systemd-boot menu but I only had Windows as an option. I stumbled upon other people with seemingly similar problems namely Âżcorrupt kernel? and someone with the opposite problem.

So far I have tried chroot-ing after mouting my file system partition and trying to figure out which ESP is the correct one. I seem to have two, which I have a vague memory of configuring or if that was the default when I setup endeavour.

sudo fdisk -l result:

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048     534527    532480   260M EFI System
/dev/nvme0n1p2    534528     567295     32768    16M Microsoft reserved
/dev/nvme0n1p3    567296  262115327 261548032 124.7G Microsoft basic data
/dev/nvme0n1p4 996118528 1000214527   4096000     2G Windows recovery environment
/dev/nvme0n1p5 264212480  314544127  50331648    24G Linux swap
/dev/nvme0n1p6 314544128  996118527 681574400   325G Linux filesystem
/dev/nvme0n1p7 262115328  264212479   2097152     1G EFI System

Then ones I am confused about are 1 and 7. I have tried mounting either with 6 and then running bootctl install and then reinstall-kernels to no avail. Something that might be important is that when I run bootctl it gives a warning about random-seed and now when I tried to run bootctl it gave me an input/output error for “/boot/loader/keys” like the post that I refered to as “¿corrupt kernel?” got and when I ls the file I get questionmarks.

Please feel free to ask about anything, I am not very proficient so I apologize if I got any vocabulary wrong or am just misunderstanding parts of the system. Thank you in advance!

Not sure this will help you at all but as far as i know the systemd boot partition is 1G (in this case nvmeon1p7) and the other one is from windows. I guess you followed the wiki about chrooting ?

Indeed I did find that article and tried to follow it

I see, well I have mostly tried things on the 1G partition because when I try to run reinstall-kernels on the other I get an error saying that there is not enough space on the disk.

I should perhaps also mention, if it points to anything, that my /boot/EFI/Linux/ directory is empty. It was stated in the “opposite problem” topic I linked to that systemd looks for bootable efi files there

Maybe this topic will help

2 Likes

Thank you, I will try that again to make sure but it feels like I’ve done exactly those steps:

  1. Mount fs partition at /mnt and boot partition /mnt/boot
  2. Run bootctl install
  3. Run reinstall-kernels
  4. Restart

However, now when I read arch-chroot it says that I should mount ESP at /efi or /boot/efi and not just /boot so this might be the issue. Give me a minute, thanks!

1 Like

Okay, I am now not able to run bootctl install as I get the error Failed to create "/efi/loader/keys": Input/output error

The mountpoint for the standard EOS installation with systemd-boot is /efi and not /boot.

Post:

cat /etc/fstab
sudo blkid
1 Like
[root@EndeavourOS /]# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=EE28-7B9D                            /efi           vfat    fmask=0137,dmask=0027 0 2
UUID=a2ed8b85-6f1d-4f43-90de-a68230a0ce0e swap           swap    defaults   0 0
UUID=2cdce447-6d2e-4472-baf5-0b092c7a09e9 /              ext4    noatime    0 1
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
[root@EndeavourOS /]# sudo blkid
/dev/nvme0n1p7: UUID="EE28-7B9D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="565fcf39-f107-49cc-84b1-7b77a24935d3"
/dev/nvme0n1p5: UUID="a2ed8b85-6f1d-4f43-90de-a68230a0ce0e" TYPE="swap" PARTUUID="419e9eec-3cdf-4f16-a8ca-0b4dd5bb016f"
/dev/nvme0n1p3: LABEL="Windows-SSD 2024-12-11" UUID="ebd239c9-b289-4d4a-bf69-859d2314571e" TYPE="BitLocker" PARTLABEL="Basic data partition" PARTUUID="07b4a808-993a-466b-9bbf-b3bc6a7950a3"
/dev/nvme0n1p1: LABEL="SYSTEM_DRV" UUID="9838-53B1" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="bb04dc7d-9d80-4e50-97fe-947bddf047d3"
/dev/nvme0n1p6: UUID="2cdce447-6d2e-4472-baf5-0b092c7a09e9" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="def2e3cc-70e4-46ce-a5e7-fc1aa20d2379"
/dev/nvme0n1p4: LABEL="WINRE_DRV" BLOCK_SIZE="512" UUID="7C58397158392AF2" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="a45d6b3a-714c-43d4-a85d-b695d75be6e7"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="86620045-f244-423a-b5ac-6e3fd7af3e00"
/dev/loop0: BLOCK_SIZE="1048576" TYPE="squashfs"
/dev/sda2: LABEL_FATBOOT="ARCHISO_EFI" LABEL="ARCHISO_EFI" UUID="66EF-F55D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="4a514722-02"
/dev/sda1: BLOCK_SIZE="2048" UUID="2024-09-22-10-45-49-00" LABEL="EOS_202409" TYPE="iso9660" PARTUUID="4a514722-01"
2 Likes

Could you post efibootmgr too?

Thank you, and here you go:

[root@EndeavourOS /]# efibootmgr
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 2001,0005,0001,0004,2002,2003
Boot0000* EFI USB Device (USB2.0  Flash Disk)   UsbWwid(90c,1000,0,AA0401270001100)/CDROM(1,0x536b20,0x51040)RC
Boot0001* Windows Boot Manager  HD(7,GPT,565fcf39-f107-49cc-84b1-7b77a24935d3,0xf9f9000,0x200000)/\EFI\Microsoft\Boot\bootmgfw.efiRC
Boot0002* EFI PXE 0 for IPv4 (40-C2-BA-81-54-56)        PciRoot(0x0)/Pci(0x2,0x1)/Pci(0x0,0x0)/MAC(40c2ba815456,0)/IPv4(0.0.0.0,0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)RC
Boot0003* EFI PXE 0 for IPv6 (40-C2-BA-81-54-56)        PciRoot(0x0)/Pci(0x2,0x1)/Pci(0x0,0x0)/MAC(40c2ba815456,0)/IPv6([::],0,Static,[::],[::],64)RC
Boot0004* Windows Boot Manager  HD(1,GPT,bb04dc7d-9d80-4e50-97fe-947bddf047d3,0x800,0x82000)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000000000100000010000000040000007fff0400
Boot0005* Linux systemd-boot    HD(1,GPT,bb04dc7d-9d80-4e50-97fe-947bddf047d3,0x800,0x82000)/\EFI\systemd\systemd-bootx64.efi
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC
1 Like

You have already a systed-boot bootloader entry but that seems to be in

/dev/nvme0n1p1: LABEL="SYSTEM_DRV" UUID="9838-53B1" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="bb04dc7d-9d80-4e50-97fe-947bddf047d3"

and not in

/dev/nvme0n1p7: UUID="EE28-7B9D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="565fcf39-f107-49cc-84b1-7b77a24935d3"

which according to your fstab is your Linux’ ESP.

Okay, i see. What would that entail? I did try to create a new one so I guess that’s why. Do you think this could be fixed by linking a efibootmgr entry to the systemd-boot bootloader that is on nvme partition 1?

I think for the moment we can leave that alone.

This is what you need to resolve. My guess is that I/O error may be due to full ESP partition.

If you are now properly chrooted into your system with correct partitions and correct mount points, post:

df -h /efi

lsblk -fs /dev/nvme0n1p7

Let me just check first. Would these be the correct mount points and partitions?

├─nvme0n1p6 259:6    0   325G  0 part /
└─nvme0n1p7 259:7    0     1G  0 part /efi
1 Like

Please

[root@EndeavourOS /]# df -h /efi
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p7 1022M  259M  764M  26% /efi
[root@EndeavourOS /]# lsblk -fs /dev/nvme0n1p7
NAME      FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1p7                          763.1M    25% /efi
└─nvme0n1                       

It is not full. So it’s not that.

It may be corrupted and therefore preventing write operation.

This should also show vfat under FSTYPE. It doesn’t.

You can do this. Inside chroot, unmount /efi

Now, in the live session, open the partitionmanager or gparted and run a filesystem check on
/dev/nvme0n1p7

Now from your terminal inside chroot: mount /efi and bootctl install

If it doesn’t work, I don’t know if there is other way to fix it than recreating your whole ESP from ground up. Maybe there are but I don’t know of them.

Hmm okay, I get this when I apply the fs check in partitionmanager:

Check and repair partition ‘/dev/nvme0n1p7’ (1.00 GiB, fat32) 
Job: Check file system on partition ‘/dev/nvme0n1p7’ 
Command: fsck.fat -a -w -v /dev/nvme0n1p7 
Check file system on partition ‘/dev/nvme0n1p7’: Error
Check and repair partition ‘/dev/nvme0n1p7’ (1.00 GiB, fat32): Error