4

I've had a look at a few other questions here (such as GRUB does not detect Windows), however, many of the options that have been voted up don't work.

Currently my 40_custom file looks like the below (after a few different attempts):

#8AEC5322EC5307B9
menuentry "Windows 10" --class windows --class os {
   insmod ntfs
   search --no-floppy --set=root --fs-uuid 88F44DC9F44DB9E8
   #chainloader +1
   ntldr /bootmgr
}

When using this this I get the error cannot find command ntldr. if i comment out the above and change to chainloader +1 i get the error invalid efi file path.

I suspect the problem is that when I installed Windows 10, it was "kind" enough to use a different storage device to one I installed Windows on for the System Reserved location. I won't lie, I wasn't frilled at it's choice, but nevermind. As a result the boot files are on /dev/sda1 (with the ID 88F44DC9F44DB9E8) and Windows 10 itself is on /dev/sdb1. Ubuntu is installed on a nvme device.

os-prober doesn't detect Windows 10 (yes, both the partitions are mounted in ubuntu when I run it) and update-grub doesn't detect it either.

I can still boot to Windows 10 at least, however, to do it I need to hit Esc in grub and then type exit in the command line. I'll then be greeted with the Windows 10 logo.

Anyone any ideas here? I'm guessing I need to use a command like set root='(hd0,1)', but I'm honestly not sure which values need to go in for the parameters.

PasteBin link for boot-repair logs.

Relevant boot-repair section:

=================== Suggested repair
The default repair of the Boot-Repair utility would purge (in order to unsign) and reinstall the grub2 of nvme0n1p2 into the MBRs of all disks (except live-disks and removable disks without OS).
Grub-efi would not be selected by default because: no-win-efi
Additional repair would be performed: unhide-bootmenu-10s   fix-windows-boot


=================== Blockers in case of suggested repair
GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted. Then try again.
Alternatively, you can retry after activating the [Separate /boot/efi partition:] option.


=================== Advice in case of suggested repair
EFI detected. You may want to retry after activating the [Separate /boot/efi partition:] option.
Do you want to continue?


=================== Final advice in case of suggested repair
Please do not forget to make your BIOS boot on nvme0n1 (WDS500G2X0C-00L350) disk!


=================== User settings
The settings chosen by the user will not act on the boot.
Larnu
  • 225
  • Install and run boot-repair: https://askubuntu.com/questions/1104855/how-to-make-grub-menu-appear-instead-grub-minimal-bash-like-in-booting/1105737#1105737 – WinEunuuchs2Unix Jul 20 '19 at 17:09
  • Will that have an adverse effects on the Ubuntu install? What does the above actually do? – Larnu Jul 20 '19 at 17:12
  • 2
    We want the report, not any fixes. Just post link to the Summary report it gives. Boot-Repair may suggest fixes, but until reviewed do not run any. Almost all fixes are for Ubuntu as most Windows fixes need your Windows repair flash drive. – oldfred Jul 20 '19 at 17:21
  • As @oldfred alludes you can run boot-repair to do a report only with no fixes. Run this option. I'm hoping the report will tell us why Windows 10 is not being added to grub menu. The report will also list the fixes it would perform if the option to fix grub (and other issues) was chosen. – WinEunuuchs2Unix Jul 20 '19 at 17:32
  • Thanks both. @oldfred , you can find the logs on PasteBin – Larnu Jul 20 '19 at 17:37
  • I've updated your question with the relevant boot-repair recommendations. CC: @oldfred (a little above my paygrade :)) – WinEunuuchs2Unix Jul 20 '19 at 19:24
  • Report does not show NVMe drives yet, as completely as SATA drives. You show no Windows UEFI boot entry and sda looks like it was converted from gpt to MBR. Windows only boots from MBR with BIOS, and boot partition is on sda. But it looks like install is on sdb. Cannot tell what is on NVMe drive., possibly UEFI, but no UEFI entry.You booted Boot-Repair in BIOS mode, not UEFI mode. From Windows does it say if UEFI or BIOS (not sure how to ask in Windows). Perhaps: http://www.rodsbooks.com/refind/bootmode.html#windows – oldfred Jul 20 '19 at 19:36
  • I'm afraid I really don't follow what you're saying there, @oldfred . – Larnu Jul 20 '19 at 20:44
  • I think you have Windows in BIOS boot mode & Ubuntu in UEFI boot mode. They are not compatible. Once you start booting in one mode you cannot change, or grub can only boot other installs in same boot mode. Wanted to confirm if Windows is installed in the now 35 year old BIOS/MBR configuration, even though Microsoft has required vendors to install in UEFI/gpt since Windows 8 released in 2012. Ability to allow BIOS installs was for large users, who wanted all systems the same. – oldfred Jul 20 '19 at 21:04
  • Windows installed however it wanted to install, @oldfred . I'm afraid this type of thing is miles away from my expertise, and why I'm asking how to get things working here. – Larnu Jul 20 '19 at 21:39
  • If Windows is BIOS & Ubuntu UEFI, then you can only dual boot from UEFI boot menu. If you really want the old BIOS you can convert Ubuntu to BIOS by reinstalling grub-pc. But if on gpt drive must have a 1 or 2MB unformatted partition with bios_grub flag for grub to install correctly. Or you can reinstall Windows in UEFI boot mode. Both Windows & Ubuntu install in the mode UEFI or BIOS that you use to boot install media. – oldfred Jul 20 '19 at 22:27

