How to fix Linux and Windows 11 dual boot problem in HP computers

If computer has a buggy bios, which allow only windows boot manager, boot linux using refind usb or supergrub2 usb or linux´s live usb and make then the next things.

1.Copy /EFI_SYSTEM/EFI/Microsoft as /EFI_SYSTEM/EFI/Microsoft.orig

2. Remove bootmgfw.efi and bootmgr.efi from /EFI_SYSTEM/EFI/Microsoft/Boot

3. Copy EFI_SYSTEM/EFI/BOOT/grubx64.efi to EFI_SYSTEM/EFI/Microsoft/Boot and rename it as bootmgfw.efi

4. Edit /etc/grub.d/40_custom file adding MS Windows line (an example)

menuentry ’Windows 11’ –class windows –class os $menuentry_id_option ’osprober-efi-F2B6-DE5B’ {
savedefault
insmod part_gpt
insmod fat
search –no-floppy –fs-uuid –set=root F2B6-DE5B
chainloader /EFI/Microsoft.orig/Boot/bootmgfw.efi
}

Tip! You can get windows line from /boot/grub.grub.cfg file. Only change for that is to replace /EFI/Microsoft as /EFI/Microsoft.orig

5. Run sudo update-grub after editing

For avoiding this kind of boot problems, the best option is to remove Windows, because when Windows is updating, it breaks boot every now and then.

If wanting to use dual boot with Windows, then you need to have refind or supergrub2 USB available.