Manjaro(Linux分支)+Windows 10双系统,启动时Windows 10启动项丢失,恢复方法及原因分析

Manjaro(Linux分支)+Windows 10双系统,启动时Windows 10启动项丢失,恢复方法及原因分析

在Linux终端下键入fdisk -l 命令列出所有分区,根据分区的类型以及大小应该可以区分出不同分区的作用:
fdisk -l
本次使用的是笔记本电脑,只有一块硬盘,对应的硬盘编号为hd0, 划分硬盘时Windows 10用的是100G的分区,对应的是/dev/sda2,sda1只有579M,是引导分区,也有Windows启动入口,对应的hd0,msdos1hd0,msdos2都可以作为引导入口,用os-prober命令可以进一步确认。
[thinkpad]# os-prober
/dev/sda1:Windows 10:Windows:chain
/dev/sda2:Windows 10:Windows1:chain
解决方案一:手工修改
修改/etc/grub.d/40_custom文件,在文件的末尾加上如下语句
vim /etc/grub.d/40_custom
menuentry ‘Windows 10 Home Edition’ {
insmod part_msdos
insmod ntfs
set root=’hd0,msdos1’
  chainloader +1
}
#本例中由于sda1和sda2都是windows引导区set root=’hd0,msdos2’也可以达到同样的效果。
编辑完/etc/grub.d/40_custom,保存退出,然后用update-grub,更新配置,重启系统reboot,就看到新增加的Windows 10 Home Edition的启动选项了。
执行update-grub后,打开/boot/grub/grub.cfg文件,查看40_custom项下配置的变化。
/boot/grub/grub.cfg

解决方案二:系统恢复
根因:之所以出现这种情况是由于Manjaro-Team出于安全方面的考虑在新发布的补丁中禁用了操作系统自动检测选项,从而丢失了Windows的启动入口。
In the recent updates the Manjaro-Team disabled os-prober by default stating “security issues”. When I read the announcements it just linkes to some webpages stating “borderline atack vectors”.
You can try to start Manjaro with /etc/grub.d/40_custom and commenting out os-prober. This will start the bootloader of Manjaro afaik and not manjaro entry direct.
To restore the old behavior, open a terminal and issue sudo echo GRUB_DISABLE_OS_PROBER=false >> /etc/default/grub && sudo update-grub
恢复方法:在文件**/etc/default/grub**的末尾添加一行,GRUB_DISABLE_OS_PROBER=false
保存退出,然后用sudo update-grub更新grub配置文件,然后重启即可。
执行update-grub后,打开/boot/grub/grub.cfg文件,查看30_os-prober项下配置的变化。
/boot/grub/grub.cfg

参考文献:https://forum.manjaro.org/t/grub2-why-is-os-prober-now-disabled-by-default/57599/3
三个重要文件:/etc/grub.d/40_custom、/etc/default/grub、/boot/grub/grub.cfg
三个重要命令:fdisk -l、os-prober、update-grub

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值