34

I'm running Ubuntu 22.04 and everything was fine. Today I did sudo apt update && sudo apt upgrade and at the end I got the following warning:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-39-generic
Found initrd image: /boot/initrd.img-5.15.0-39-generic
Found linux image: /boot/vmlinuz-5.15.0-37-generic
Found initrd image: /boot/initrd.img-5.15.0-37-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

From what I have seen, os-prober is used when multiple OS are installed on the same machine, so why is this warning on? I have only Ubuntu 22.04 installed. Is it because of the two kernels found?

Memtest86+ already solved in the comments, but what about os-prober?

Here is the content of /etc/default/grub:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
5
  • Memtest86+ is a memory testing program, that is started from the Grub menu, however the program cannot be run on your hardware thus its being ignored on your system. There is little you can do, on some machines it's *executable but the same code on other machine is not on others; the menu item will show if your hardware is capable of running the version Ubuntu provides (it's not signed for Secure-uEFI so isn't bootable on many modern devices)
    – guiverc
    Commented Jun 16, 2022 at 2:36
  • 3
    Does this answer your question? Can I boot memtest86+ if I'm using UEFI?
    – guiverc
    Commented Jun 16, 2022 at 2:37
  • 3
    This post explains why and how to fix the memtest86+ part. But I still need to know what to do about the os-prober warning. I know it says that if I switch GRUB_DISABLE_OS_PROBER to False it will go away. But since I do not have other OS installed, this warning wasn't supposed to appear, since it's the default option.
    – vmisq
    Commented Jun 16, 2022 at 11:52
  • Is the file /etc/grub.d/30_os-prober executable? Check with ls -l /etc/grub.d/30_os-prober.
    – mook765
    Commented Jun 16, 2022 at 12:37
  • yes: -rwxr-xr-x
    – vmisq
    Commented Jun 16, 2022 at 12:45

1 Answer 1

37

The warning is generated by /etc/grub.d/30_os-prober, take a look at the lines 43 to 59:

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
  grub_warn "$(gettext_printf "os-prober will not be executed to detect other bootable partitions.\nSystems on them will not be added to the GRUB boot configuration.\nCheck GRUB_DISABLE_OS_PROBER documentation entry.")"
  exit 0
elif [ "x${GRUB_DISABLE_OS_PROBER}" = "xauto" ]; then
  # UBUNTU: We do not want to disable os-prober on upgrades if we found items before.
  if test -e /boot/grub/grub.cfg && ! grep -q osprober /boot/grub/grub.cfg; then
    grub_warn "$(gettext_printf "os-prober will not be executed to detect other bootable partitions.\nSystems on them will not be added to the GRUB boot configuration.\nCheck GRUB_DISABLE_OS_PROBER documentation entry.")"
    exit 0
  fi
fi

if ! command -v os-prober > /dev/null || ! command -v linux-boot-prober > /dev/null ; then
  # missing os-prober and/or linux-boot-prober
  exit 0
fi

grub_warn "$(gettext_printf "os-prober will be executed to detect other bootable partitions.\nIts output will be used to detect bootable binaries on them and create new boot entries.")"

You have several options:

  • Ignore the warning, it's only a warning, not an error.

  • Set the variable GRUB_DISABLE_OS_PROBER=false in /etc/default/grub. The warning will change to os-prober will be executed to detect..., as we can see in the snippet of the script.

  • Remove the executable bit from /etc/grub.d/30_os-prober. This will prevent the execution of the script, so you can't get any of this warnings. You can do that with:

    sudo chmod -x /etc/grub.d/30_os-prober
    
  • Edit the script /etc/grub.d/30_os-prober. If you comment out the lines with grub_warn, the script will run without issuing these warnings.

2
  • 3
    Another option would be to apt purge os-prober
    – Larsen
    Commented Jul 4, 2023 at 7:35
  • 4
    Yes, and it works. The script contains a check for missing os-prober and/or linux-boot-prober and then exits
    – Larsen
    Commented Jul 5, 2023 at 8:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .