Windows erased boot partition (sigh, another post?)

Hello again kind people,

First of all, sorry in advance for wrong terminology, I am after all still a Linux newbie. As suggested by @Gamall in Steam games will suddenly not launch - #7 by Gamall (and thank you again!), I slightly hesitated to create a new topic :wink: Sorry for wall of text once again, you will find a tl;dr: at the bottom.

I learned that I dual booted despite using different hard drives, I am now almost positive Windows deleted my boot partition on my EOS-install after simply adding an old HDD containing an old Windows installation (!) Naturally, that happened. Thanks, Windows. You git. Please refer to the old post regarding how and what not. I would like to state I am now in the process of backup’ing Windows-drives to reformat and -partition. However, I would still like to own Windows one last time so I am trying to rescue the bootloader/boot partition while keeping the Windows partitions. And then nuke it from Linux within.

Thanks to the community, it seems it should not be difficult to get the boot partition up and running again - but I do face a few issues. Thus, I kindly ask for help again.

I will write “in brief” what I have done, please let me know if you want outputs or commands.

Prelude

  1. I managed to Arch-chroot as per this fine article
  2. I then tried to repair GRUB

This is where my n00bshow shows, but I did not have any grub commands available:

[liveuser@eos-2025.03.19 ~]$ sudo mount /dev/sda2 /mnt
[liveuser@eos-2025.03.19 ~]$ sudo mount /dev/sda1 /mnt/efi
[liveuser@eos-2025.03.19 ~]$ arch-chroot /mnt
[root@EndeavourOS /]# grub-install
bash: grub-install: command not found

This is because I have a systemd install, right? I managed to find a topic which I followed. Basically bootctl install instead of grub-install if I understand correctly.

[root@EndeavourOS /]# bootctl install
Running in a chroot, enabling --graceful.
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).
Not booted with EFI or running in a container, skipping EFI variable modifications.

Still, no cigar. As also mentioned here, another try was to reinstall-kernels. Basically, it ends up with this after a while:

dracut[I]: *** Hardlinking files done ***
cp: error writing '/efi/8e5afcf6eb4b49da9aa9b2dcd3c2a002/6.17.7-arch1-1/initrd-fallback.tmp': No space left on device
dracut[F]: Creation of /efi/8e5afcf6eb4b49da9aa9b2dcd3c2a002/6.17.7-arch1-1/initrd-fallback.tmp failed
/usr/lib/kernel/install.d/50-dracut-fallback.install failed with exit status 1.

Here I am not sure at all what happens, because I would expect it tries to write on my already-existing partition which should have enough space?

Anyways, I also came across this post where it is discussed whether or not OP booted in UEFI mode or not. As you might have noted, I already got “Not booted with EFI”. This reply instructs to disable any legacy/CSM in BIOS.

Now to my predicament and current issue(s)

So, in my BIOS I do have CSM enabled. I cannot recall why I enabled it in the first place - perhaps to detect USB when first installing Linux?! Anyhow, I would like to disable CSM and ensure it is a UEFI boot because I suspect it will solve some of the above mentioned erros?

HOWEVER, right now I am in this weird state where I cannot boot to BIOS from turned off state.
Right now, if I turn on my PC it boots Windows (BOO!) just fine.
If I F2/DEL to enter BIOS before Windows is booting, nothing happens. Refer to my hardware, I have Asrock Extreme4 B550 with a handy postcode display showing “A9” whatever that means (a lot of results, most seem to involve SATA somehow - did not dig into that).
Furthermore, I cannot F11 to get a boot menu. So right now, to boot from EOS Live USB I am entering BIOS to change boot order.
Only way to access my BIOS right now and change boot order is to boot Windows and from there Troubleshoot > Advanced options > UEFI Firmware Settings > Reboot.

I am afraid to change that UEFI mode to CSM because I frankly do not know what happens - will Windows still boot just fine which is my only way to enter BIOS currently? I am afraid I end up somehow not being able to boot from Live USB at all to chroot.

tl;dr:

  • Windows (most likely) deleted boot partition.
  • I am trying to reinstall systemd, it does not quite work (perhaps due to not being in EFI mode (?) - although it worked before all this mess).
  • Would like to disable CSM, but I am afraid it will somehow mess up Windows boot since it is currently my ONLY way to enter BIOS where I can select to boot from USB
  • halp

