V
V
Vitaliy Orlov2018-03-22 18:52:56
System administration
Vitaliy Orlov, 2018-03-22 18:52:56

How to configure grub to boot UEFI Windows 8?

Hello everyone, I
use Linux as my main system, but I needed to install Windows.
Linux is on disk 1 (/dev/sda), Windows is on disk 2 (/dev/sdb).
By default, bios is configured to boot the OS from disk 1 (/dev/sda), i.e. grub is loaded and you can select additional options in it or boot into Linux.
At the time of bios loading, you can press F8 and choose from which place the OS will be loaded (disk, flash drive, etc.), if you select "UEFI Winfows Boot Manager" in this menu, then it boots into Windows.
Question: How to configure grub so that you can boot into Windows from it. Those. not through the choice of bootloader in bios, but from the grub menu?
1) Tried to create an additional menu item with this configuration:

menuentry "Windows 8" --class windows --class os {
    insmod part_gpt
    insmod search_fs_uuid
    insmod ntfs
    insmod chain
    set root='hd1,gpt4'
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4 86B4370BB436FD6D
    drivemap -s hd0 hd1
    chainloader (${root})/Windows/Boot/EFI/bootmgfw.efi
}

Windows reports a boot error:
error: invalid signature
Press any key to continue

2) If you make a configuration like this
menuentry "Windows 8" --class windows --class os {
    insmod ntfs
    set root='hd1,gpt4'
    search --no-floppy --fs-uuid --set=root 86B4370BB436FD6D
    chainloader +1
}

then an error also occurs, but this is already
5ab3dbddd3281351247493.jpeg
--[additional information]--
Disk partitions
5ab3d3a3b843e749459376.png
UUID dev-sdb-4 Disk
5ab3d3f38e828835079282.png
info
# parted -l

Model: ATA Crucial_CT128M55 (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system     Name  Flags
 2      1049kB  110GB  110GB   ext4
 1      110GB   128GB  18.0GB  linux-swap(v1)


Model: ATA Crucial_CT256MX1 (scsi)
Disk /dev/sdb: 256GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  316MB  315MB   ntfs         Basic data partition          hidden, diag
 2      316MB   420MB  105MB   fat32        EFI system partition          boot, esp
 3      420MB   555MB  134MB                Microsoft reserved partition  msftres
 4      555MB   189GB  188GB   ntfs         Basic data partition          msftdata
 5      189GB   256GB  67.3GB  ext4

Versions
#uname -a
Linux homepc 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

#cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

# grub-install --version
grub-install (GRUB) 2.02~beta2-36ubuntu3.17

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2018-03-23
@orlov0562

delete everything written by hand, then in the Linux terminal
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update && sudo apt-get install -y boot-repair
select Recommended repair

V
vreitech, 2018-03-22
@fzfx

what kind of linux - it is suggested to guess, do I understand correctly?
try to remove everything that you have already entered with your hands and do it sudo update-grub ; sudo reboot, maybe you are lucky.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question