CentOS覆盖win10引导的解决办法

时间:2021-04-21 03:31:58

解决办法:
1:在centos中安装ntfs-3g和os-prober。
2:运行grub2-mkconfig -o /boot/grub2/grub.cfg出现下图提示:

grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-327.18.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.18.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-08110bed159d42b487ce3200ed07c40d
Found initrd image: /boot/initramfs-0-rescue-08110bed159d42b487ce3200ed07c40d.img
Found Windows 7 (loader) on /dev/sda1
done

把win10识别成win7了,进入/boot/grub2/grub.cfg多了如下内容:

menuentry 'Windows 10 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-FEE4DCEEE4DCAA63' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' FEE4DCEEE4DCAA63
else
search --no-floppy --fs-uuid --set=root FEE4DCEEE4DCAA63
fi
parttool ${root} hidden-
chainloader +1
}

重起后即可进入win10