已解决
Warning: os-prober will not be executed to detect other bootable partitions https://blog.youkuaiyun.com/daijingxin/article/details/118542022
Check GRUB_DISABLE_OS_PROBER https://askubuntu.com/questions/1475735/check-grub-disable-os-prober
为双系统grub添加Windows10引导启动项 https://blog.youkuaiyun.com/weixin_43669969/article/details/110820419
update-grub不探测其他操作系统 https://blog.youkuaiyun.com/CHAOS_ORDER/article/details/108304382
使用 GRUB 引导 MS Windows 操作系统 https://cn.linux-console.net/?p=10556
通过 grub 引导 Arch Windows 双系统 https://blog.stelpolvo.com/20210804/load-Arch-and-Windows-system-by-grub/
Why do I get "Warning: os-prober will not be executed to detect other bootable partitions." after running "apt upgrade"? https://askubuntu.com/questions/1414245/why-do-i-get-warning-os-prober-will-not-be-executed-to-detect-other-bootable-p
How to Edit GRUB with GRUB Customizer https://blog.youkuaiyun.com/ken2232/article/details/139974230
软件包:grub-customizer(5.1.0-3) GUI to configure GRUB2 and BURGhttps://packages.debian.org/zh-cn/bullseye/utils/grub-customizer
===================================
问题的提出:
双硬盘,每个硬盘一个系统。
分别是:win 10 ,ubuntu 22.04
1. 22.04 默认之下:os-prober will not be executed to detect other bootable partitions
2. 在某种场景之下,如果运行 sudo os-prober,是找不到 windows 10 启动分区的。
此时,如果运行 sudo update-grub,则会造成在 grub 启动菜单中,windows 启动项的丢失。
这样,就只能使用 F12 来选择启动现,才能进入 windows。
3. 解决:如下
https://askubuntu.com/questions/1475735/check-grub-disable-os-prober
$ sudo os-prober
/dev/sda1:Windows 10:Windows:chain
探测
Windows 磁盘没有挂载时,才会显示如下。
注意:在 windows 系统盘挂载之后,没有显示结果,意味着:探测不到,无效。
$ sudo os-prober
/dev/sda1:Windows 10:Windows:chain
修改:
1. 错误警告
Warning: os-prober will not be executed to detect other bootable partitions
2. 解决
在 22.04 中,在原始的 /etc/default/grub 文件里,没有 GRUB_DISABLE_OS_PROBER 这项,需要自己添加。
Just do the following
user@ubuntu:~$ sudo nano /etc/default/grub
and uncomment GRUB_DISABLE_OS_PROBER
=false
or add it if not exist then execute
GRUB_DISABLE_OS_PROBER=false
2. Windows 磁盘没有挂载,运行如下命令:
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.5.0-35-generic
Found initrd image: /boot/initrd.img-6.5.0-35-generic
Found linux image: /boot/vmlinuz-6.5.0-27-generic
Found initrd image: /boot/initrd.img-6.5.0-27-generic
Found linux image: /boot/vmlinuz-6.5.0-26-generic
Found initrd image: /boot/initrd.img-6.5.0-26-generic
Found linux image: /boot/vmlinuz-6.2.0-26-generic
Found initrd image: /boot/initrd.img-6.2.0-26-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows 10 on /dev/sda1
done
update-grub
$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.5.0-35-generic
Found initrd image: /boot/initrd.img-6.5.0-35-generic
Found linux image: /boot/vmlinuz-6.5.0-27-generic
Found initrd image: /boot/initrd.img-6.5.0-27-generic
Found linux image: /boot/vmlinuz-6.5.0-26-generic
Found initrd image: /boot/initrd.img-6.5.0-26-generic
Found linux image: /boot/vmlinuz-6.2.0-26-generic
Found initrd image: /boot/initrd.img-6.2.0-26-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows 10 on /dev/sda1
done
解决
OK
=======================================
Why do I get "Warning: os-prober will not be executed to detect other bootable partitions." after running "apt upgrade"?
31
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"
14.9k1111 gold badges5454 silver badges8686 bronze badges
asked Jun 16, 2022 at 0:45
46122 gold badges55 silver badges77 bronze badges
- 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 withls -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
Sorted by:
35
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 toos-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 withgrub_warn
, the script will run without issuing these warnings.
14.9k1111 gold badges5454 silver badges8686 bronze badges
answered Jun 16, 2022 at 14:10
16.3k55 gold badges3838 silver badges7171 bronze badges
-
3
Another option would be toapt purge os-prober
– Larsen
Commented Jul 4, 2023 at 7:35 - @Larsen That will indeed remove
/usr/bin/os-prober
but will not remove the script/etc/grub.d/30_os-prober
which is part of the packagegrub-common
, so you'd still get one of these warnings when runnigupdate-grub
. Did you try your suggestion?– mook765
Commented Jul 4, 2023 at 7:53
- 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
摘录:Check GRUB_DISABLE_OS_PROBER
https://askubuntu.com/questions/1475735/check-grub-disable-os-prober
Just do the following
user@ubuntu:~$ sudo nano /etc/default/grub
and uncomment GRUB_DISABLE_OS_PROBER=false
or add it if not exist then execute
user@ubuntu:~$ sudo os-prober
user@ubuntu:~$ sudo update-grub
and then restart your labtop to see changes if I helped you please upvote