为双系统 grub添加 Windows 10引导启动项:OK

已解决

Warning: os-prober will not be executed to detect other bootable partitions  https://blog.csdn.net/daijingxin/article/details/118542022 

Check GRUB_DISABLE_OS_PROBER   https://askubuntu.com/questions/1475735/check-grub-disable-os-prober

为双系统grub添加Windows10引导启动项  https://blog.csdn.net/weixin_43669969/article/details/110820419 

update-grub不探测其他操作系统  https://blog.csdn.net/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.csdn.net/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"?

https://askubuntu.com/questions/1414245/why-do-i-get-warning-os-prober-will-not-be-executed-to-detect-other-bootable-p

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"

edited Jun 23, 2022 at 9:16

BeastOfCaerbannog

14.9k1111 gold badges5454 silver badges8686 bronze badges

asked Jun 16, 2022 at 0:45

vmisq

46122 gold badges55 silver badges77 bronze badges

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 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.

edited Jun 23, 2022 at 9:22

BeastOfCaerbannog

14.9k1111 gold badges5454 silver badges8686 bronze badges

answered Jun 16, 2022 at 14:10

mook765

16.3k55 gold badges3838 silver badges7171 bronze badges

Add a comment

摘录: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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值