0

Problem

I have a Windows 10 and Ubuntu 18.04 partition on my SSD. After installing Ubuntu, Grub2 does not provide an option to boot Windows 10.

Description

Output of various commands to help with troubleshooting.

update-grub

The current options shown in Grub2 at boot are these:

$ sudo update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.0-31-generic
Found initrd image: /boot/vmlinuz-5.0.0-31-generic
Found linux image: /boot/vmlinuz-5.0.0-23-generic
Found initrd image: /boot/vmlinuz-5.0.0-23-generic

boot-repair

I tried boot-repair, but to no avail.

Boot repair information available at http://paste.ubuntu.com/p/H54nGVBCjd/

os-prober

bash$ sudo os-prober
bash$

Editing Custom Grub Files

Per this question, I edited /etc/grub.d/40_custom to have these settings:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 10" {
    insmod ntfs
    set root='(hd0,1)'
    search --no-floppy --fs-uuid --set C4CEA0B0CEA09C64
    chainloader +1
}

grub-install

As par of troubleshooting, I've run this command:

$ sudo grub-install /dev/sda

Running against /dev/sda2 results in this error:

$ sudo grub-install /dev/sda2
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory. 

Following this post about EFI directories, I ran the following:

$ sudo mount | grep /boot/efi
$ sudo grub-install --efi-directory=/boot/efi
Installing for x86_64-efi platform.
grub-install: warning disk does not exist, so falling back to partition device /dev/sda5.
grub-install: error: disk `hostdisk//dev/sda5' not found.

blkid

Per this question

sudo blkid /dev/sda2
/dev/sda2: UUID="C4CEA0b0CEA09C64" TYPE="ntfs" PARTUUID="08efdbfd-02"

Question

What commands should we add to the custom Grub2 option so that it boots Windows?

Ross Jacobs
  • 101
  • 2
  • 2
    If you installed grub to sda2, you damaged Windows. And grub only boots working Windows. Report says Windows is hibernated. While you have new UEFI system, both Windows & Ubuntu now are installed in the 35 year old BIOS/MBR configuration, so always boot live installer in BIOS mode. Unless you want to reinstall everything in UEFI boot mode. With UEFI, you could directly boot Windows from UEFI, but with BIOS you have to temporarily reinstall a Windows BIOS boot loader, fix Windows, then restore grub to MBR. If you did install grub to sda2, post new report to see if PBR damaged. – oldfred Oct 13 '19 at 21:27
  • I generated another boot-repair summary: Grub is installed to sda5 at /boot/grub/grub.cfg /etc/fstab /boot/grub/i386-pc/core.img. It looks like I may have been prevented from installing grub to /dev/sda2 by errors encountered when running install-grub. – Ross Jacobs Oct 14 '19 at 05:06
  • 1
    It looks like Windows is hibernated or needs chkdsk. You need to temporarily install Windows boot loader to MBR & repair Windows. Then restore grub to MBR. Grub only boots working Windows and Windows cannot be hibernated. Note that Windows may turn it back on with updates. http://askubuntu.com/questions/843153/ubuntu-16-showing-windows-10-partitions & https://askubuntu.com/questions/145902/unable-to-mount-windows-ntfs-filesystem-due-to-hibernation – oldfred Oct 14 '19 at 12:55

0 Answers0