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 on 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 youresp/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 commandmap
You can scroll with Page Up / Down if it does not fit on your screen (it should when setting theconsole-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 likeHD0a66666a2:
Enter theexit
command and boot into your Linux installation again. -
Create a file in your esp - Partition (usually
/efi
) calledwindows.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 youresp/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