here’s a tutorial on how to get a Windows-entry in systemd-boot in case you use separate ESP partitions for Windows and Linux, with help taken from the Arch Systemd Boot Wiki entry.
It is recommended that Fast Boot is disabled in UEFI as it can lead to several issues especially when dual booting - at least for me, it has no influence it boot time anyway.
Install edk2-shell: sudo pacman -S edk2-shell
copy that to your esp-partition: sudo cp /usr/share/edk2-shell/x64/Shell.efi ESP/shellx64.efi (replace ESP with the path to your esp, usually /efi)
Retrieve the PARTUUID for your Windows-esp Partition - for example the KDE Partition Manager shows it as UUID in the Partition Details, but you can also do in command line: sudo blkid | grep vfat
Usually, the Windows EFI Partiton is labelled “EFI system partition”, you should get a line that looks like that: /dev/nvme1n1p2: UUID="52CC-E135" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="e2cc5bf0-9654-4ba3-bdc7-cdb1c2db2c3b"
You will want to remember/take a picture/write down the PARTUUID - depending on how many partitions you have in your system, you will see a lot of such strings in the following steps - check sudo blkid for how many you will see.
The next part gets a lot easier if you set your systemd-boot resolution to max with adding console-mode max to your esp/loader/loader.conf but this step is optional. (Adding that will also enable the OEM boot logo for Windows)
Reboot and choose EFI shell in the loader screen which gets autocreated if you did step 2 correct.
It should now display a list of FS Aliases followed by that FS Alias’ partition details. If it does not, enter the command map
You can scroll with Page Up / Down if it does not fit on your screen (it should when setting the console-mode max Parameter)
Take note of the FS Alias that contains the PARTUUID you got in step 3. For me the Alias was HD2c but it can also look like HD0a66666a2:
Enter the exit command and boot into your Linux installation again.
Create a file in your esp - Partition (usually /efi) called windows.nsh and give it the following content:
HD2c:EFI\Microsoft\Boot\Bootmgfw.efi
where HD2c is the exact FS Alias you got from the EFI shell in step 6 and the part after the : is the exact path in your Windows esp Partition (in most cases the path should be exactly like in my example)
Now create a loader entry for that Windows Installation by creating a file windows.conf in your esp/loader/entries directory (usually /efi/loader/entries/) containing the following:
title Windows
efi /shellx64.efi
options -nointerrupt -noconsolein -noconsoleout windows.nsh
The name of the .nsh file in the entry has to match the one you created in step 7, and the shellx64.efi also has to be in your esp and at that location where you created it in step 2.
Congratulations, you now have a working entry for your Windows - Installation on a different ESP partition in your Loader Menu.
Extra: If you don’t want to have the Shell - entry in your Loader Menu permanently, you can easily move it into a subfolder after doing all the steps above (for example tools) and modify the windows.conf file accordingly (for example to read
title Windows
efi /tools/shellx64.efi
options -nointerrupt -noconsolein -noconsoleout windows.nsh
not sure but I guess everytime it happens there are posts like “windows update removed my Linux”. Just copying essential stuff instead of telling the system where to find that stuff looks broken by design - it temporarily works but its flawed.
I was trying to resolve this on my own, but stumbled upon this thread. My second drive (the one with Windows) doesn’t appear in the ekd2-shell after I reboot or even shutdown Linux. The only way it appears is if I load into motherboard’s firmware. As a result I can’t boot into Windows, unless I do it through firmware or the boot menu. SATA mode is set to AHCI and hot-swap is disabled. Even the external usb HDD appears there.
that sounds to me like your Windows was not installed as UEFI/GPT but still in MBR/BIOS mode. In that case, you won’t be able to boot it from systemd-boot.
sudo fdisk -l should show you if a disk is in MBR or GPT mode.
Edit: Apparently, those are the ways to check from within Windows if it is using UEFI or BIOS/Legacy booting:
There is an automatically generated systemd-boot Windows 11 entry for me as well, but it didn’t work, so I tried to add it manually and encountered this issue.
May I ask what laptop/PC/motherboard you are using? I have a similarly weird issue.
When I first replaced Windows on my Acer ES1-132-C0VW netbook I had the problem that there was no bootable device found. So, I didn’t even reach the bootloader. The eMMC was simply not listed in the UEFI settings as bootable device, but somehow there was still an entry for the Windows Boot Manager, even though it was not in place anymore. All I got when trying to boot this “Windows Boot Manager” entry was the message “No bootable device”.
After some trial and error I found the solution: cp /boot/EFI/systemd/systemd-bootx64.efi /boot/EFI/Microsoft/Boot/bootmgfw.efi
So, whatever distribution, whatever bootloader I use, this works (of course just with the correct path to the linux-bootloader .efi-file). As soon as the linux-bootloader .efi-file is disguised as Microsoft bootmgfw.efi everything is working.
In my UEFI settings I boot “Microsoft Boot Manager”
It’s a problem I have never seen on other devices.
I also have a pacman-hook that copies the .efi-file after every bootloader update.
The system seems to have no issues with this “solution”. Never had problems with it…
I’m on desktop AM5 Asus X670E-E motherboard. My system worked fine with only Windows, and I am still able to boot into Windows with the Linux installed. It’s just that I have to enter and exit BIOS or enter the firmware boot menu to successfully boot into Windows.
I have solved the issue by disabling Fast Boot in motherboard’s firmware. I guess I just glossed over it, because I’ve only seen mentions of disabling Windows’ fast startup and Secure Boot. Sorry for bothering.