Recently I installed Arch Linux on my laptop and forgot to set up a dual boot with my Windows 10 partition. I ended up with a Grub OS list containing only the Arch Linux option and no way of accessing my Windows 10 partition.
WARNING: My Windows 10 partition uses UEFI boot. If you have anything different, like a different version of Windows or a Legacy boot type this process might not work for you.
Here is how I solved it.
The following lines need to be added to /etc/grub.d/40_custom:
# Windows 10 EFI entry
if [ "${grub_platform}" == "efi" ]; then
menuentry "Microsoft Windows 10 UEFI" {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --set=root $hings_string $fs_uuid
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
fi
$esp = Where your windows partition is mounted. In my case, Windows is installed on /dev/sda and it created three partitions out of it: /dev/sda1, /dev/sda2 and /dev/sda3. In this case, \$esp was /dev/sda1.
How to obtain the value of $fs_uuid?
grub-probe --target=fs_uuid $esp/EFI/Microsoft/Boot/bootmgfw.efi
How to obtain the value of $hings_string?
grub-probe --target=hints_string $esp/EFI/Microsoft/Boot/bootmgfw.efi
You should end up with a block similar to this:
# Windows 10 EFI entry
if [ "${grub_platform}" == "efi" ]; then
menuentry "Microsoft Windows 10 UEFI" {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1234-AB1c
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
fi
After adding this section to your /etc/grub.d/40_custom file, you need to regenerate the grub.cfg file:
grub-mkconfig -o /boot/grub/grub.cfg
Beware of the Windows version and which type of boot you have. If you have any questions, please, don’t hesitate to contact me.
I hope it helps!