3 Answers3

2

You should convert your Windows disk (sdb) to a GPT format. Here, Windows is using an MBR disk, which as it is, needs to run in Legacy BIOS. Ubuntu is running in your M.2 drive (nvme0n1) in a GPT format in UEFI mode (L.308 suggests this). UEFI is like the modern equivalent of the old BIOS system and has replaced it, but you can still switch to Legacy BIOS, except Windows will not support a computer running in UEFI mode with an MBR disk, which is the case here.

To convert your green SSD drive to GPT format is easy enough in Ubuntu, using Gparted. Except it will wipe everything on that drive so you would need to re-install Windows. You'd lose any data files on that disk too. Alternatively there is some free software, by EaseUs Partition Master which claims it can convert without loss of any files. I haven't used it so I cannot confirm whether it works OK, but it would save a lot of time and trouble if it does.

There's also the issue of your Windows MSR partition residing on sda. Why it's not on your main Windows sdb disk, I don't know, but for the time being I'd leave it where it is, but you will probably need to convert sda also to make everything UEFI compatible across the board. Just make sure you back-up all data files residing on sda/sdb first before converting said disks to GPT.

Paul Benson
  • 1,022
  • 1
    Reinstalling Windows is something i heavily want to avoid. Unfortunately internet speeds are terrible here, so to redown updates would mean i'd lose the best of a day to get things back to where they were. I have, however, managed a "work around". – Larnu Jul 21 '19 at 10:18
1

This is how I "solved" the problem, but from the comments, there does appear to be an underlying issue with the way that Windows decided to install itself (if the fact that it nicely put the boot partition on a different disc wasn't obvious enough).

As i mentioned, in my question when I hit Esc and then typed exit the machine booted to Windows 10. As a result I added to following to the 40_custom file:

menuentry "Exit to Windows 10"{
    exit
}

I then ran update-grub. When I select the option, this then has grub "boot" to Windows.

Larnu
  • 225
0

Have you tried to install os-prober?

sudo apt-get install os-prober

reinstall your grub:

grub-mkconfig
grub-install
grub-mkconfig -o /boot/grub/grub.cfg
  • From my question "os-prober doesn't detect Windows 10* (yes, both the partitions are mounted in ubuntu when I run it) and update-grub doesn't detect it either."* – Larnu Jul 21 '19 at 12:19