THANK you again in advance for any help, it is much appreciated. Sorry for n00bshow in advance. Have a great day!

Boot your EOS live usb and post the output from these commands:

sudo parted -l

efibootmgr

Mount the partition which contains the root of your EOS system and get the content of /etc/fstab from it and post it here as well.

Certainly - thank you! And apologise for the delay.

sudo parted -l

[liveuser@eos-2025.03.19 ~]$ sudo parted -l
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name         Flags
 1      2097kB  1076MB  1074MB  fat32        EFI          boot, esp
 2      1076MB  250GB   249GB   ext4         endeavouros

Model: ATA ST2000DM001-1ER1 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2000GB  2000GB  ext4

Model:  USB DISK 2.0 (scsi)
Disk /dev/sdc: 7743MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size   Type     File system  Flags
 2      2964MB  3144MB  180MB  primary  fat32        esp

Model: Samsung SSD 980 PRO 1TB (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  106MB   105MB   fat32        EFI system partition          boot, esp, no_automount
 2      106MB   123MB   16.8MB               Microsoft reserved partition  msftres, no_automount
 3      123MB   1000GB  1000GB  ntfs         Basic data partition          msftdata
 4      1000GB  1000GB  548MB   ntfs                                       hidden, diag, no_automount

Model: Samsung SSD 980 1TB (nvme)
Disk /dev/nvme1n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  16.8MB  16.8MB               Microsoft reserved partition  msftres
 2      16.8MB  1000GB  1000GB  ntfs         Basic data partition          msftdata

[liveuser@eos-2025.03.19 ~]$ 

efibootmgr

[liveuser@eos-2025.03.19 ~]$ efibootmgr
BootCurrent: 000B
Timeout: 1 seconds
BootOrder: 000B,000A,0000,000C,000D,0005
Boot0000* Windows Boot Manager HD(1,GPT,12fb19bf-cc79-410b-add3-d2eb89d26c0a,0x800,0x32000)/\EFI\MICROSOFT\BOOT\BOO
TMGFW.EFI57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b0039006400650061003800360
0320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390
035007d0000004d000100000010000000040000007fff0400
Boot0005 Hard Drive BBS(HD,,0x0)0000474f00004e4fb3000000010000007100530061006d00730075006e0067002000530053004400
20003900380030002000500052004f00200031005400420000000501090002000000007fff040002010c00d041030a0000000001010600010101
01060000000317100001000000002538bc21bb78dc7fff040001043400ef47642dc93ba041ac194d51d01b4ce653003500470058004e00460030
0054004300350032003600300037004b0000007fff04000000424f00004e4fb7000000010000007d00530061006d00730075006e006700200053
00530044002000390038003000200031005400420000000501090002000000007fff040002010c00d041030a0000000001010600020101010600
02000101060000040101060000000317100001000000002538d511b22a027fff040001043400ef47642dc93ba041ac194d51d01b4ce653003600
340039004e00460030005200350035003800320037003100440000007fff04000000424f00004e4fad0000000100000075005300540032003000
3000300044004d003000300031002d0031004500520031003600340000000501090002000000007fff040002010c00d041030a00000000010106
00020101010600010003120a000200ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce6200020002000200020002000200020
00200020002000200034005a0043005a004b0038004800500000007fff04000000424f00004e4fbb000000010000007500530061006d00730075
006e006700200053005300440020003800350030002000450056004f0020003200350030004700420000000501090002000000007fff04000201
0c00d041030a0000000001010600020101010600010003120a000000ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce63200
53004a00430058004e004700410031003500330035003900380020004500200020002000200000007fff04000000424f
Boot000A* Windows Boot Manager HD(1,GPT,36cef77b-0dd2-4fa0-b813-9c024604d3a0,0x1000,0x200000)/\EFI\MICROSOFT\BOOT\B
OOTMGFW.EFI0000424f
Boot000B* UEFI: USB DISK 2.0 PMAP PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0)/USB(6,0)/CDROM(1,0x5853c0,0x56040)000
0424f
Boot000C* UEFI: USB DISK 2.0 PMAP, Partition 2 PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0)/USB(6,0)/HD(2,MBR,0xea64eddc,
0x5853c0,0x56000)0000424f
Boot000D* USB BBS(USB,,0x0)0000474f00004e4fa1000000010000006900200055005300420020004400490053004b00200032002e00300
0200050004d004100500000000501090005000000007fff040002010c00d041030a000000000101060002010101060000000305060006007fff0
40001043600ef47642dc93ba041ac194d51d01b4ce6300037003000410034004300370046003900330032004100460033003700330000007fff0
4000000424f

