Step-1
It was confirmed that Questioner @kihit0mi's Ubuntu installation has EFI boot loader through the following command:
$ ls /sys/firmware/efi/
Whose output was:
config_table efivars esrt fw_platform_size fw_vendor runtime runtime-map systab vars
Step-2
The following command did not yield any output:
$ sudo os-prober
Step-3
The following command was issued to generate GRUB menu:
$ sudo update-grub
System was rebooted and an attempt was made to reach GRUB menu through shift command. But it was observed that instead of reaching GRUB menu, it ended up on login screen of Ubuntu!
Step-4
To reach windows login screen, only way was through BIOS setup screen. System was rebooted, and reached BIOS setup screen by pressing del key. It was observed that there were three boot loaders present which are listed as follows:
Ubuntu
Windows Boot Manager and
EFI PXE.
After setting up Windows Boot Manager to top priority, Windows-10 was logged on successfully!
Step-5
Login to Windows 10. Press the Windows + R keys, type msinfo32.exe in Run dialog box, and then press Enter to open System Infomation window. In the right pane of System Summary, you should see the BIOS MODE line. If the value of BIOS MODE is Legacy, then Windows is booted in legacy mode. If the value of BIOS MODE is UEFI, then Windows is booted in UEFI mode. Questioner @kihit0mi confirmed that the BIOS mode line contained only UEFI. That was really good!
Step-6
Next, the Firmware BIOS was updated to the latest Version. Refer How to Check Your Current BIOS Version and upadate it.
The following command was given again to generate GRUB menu:
$ sudo update-grub
System was rebooted and an attempt was made to reach GRUB menu through shift command. It was good to observe that this time GRUB menu was reached successfully but the presence of Windows-10 was not found!
Step-7
It was decided to put a menuentry into /etc/grub.d/40_custom file which is capable of generating Windows entry into GRUB menu. In order to find out the disk and partition numbers corresponding to Windows Boot loader, it was rebooted and GRUB menu was reached by pressing 'shift' key. The grub > command line was entered, by pressing c, and the following command was given:
grub > ls
But no output yielded. So The disk and partition numbers for Windows loader were guessed to be 0 and 2 respectively which are needed for menuentry preparation.
menuentry "Windows" {
set root=(hd0,2)
chainloader +1
}
After creating the above menuentry in file /etc/grub.d/40_custom, issue the following command to make script 40_custom file executable:
$ sudo chmod +x /etc/grub.d/40_custom
Generate GRUB menu with the following command:
$ sudo update-grub
System was rebooted and GRUB menu was reached by pressing shift key. This time there was a Windows loader found. But while trying to boot, the following error was thrown out:
The EFI file path is incorrect error
#Step-8
It was attempted again and again with various disk and partition numbers entries in the menuentry, but all resulted in the same error message the EFI file path is incorrect error after selecting Windows bootloader from GRUB menu.
All these hurdles happened since Questioner @kihit0mi's laptop did not respond to ls command from GRUB menu's command line: grub > ls .
I tried the same from my desktop's GRUB menu with command grub > ls which resulted in the following output:
(hd0) (hd0.gpt8) (hd0.gpt7) (hd0.gpt6) (hd0.gpt5) (hd0.gpt4) (hd0.gpt3) (hd0.gpt2) (hd0.gpt1) (hd1) (hd2) (hd2,gpt4) (hd2,gpt3) (hd2,gpt2) (hd2,gpt1) (hd3) (hd3,gpt4) (hd3,gpt3) (hd3,gpt2) (hd3,gpt1)
How to interpret the above output from GRUB ls command?
Issue the following command for (hd0):
grub > ls (hd0)
Whose output was:
Device hd0: No known file system detected - Search size 512 B - Total size 117220824 KiB.
The output even though showed as No known file system but it really represents /dev/sda (look at the Total size). If you keep on probing such as ls (hd0,gpt8), ls (hd0,gpt7), and so on until ls (hd0,gpt1), it will display the partitions that corresponding to devices such as /dev/sda8, /dev/sda7 and so on until /dev/sda1
The above device /dev/sda (120 GB SSD) contains my Ubuntu installation which was shown as (hd0) in grub command line. The gpt1 through gpt8 represents partitions which are efi, swap, /, /usr, /opt, /tmp, /var, and /home respectively.
- Now, issue the following command for
(hd1):
grub > ls (hd1)
Whose output was:
Device hd1: No known file system detected - Search size 2048 B - Total size 514 KiB.
- Now, issue the following command for
(hd2):
grub > ls (hd2)
Whose output was:
Device hd2: No known file system detected - Search size 512 B - Total size 976762584 KiB.
Although the output was No known file system but it really represents /dev/sdb (look at the Total size). If you keep on probing such as ls (hd2,gpt4), and so on until ls (hd2,gpt1) it will display the partitions that corresponding to devices such as /dev/sdb4 and so on until /dev/sdb1
The above device /dev/sdb is my 1 TB HDD with NTFS filesystem which was shown as (hd2) in grub command line. The gpt1 through gpt4 represents NTFS partitions which are unknown, CodeWrite, ShareMe and Warehouse respectively.
- Now, issue the following command for
(hd3):
grub > ls (hd3)
Whose output was:
Device hd3: No known file system detected - Search size 512 B - Total size 244198584 KiB.
Though output showed as No known file system but it really represents /dev/sdc (look at the Total size). If you keep on probing such as ls (hd3,gpt4), and so on until ls (hd3,gpt1), it will display the partitions that corresponding to devices such as /dev/sdc4 and so on until /dev/sdc1
The above device /dev/sdc (250 GB SSD) contains my Windows-10 installation which was shown as (hd3) in grub command line. The gpt1 through gpt4 represents partitions which are EFI, unknown, WindowsOS and WinRE respectively.
#Step-9
Note: Questioner @kihit0mi's ubuntu: no output for the command sudo os-probed. Refer step-2.
Again, I tried sudo os-probed command from my Ubuntu terminal which resulted in the following output:
/dev/sdc1@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
A clue was devised from the output of above os-probed command. In order to avoid using trial & error method to look for disk and partition numbers, the following search string was incorporated in /etc/grub.d/40_custom:
search --set=root --file /efi/Microsoft/Boot/bootmgfw.efi
Note: To know more about Grub menu search command, refer this link
Now the new menuentry is capable of searching automatically disk and partition numbers corresponding to windows-10 EFI bootloader, as shown below:
menuentry "Windows" {
search --set=root --file /efi/Microsoft/Boot/bootmgfw.efi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
After creating the above menuentry in file /etc/grub.d./40_custom, the following command was given to generate GRUB menu:
$ sudo update-grub
System was rebooted and GRUB menu was reached by pressing shift key.
This time Windows-10 EFI bootloader was selected and booted into Windows-10 system successfully.
#Step-10:
not yet completed.
The Questioner @kihit0mi's presence is required at chat session in order to complete pending task which is the removal of extraneous bootloader present in the BIOS setup screen.