问题描述
机器安装的是Debian bullseye和Windows双系统。近日由bullseye升至bookworm,再启动后发现grub菜单上原来有的Windows项没有了。
解决方法
- 安装 os-prober
- 查看/etc/default/grub:取消原有注释行: GRUB_DISABLE_OS_PROBER=false
- 重启后发现Windows项又被扫描到了。
- 如果不必每次都更新grub时扫描各分区中的系统,可再注释掉该行即可。
上述方法在笔记本上成功实现了,但转到台式机上应用没有成功。采用了手动修改40_custom的方式。
- 
运行 sudo os-prober得到:/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi检测到 Windows在/dev/sda1分区上。
- 
运行 sudo blkid /dev/sda1得到:/dev/sda1: UUID="04E0-B3F3" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="eb8cea0d-4005-4148-9ca9-841f15302ab1"检测到 UUID="04E0-B3F3"。
- 
运行 sudo vi /etc/grub.d/40_custom,填上内容:menuentry "Windows 10" --class windows --class os { insmod ntfs search --no-floppy --set=root --fs-uuid 04E0-B3F3 ntldr /bootmgr }注意,替换 --fs-uuid后面值为刚才检测到的UUID值。
- 
运行 sudo update-grub
重启即可看到grub菜单上有了Windows 10入口项,测试可进入Win10系统。