Are those numbers/id/what-they-are normal?! Lol. They look mad.

/etc/fstab

[liveuser@eos-2025.03.19 ~]$ sudo mount /dev/sda2 /mnt
[liveuser@eos-2025.03.19 ~]$ sudo mount /dev/sda1 /mnt/efi
[liveuser@eos-2025.03.19 ~]$ sudo arch-chroot /mnt
[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=07F4-4D36                            /efi           vfat    fmask=0137,dmask=0027 0 2
UUID=3ec5ac32-ea98-4b50-b17a-99d4b5625c4e /              ext4    noatime    0 1
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
# Data NVME
# UUID=F87A3C577A3C14BA       /mnt/data-nvme1n1       ntfs       noatime,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.idle-timeout=1min 0 2
# UUID=F87A3C577A3C14BA       /mnt/data-nvme1n1       ntfs       uid=1000,gid=1000,rw,user,exec,umask=000 0 0
# UUID=F87A3C577A3C14BA       /mnt/data-nvme1n1       ntfs       default 0 0
UUID=F87A3C577A3C14BA         /home/jvf/Data       ntfs       uid=1000,gid=1000,rw,user,exec,umask=000 0 0
# UUID=F87A3C577A3C14BA         /mnt/data-nvme1n1       ntfs       uid=1000,gid=1000,rw,user,exec,umask=000 0 0
[root@EndeavourOS /]# 

As you will notice, my fstab is not too pretty.. I (some time ago) tried a few different ways to get the automount to work.

Thanks again for any further help, very much appreciated!

In chroot, run the following to create an EFI boot entry for systemd-boot (Linux Boot Manager)

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

You could also try removing the folders with a long number in /efi and do:

reinstall kernels

You genius kind stranger, I am in! Hurray!

That indeed created the missing Linux Boot Manager that worthless Windows nuked. THANK you SO much! Extremely appreciated. FWIW, I did not have to reinstall kernels.

Apologise my ignorance; how would I learn to solve this myself? I know the Arch wiki hosts great knowledge but dang it can be difficult to understand properly.

Good to hear that you were able to solve it!

Just hang around this forum and use its search function for things you are interested in or having issues with. It’s possible that your question has already been asked and answered.

If you feel like to, you could always make a topic of your own to ask questions.

Also, when it comes to ArchWiki, I totally get what you say. It can be overwhelming many times. Try reading about the subjects of your interest just a little bit at a time. When you are ready, move on to read a bit more. With time you will be more familiar with the technical “jargon” and can decipher its articles all by yourself.

Here is for example the reference for the command line we used:

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

Thank you! That is indeed what I intend to do. And yes, while I would hesitate to create a topic, I am extremely pleased with how kind people are. I would never dare to make a post on the Arch forums, lol.

Thanks for the reference! I already briefly searched there, but sigh - searched for “efibootmgr” which I thought me be the topic.

Final question:
Any chance you would be able to shed light upon my apparent BIOS-shenanigans? I would like to:

  • disable CSM (to make proper UEFI EOS-install on main drive)
  • clear CMOS (to hopefully be able to enter BIOS from turned off state)

I am not sure in which order - and I am confused that I am in this situation and am considering this. As stated, not sure why I cannot enter BIOS from turned off PC, but I fear I somehow end up not booting anything and cannot enter BIOS - which seem totally wild if that scenario is possible. Clearing CMOS seems to be first step, but then again - will that perhaps also disable CSM if that was default settings?

Pardon if these questions should not be asked here, but yeah - you seem friendly and knowledgeable :slight_smile: Thanks!