Score:0

how to add Windows 10 on disk to grub menu

cn flag

I'm using ubuntu 21.10 and I installed Windows 10 on an external SSD. Everytime I turn on my computer I see the grub menu that allow me to select ubuntu. If I want to boot to the Windows 10 need to enter BIOS and run it from there.

I want to add an option to the grub menu that when I click it, it will start Windows 10 from the disk. or other option that allows me to start Windows when the disk is connected and to Ubuntu when its not connected.

I tried adding option with grub customizer, it added an option but when I click it it says:

error: can't find command 'drivemap'.
error: can't find EFI file path.

the code that the grub customizer generated is:

set root='(hd1,2)'
search --no-floppy --fs-uuid --set 09BA-0F01
drivemap -s (hd0) ${root}
chainloader +1

I also tried adding manually using the custom40 file but it didn't even added an option.

Nmath avatar
ng flag
Bad call with grub customizer. A lot of people break their system with that software. It shouldn't exist, IMO. Did you try `os-prober` or `sudo update-grub`? `boot-repair` will also find operating systems and add them to GRUB. `os-prober` and `update-grub` can be run from your installed system but `boot-repair` must be run from a live session (Try Ubuntu). You can search for these tools on Ask Ubuntu if you have more questions about how to use them. Try them and let us know. In the meantime, get rid of grub customizer.
cn flag
grub customizer actually broke my system. but I managed to repair it. used `update-grub` when I tried using the custom40 file. used `boot-repair` on the ubuntu and it didn't add any OS to the grub. it did find the windows, but didn't add. and I tried to use `os-prober` but didn't understand how to do it. how can I use it? @Nmath
Nmath avatar
ng flag
You just run `sudo os-prober`. That's it. `boot-repair` won't work unless you run it from a live session. [Here's instructions](https://askubuntu.com/a/182863). It is essential that you run the tool from a live session so you will first need to create a bootable USB with Ubuntu and boot into that.
cn flag
tried now `sudo os-prober`, it just moved to the next line and didn't add an option. I will try `boot-repair` soon, i already have bootable USB from the system break. do you know if i need just to run it on the bootable USB or anything else? @Nmath
ChanganAuto avatar
us flag
Additional details: `os-prober` can detect additional OSes if installed in the same mode. It seems not to be the case here.
Nmath avatar
ng flag
You must run `boot-repair` from a live session following the linked instructions
cn flag
did the `boor-repair` like they said, with recommended reapir. it changed nothing @Nmath
Nmath avatar
ng flag
Are you sure that Windows and Ubuntu are both installed the same way? The use of either UEFI or BIOS/legacy/MBR/compatible must be consistent between both operating systems.
cn flag
Im not sure, how can I check it? @Nmath
cn flag
Checked Windows 10, its MBR. I don't know about the ubuntu @Nmath
cn flag
Ok, so I dont know if what im saying is what you need to know, but my windows 10 run threw UEFI and my ubuntu threw EFI. Is there anything wrong about it? Do i need to change one of them? @ Nmath
Nmath avatar
ng flag
You'll need to reinstall to make sure they are the same. I recommend UEFI installs for dual-boot configuration. The hard drive will need to have GPT formatting. If it is currently formatted using the MBR partition scheme you'll need to format (erase) the drive. You can do this in a live session using the "Disks" application. Install Windows first. Then make unpartitioned free space for Ubuntu and install Ubuntu. Make sure that you boot installation media as UEFI for both operating systems.
cn flag
Is there a problem if one of them is efi and the other is uefi? @Nmath
Nmath avatar
ng flag
UEFI and EFI are just about the same thing. EFI is a boot partition associated with a UEFI installation. If Windows is MBR you will have to reinstall. Windows should ideally be installed first in a dual-boot configuration anyway
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.