Grub: to get rid of os-prober

For the time being, everything is fine with my Grub using UEFI., os-prober being enabled. However, I lost confidence is os-prober. We had a big problem at the end of last month. Worse still, I can see that the “segmentation error”, though presently inocuous, has not yet been eliminated after more than a month, I think disaster could strike any time…

For this reason, I would like to ditch os-prober. This is easy to do , but first, as I have a dual boot (W10 and Linux), I’d like to write the Windows menu entry in the file /etc/grub.d/40_custom and I do not know how to write it. I think writing this entry, I would never lose this W10.

Could some knowledgeable person give me an example of a Windows menu entry?

modify in /etc/default/grub
GRUB_DISABLE_OS_PROBER=true

sudo nano /etc/default/grub ( Ctrl+X and confirm save )

sudo grub-mkconfig -o /boot/grub/grub.cfg

just update /etc/default/grub

For an example, look at: https://wiki.gentoo.org/wiki/GRUB/Chainloading
Go to the bottom of the page: Dual-booting Windows on UEFI with GPT
Adapt it to your setup. The UUID etc.

Even without this, you should be able to start Windows from BIOS boot menu.

You can simply copy the Windows menuentry from file
/boot/grub/grub.cfg
to file
/boot/grub/custom.cfg

A menuentry is something like

menuentry 'Windows' {
    # contents
}

Tip: change the name of the Windows menuentry in custom.cfg to see you have another Windows entry at boot.

2 Likes

This is perhaps the more straightforward way than making a 40_custom.

I’m using this way. But nothing wrong with other ways, as long as one remembers what was done.

1 Like

Thanks you for your replies.

Though the Gentoo wiki (thanks cactux) provides indeed a menu-entry for a W10 with UEFI, I used the solution of Manuel (thanks Manuel) which looks easier. It indeed created a new Windows2 entry, after that I could disable os-prober (thanks Stephane) . For good measure, I used both mk-config and grub-install, then I rebooted without os-prober and I am now left with Linux and W10.

Problem solved. Thanks to all! :grinning_face:

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.