I need to add Windows 10 in GRUB.
Windows 10 I have installed in legacy BIOS mode. Similarly as in the screenshot:
Ubuntu 16 I have installed in UEFI mode.
$ [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
UEFI
I have two hard drives. Each operating system is installed on a separate hard drive.
$ sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda 465,8G
├─sda1 vfat 19,5G RECOVERY
├─sda2 ntfs 445,8G Windows 10
└─sda3 ntfs 450M
sdb 232,9G
├─sdb1 vfat 512M /boot/efi
├─sdb2 ext2 488M /boot
└─sdb3 crypto_LUKS 231,9G
└─sda3_crypt LVM2_member 231,9G
├─ubuntu--vg-root ext4 224G /
└─ubuntu--vg-swap_1 swap 8G
└─cryptswap1 swap 8G [SWAP]
sr0 1024M
On Windows, I run the following command:
C:\WINDOWS\system32>bcdboot C:\Windows /s C: /f uefi
I performed this command to create a bootable configuration.
In Ubuntu file /etc/grub.d/40_custom I added the following option:
if [ "${grub_platform}" == "efi" ]; then
menuentry "Windows 10 (BCD-UEFI configuration on system drive /dev/sda2)" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod search_fs_uuid
insmod chain
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 8684C04C84C04103
else
search --no-floppy --fs-uuid --set=root 8684C04C84C04103
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
fi
UUID of the partition labeled "Windows 10":
$ sudo blkid /dev/sda2
/dev/sda2: LABEL="Windows 10" UUID="8684C04C84C04103" TYPE="ntfs" PARTUUID="76692ca8-02"
The problem is booting Windows 10 does not progress further the Windows logo.