1

I had elementary OS on my computer. I wiped my hard drive and installed Windows 10 without any problem. Then I shrinked the actual partition it was using, I installed Pardus in that empty partition. In order to install it, I had to disable secure boot in BIOS. It installed properly as well.

When I finally booted my computer, in GRUB menu there was no Windows 10 option. The weird thing is that when enable Secure Boot from BIOS, it cannot boot Pardus so it boots to Windows!

So far I've tried os-prober which didn't find any other OS, I've tried this link, it said ntldr not found or something of the sort. I've replaced ntldr /bootmgr with chainloader +1, and then it said invalid EFI file path. I tried to use UUID of both the largest partition which is named "Microsoft Basic Data" and used the one named "EFI System". Both game me the same error: "EFI file path."

Here is my /etc/grub.d/40_custom:

# Skipping the initial part of the file
menuentry "Windows 10" --class windows --class os {
   insmod ntfs
   search --no-floppy --set=root --fs-uuid FA53-79CA
   chainloader +1
}

Here is the result of my fdisk -l:

Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: # some hex identifier here

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1023999   1021952   499M Windows recovery environment
/dev/sda2    1024000   1226751    202752    99M EFI System
/dev/sda3    1226752   1259519     32768    16M Microsoft reserved
/dev/sda4    1259520 490168319 488908800 233,1G Microsoft basic data
/dev/sda5  490168320 968570879 478402560 228,1G Linux filesystem
/dev/sda6  968570880 976771071   8200192   3,9G Linux swap

I am thinking that I might have deleted Windows bootloader but as I've mentioned it boots to Windows when I enable Secure Boot from BIOS.

  • sudo update-grub && sudo grub-install /dev/sda – defalt Nov 9 '17 at 7:39
  • 1
    @GAD3R I did that, of course, but forgot to mention it in the post. – Haggra Nov 9 '17 at 9:16
  • @defalt I did that as well, forgot to mention it. – Haggra Nov 9 '17 at 9:17
2

First of all the fact that Windows boots indicates you have UEFI and that you could use your motherboards boot selector to boot Windows instead of GRUB. It's usually F2 or F12 during boot.

Your Windows 10 menu entry is using

chainloader +1

Which means load the first sector of the root device. Which will not work because the system is UEFI not legacy BIOS.

Instead set the root device to the EFI system and chainload the EFI for windows:

insmod part_gpt
insmod search_fs_uuid
insmod chain
search --no-floppy --set=root --fs-uuid FA53-79CA
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi

Also confirm that the UUID is correct with blkid and is for the EFI system.

GRUB should automatically detect Windows but it will not detect them on RAIDed disks.

  • I did not thoroughly understand the details but it worked nicely! Thank you for bothering to read all that and helping me out. – Haggra Nov 9 '17 at 9:49
  • Glad it worked for you. Tell me what you didn't understand so I can expand it for future readers. – jdwolf Nov 9 '17 at 10:07
  • It's not really the answer, but I don't know the basics, e.g. I don't know what bootmgfw.efi is, what search command does there etc. Search command does not even have man or help page. – Haggra Nov 9 '17 at 10:55
  • 1
    gnu.org/software/grub/manual/grub/grub.html#search and bootmgfw.efi is the UEFI boot loader for windows. Your UEFI BIOS starts grub, grub starts windows boot loader and that starts windows. – jdwolf Nov 9 '17 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.