Finally the message restriction is gone. I would like to thank you al for helping me out and giving active support. Furthermore I would like to announce, that I managed to solve the problem. In this post, I will deeply explain what I did and tried to fix it. I did try to install archlabs yet again, and in the live environment I did the following things
- I ran sudo os-prober and it indeed found the Windows Bootloader on sda2
- I mounted and explored the EFI partition (sda2) and found all files clear, as they were supposed to be. The folder structure looked similar to this
_EFI
__Microsoft
___Boot
___Recovery
__Boot
- I tried to comment out the line that executes grub_uefi_fallback()
#[[ $SYS == “UEFI” && $BOOTLOADER == “grub” ]] && grub_uefi_fallback
- I opened filemanager to see with my own eyes what is happening to the EFI partition
- last but not least, I inspected the install script yet again just for myself to get a grasp of what is happening before running the installer
Then I ran the installer and everything went fine, up to the point where grub was installed, I noticed my filemanager refreshed immediately and the bootloader was gone. But then I realized something very important: the new files structure was specific
_EFI
__Microsoft
___Recovery
__archlabs
When you comapre that with the filestructure before, you will realize that 2 folders are missing, specifically those called Boot. Because I inspected the installer script beforehand, I immediately knew what the problem was. This line:
find $MNT/boot/efi/EFI/ -name '[Bb][oO][oO][tT]' \
-type d -exec rm -rf '{}' \; 2>/dev/null
is actively deleting all folders in the partition called ‘Boot’ (and with all I mean all, even in the Microsoft folder). Now I installed Windows yet again, booted into arch-live again, commented both lines out (this one and the one that calls grub_uefi_fallback()) and ran the installer again. No bootloader was deleted, and I had both OSes ready to run.
So in the end all of us were right, neither I, nor GRUB were deleting any of the entries in the EFI partition, but archlabs installer was.
The problem is that this command is trying to delete preexisting (old) boot entries in the EFI partition (probably created by older versions of archlabs), but with ‘find’, it does a full search for a directory called ‘Boot’ in all subdirectories (-> it touched the Microsoft folder). I don’t know if the first ‘Boot’ folder (the one that is not in the Microsoft folder) can be touched/deleted. But for sure, the Microsoft folder (and specifically the Boot folder inside it) should NOT be touched at all. I would suggest adding something like
-mindepth 1 -maxdepth 1
to prevent this from happening in future installs.
At this point I am also not sure if commenting out the grub_uefi_fallback() was really necessary, but it seems like this function is trying to delete some files too, so I commented it out just to be sure.
At the end I want to thank you all yet again and point out, that this is literally my
- first bug that I fixed in an open source project
- first time I had real code experience with a linux environment (talking about shell code)
and it was really a valuable experience.