centos7添加win7启动引导方法

centos7添加win7启动引导方法
在win7上装完centos7的小伙伴们,一般都会遇到个问题就是win7启动不了了。
1、vim /boot/grub2/grub.cfg
2、找到  ### BEGIN /etc/grub.d/30_os-prober ###,在后面添加

[plain]  view plain  copy
  1. menuentry "Windows 7" {  
  2.      insmod ntfs  
  3.      set root=(hd0,1)  
  4.      chainloader +1  
  5. }  

(grub2从1计数,win7装在C盘上的可以在终端里输入 fdisk -l来确定下,一般win都是装在C的吧)

3、wq! 

4、reboot(重启之后会在启动页面第三行字符出现windos7,选中,按回车,OK!!);


但是这个文件是不推荐直接手动改的,因为系统更新会执行grub更新操作,这个文件就会被刷新,添加的内容就没了

所以,我们这样做下处理:

1、cd /etc/grub.d

2、vim 40_custom

写入以下内容

[plain]  view plain  copy
  1. #!/bin/sh  
  2. exec tail -n +3 $0  
  3. # This file provides an easy way to add custom menu entries.  Simply type the  
  4. # menu entries you want to add after this comment.  Be careful not to change  
  5. # the 'exec tail' line above.  
  6. menuentry 'Windows7'{  
  7. set root=(hd0,1)  
  8. chainloader +1  
  9. }  

3、再刷进boot下的文件:  grub2-mkconfig -o /boot/grub2/grub.cfg

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值