重新检测本地硬盘上是否存在有操作系统,然后自动生成启动菜单
grub2-mkconfig -o /boot/grub2/grub.cfg

@进入LINUX系统,修改grub.cfg文件。

#vim /boot/grub2/grub.cfg

menuentry ‘Red Hat Enterprise Linux Server, with Linux 0-rescue-34786823d5874692b83de2451c506780′ –class red –class gnu-linux –class gnu –class os –unrestricted $menuentry_id_option ‘gnulinux-0-rescue-34786823d5874692b83de2451c506780-advanced-0ab9721b-0a35-47a0-894e-20a82df30ab2′ {
load_video
insmod gzio
insmod part_msdos
insmod xfs
set root=’hd0,msdos9′

if [ x$feature_platform_search_hint = xy ]; then
search –no-floppy –fs-uuid –set=root –hint-bios=hd0,msdos9 –hint-efi=hd0,msdos9 –hint-baremetal=ahci0,msdos9 –hint=’hd0,msdos9′ 1cbbd1bc-1f5b-4fde-bc01-fc5a207ceab6
else
search –no-floppy –fs-uuid –set=root 1cbbd1bc-1f5b-4fde-bc01-fc5a207ceab6
fi

linux16 /vmlinuz-0-rescue-34786823d5874692b83de2451c506780 root=UUID=0ab9721b-0a35-47a0-894e-20a82df30ab2 ro rd.lvm.lv=rhel/root crashkernel=auto rd.lvm.lv=rhel/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=us rhgb quiet
initrd16 /initramfs-0-rescue-34786823d5874692b83de2451c506780.img
}

加入下面这些

menuentry ‘Windows7′ {
set root=’hd0,msdos1′
chainloader +1
}

重启,是不是看到你的 Windows 7了。

默认 Windows 7 启动:

vim /boot/grub/grubenv
修改
saved_entry=Red Hat Enterprise Linux Linux, with Linux 3.10.0-123.el7.x86_64

saved_entry=Windows 7

http://zhangxiaohua.blog.51cto.com/2321741/1593541

Published in Linux

No Responses to “windows 7下安装 centos 7 后无法启动windows的解决方法”

Leave a Reply

请输入算式结果(看不清请点击图片)
(必须)