How to change Grub menu item description

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
fehlix
Developer
Posts: 12749
Joined: Wed Apr 11, 2018 5:09 pm

Re: How to change Grub menu item description

#11 Post by fehlix »

fbagnato wrote: Sun Mar 03, 2024 9:36 pm

Code: Select all

Found Windows Vista on /dev/sda1
Found Windows Vista on /dev/sda2
done
Both entries should not be there.
I guess that looks like a "bug" in os-prober:
For now add 2nd line so you have this two lines within /etc/default/grub:

Code: Select all

GRUB_OS_PROBER_SKIP_LIST="B22CF5132CF4D2F9 2C88743C8874071C"
GRUB_OS_PROBER_SKIP_LIST="$GRUB_OS_PROBER_SKIP_LIST B22CF5132CF4D2F9@/dev/sda1 2C88743C8874071C@/dev/sda2"
and post "sudo update-grub" again.
Will check this later, whether it's a bug or something we might have overlooked during upgrade to latest grub on bookworm.

User avatar
fehlix
Developer
Posts: 12749
Joined: Wed Apr 11, 2018 5:09 pm

Re: How to change Grub menu item description

#12 Post by fehlix »

fbagnato wrote: Sun Mar 03, 2024 9:36 pm

Code: Select all

Found Windows Vista on /dev/sda1
Found Windows Vista on /dev/sda2
done
Yep, found it, that's a bug in os-prober, esp. within the file /etc/grub.d/30_os-prober
Which you can fix by running this:

Code: Select all

sudo sed -i '/ x /s// x"${DEVICE}" /' /etc/grub.d/30_os-prober
With this fix you can keep just this line

Code: Select all

GRUB_OS_PROBER_SKIP_LIST="B22CF5132CF4D2F9 2C88743C8874071C"
within /etc/default/grub.
And do run again

Code: Select all

sudo update-grub
to confirm the skip-list was recognized.

B/c device names like /dev/sda1 can change in case the kernel decides
to give it another name like /dev/sdb1, which may happen if you have a usb-stick
plugged in.

FWIW, for the record: Explaination of the "bug" and the fix
They try to check whether the device found contains a "@"sign, but fail with

Code: Select all

    if [ x"${DEVICE#*@}" != x  ] ; then
      EXPUUID="${EXPUUID}@${DEVICE#*@}"
    fi
b/c x"${DEVICE#*@}" is never x but is just the device if there is no @-sign
and wrongly add the whole device to the UUID
The fix to check for the at-sigh is this

Code: Select all

    if [ x"${DEVICE#*@}" != x"${DEVICE}" ] ; then
      EXPUUID="${EXPUUID}@${DEVICE#*@}"
    fi

fbagnato
Posts: 34
Joined: Sun Feb 12, 2023 12:56 pm

Re: How to change Grub menu item description

#13 Post by fbagnato »

Hello fehlix,

Read elsewhere that the correct format of the GRUB_OS_PROBER_SKIP_LIST is GRUB_OS_PROBER_SKIP_LIST=UUID@/dev/????

So, I modified the

Code: Select all

GRUB_OS_PROBER_SKIP_LIST="B22CF5132CF4D2F9 2C88743C8874071C"
To read

Code: Select all

GRUB_OS_PROBER_SKIP_LIST="B22CF5132CF4D2F9@/dev/sda1 2C88743C8874071C@/dev/sda2"
Then reran

Code: Select all

sudo update-grub
This worked, leaving the 2 modified Windows Vista entries in the Grub menu.

Thanks very much for all your help fehlix.

Regards,

fbagnato

User avatar
fehlix
Developer
Posts: 12749
Joined: Wed Apr 11, 2018 5:09 pm

Re: How to change Grub menu item description

#14 Post by fehlix »

Good, that it worked.
Anway, some comments:
fbagnato wrote: Tue Mar 05, 2024 2:47 am Read elsewhere that the correct format of the GRUB_OS_PROBER_SKIP_LIST is GRUB_OS_PROBER_SKIP_LIST=UUID@/dev/????

So, I modified the

Code: Select all

GRUB_OS_PROBER_SKIP_LIST="B22CF5132CF4D2F9 2C88743C8874071C"
To read

Code: Select all

GRUB_OS_PROBER_SKIP_LIST="B22CF5132CF4D2F9@/dev/sda1 2C88743C8874071C@/dev/sda2"
As mentioned in above post #12, the way to add UUID@device works b/c of the discovered "bug" in os-prober (package grub-common: file /etc/grub.d/30_os-prober).
But, as soon as the kernel decides to give another name to the device and partition e.g instead of /dev/sda1 it would suddenly show up as e.g. /dev/sdb1, the UUID@/device would suddenly not work anymore.
So, even when os-prober get's fixed, either within MX only or maybe by Debian, this workaround UUID@device may not work any longer.
Hence my advice given in post #11 to use both entries

Code: Select all

UUID UUID@/device
which would work even after os-prober get fixed.

The intended corrected way is mentioned in the GRUB documentation:
GNU GRUB Manual: 6.1 Simple configuration handling wrote:
‘GRUB_OS_PROBER_SKIP_LIST’

List of space-separated FS UUIDs of filesystems to be ignored from os-prober output.
For efi chainloaders it’s <UUID>@<EFI FILE>
but unfortunately wrongly implemented, so for now use the work around, but keep in mind, it may not work, in case the device get's another name assigned by the kernel.

Post Reply

Return to “MX Help”