Is it possible to change the name of grub boot entries discovered by os-prober?

My grub menu looks like this.


I was wondering if it is possible to change the name of Windows Boot Manager (on /dev/sdb1) to something else like Windows 11 or something…

I’m not sure how this is possible since these were discovered by os-prober… maybe i have to edit the files in the efi partition? but that might leave me with a BSOD… I have tried changing the entry name from windows using EasyBCD, that is not reflected here since it is detecting the bootloader and not the os?

Found this possible thing: Where could I change/edit the menu option text description in grub2 boot menu - #5 by dth2 - Install/Boot/Login - openSUSE Forums
I haven’t tried above solution, you are on your own.
MrMazda’s post might also help.

If you come across Grub-customizer, please don’t use it. It is more trouble than it tries to solve.

2 Likes

You can most likely change the names but these may get replaced again on the next update.

If you look at /boot/grub/grub.cfg (as root) you’ll see this section:

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

I should advise this is not something I’ve dealt with myself so am not in a position to advise.

:point_up_2: :100: :point_up_2:

Thanks for pointing this out!

Seen far too many issues caused by this bloatware. It makes changes to your configurations which are hard to reverse.

1 Like

I’m going to have to agree that editing the grub.cfg file is probably best.

You are correct that is generated by os-prober.

Namely /etc/grub.d/30_os-prober … which is a pretty complicated file to untangle.

You could theoretically copy it and mess with the menuentry being generated. Somewhere in the lines 160-190 or so.

( also this reminds me to make a PR about the wrong classs being used, and thus missing icons * )

And your changes will be overwritten at some point, but still, if you must, then editing /boot/grub/grub.cfg is probably easiest.

You will see something like this:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-666X-1984' {
        savedefault
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root 666X-1984
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

There you can see the text used for the menuentry and you can edit to something like

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 11 (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-666X-1984' {
        savedefault
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root 666X-1984
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

PS

Correct classes mean more icons

[old image]

3 Likes

One other possibility is:
use /etc/grub.d/40_custom.

go to /boot/grub/grub.cfg
and get the entry beginning with:
### BEGIN /etc/grub.d/30_os-prober ###
to
### END /etc/grub.d/30_os-prober ###
and insert this into /etc/grub.d/40.custom.

Example
menuentry 'Windows 11 starten' --class windows --class os $menuentry_id_option 'osprober-efi--xxxx-yyyy' {
	savedefault
	insmod part_gpt
	insmod fat
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  xxxx-yyyy
	else
	  search --no-floppy --fs-uuid --set=root xxxx-yyyy
	fi
	chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10

After this do " sudo update-grub " - restart and look if its o.K.
If its o.K. then diisable os-prober (comment out (#)) in:
/etc/default/grub
so os-prober is replaced by 40__custom
after sudo update-grub

1 Like

Perhaps this helps:

And look here:

https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen

And:

And:

https://www.linuxquestions.org/questions/linux-newbie-8/need-to-change-menu-title-on-grub2-4175556552/

@Gavenga The downside to disabling os-prober is that each time you get a kernel update, you won’t get the new entries generated until you do run it … which will still mean some adjustment to the entry names afterwards?

1 Like

editing 40_custom and disabling os prober works, but I’m not sure about disabling it, for now I think I’ll just go with editing grub.cfg… I want to keep os-prober for when I eventually break windows ( which is going to happen… :sweat_smile: )

I have another older laptop with a similar setup and this(editing 40_custom …) would be a perfect fit for it, windows doesn’t see much light on it (pun intended).

This is not correct: updating manjaro kernels is independend of updating windows,
There are two efi-partitions – grub handels them correctly (since some years in my case :innocent:.
The System to be started is identified by UUID of the partitions, nothing else…
To PlutonianFairy: you can revert disabling if you want, because the entries in /etc/grub.d
and in /etc/default are “private” and will not be changed by the system (I hope so…)
Do not edit grub.cfg directly (there is a warning on top of this file!).
My way is riscless…

1 Like

oh, i see… i was reluctant because I might forget disabling os-prober and fumble around when something breaks… i think i’ll add a note somewhere about me disabling os-prober…

1 Like

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