Strange entry in /boot/grub/grub.cfg

I recently reinstalled Manjaro on another drive, leaving the old drive in place. That drive was formatted as btrfs. The system boots OK, the first 2 menu entries are as expected, configured by /etc/grub.d/10_linux:

menuentry 'Manjaro Linux'

and

menuentry 'Manjaro Linux (Kernel: 6.5.5-1-MANJARO x64 - fallback initramfs)'

However, the third one, made by /etc/grub.d/30_os-prober seems strange, it runs system memory tester. Here is the relevant section from /boot/grub/grub.cfg:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Manjaro Linux (on /dev/sda2)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4' {
        savedefault
        insmod part_gpt
        insmod btrfs
        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  40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4
        else
          search --no-floppy --fs-uuid --set=root 40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4
        fi
        linux /@/boot/memtest86+/memtest.bin 
}
submenu 'Advanced options for Manjaro Linux (on /dev/sda2)' $menuentry_id_option 'osprober-gnulinux-advanced-40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4' {
        menuentry 'Memory Tester (memtest86+) (on /dev/sda2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/@/boot/memtest86+/memtest.bin--40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4' {
                savedefault
                insmod part_gpt
                insmod btrfs
                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  40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4
                else
                  search --no-floppy --fs-uuid --set=root 40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4
                fi
                linux /@/boot/memtest86+/memtest.bin 
        }
}

set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

The new system works well, I have no need to keep the old boot entry. It is not an issue for me, I should reformat the drive anyway.

I left the drive in, in case the new installation went wrong, and I had to boot the old one. But that would not have worked. Is this a bug in the configuration script, or there is something else going on?

I am not sure what exactly you are asking, but grub.cfg is automatically generated. After you remove the unwanted drive or partition, you just run sudo update-grub and the menu entry will disappear.

Thanks. I knew that. I was surprised that under the menu entry referring to Manjaro on /dev/sda2, instead of boot commands there is a line

linux /@/boot/memtest86+/memtest.bin

When I mount the old disk, I have the old boot directory intact:

# ls -l /mnt/sda2/@/boot
total 88
-rw-r--r-- 1 root root 81920 Aug 10 12:27 amd-ucode.img
drwxr-xr-x 1 root root     0 Nov 20  2022 efi
drwxr-xr-x 1 root root   112 Sep 21 19:34 grub
-rw-r--r-- 1 root root    23 Sep  2 20:54 linux515-x86_64.kver
-rw-r--r-- 1 root root    21 Sep  2 20:55 linux61-x86_64.kver
drwxr-xr-x 1 root root    22 Jun  4 20:25 memtest86+

I might not understand the purpose of os-prober though. Does it search for all bootable devices?

I’m pretty sure all editions come with

memtest86+
memtest86+-efi

But

The entries dont look like that on my system…

    menuentry "Memory Tester (memtest86+)" --class memtest --class memtest86 --class gnu --class tool {
        linux16 /boot/memtest86+/memtest.bin 

    menuentry "Memory Tester (memtest86+)" --class memtest --class memtest86 --class gnu --class tool {
        linux /boot/memtest86+/memtest.efi 

But maybe thats just because of btrfs/subvolumes ? I couldnt say.

It seems consistent with others I’ve seen. That said, the grub.cfg is rarely anything I’ve needed to revisit since auto-generation became a factor. There may be subtle differences in variable handling, internally, between distributions, resulting in differences in syntax/layout.

You might consider matching the Grub versions, for the sake of aesthetics. Beyond that, I haven’t much more to add.

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