CentOS安装完成后续工作之二:安装Windows 7后再安装centos 7恢复Windows 7启动项

安装Windows 7后,再安装CentOS 7,重新启动,发现Windows 7启动项消失了。
原因:CentOS 7 默认不支持ntfs分区,无法读取 windows 7 的 引导程序。

1. 修复方法一(推荐):

安装 ntfs-3g 用于识别ntfs分区

首先用yum search查找ntfs包

#yum search ntfs
已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
============================== N/S matched: ntfs ===============================
ntfs-3g.x86_64 : Linux NTFS userspace driver
ntfs-3g-devel.x86_64 : Development files and libraries for ntfs-3g
ntfsprogs.x86_64 : NTFS filesystem libraries and utilities

然后安装epel-release

# yum install epel-release
已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 升级
---> 软件包 epel-release.noarch.0.7-12 将被 更新
--> 解决依赖关系完成

依赖关系解决

================================================================================
 Package                架构             版本              源              大小
================================================================================
正在更新:
 epel-release           noarch           7-12              epel            15 k

事务概要
================================================================================
升级  1 软件包

总下载量:15 k
Is this ok [y/d/N]: y
Downloading packages:
epel/x86_64/prestodelta                                    | 1.0 kB   00:00     
epel-release-7-12.noarch.rpm                               |  15 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在更新    : epel-release-7-12.noarch                                    1/2 
  清理        : epel-release-7-11.noarch                                    2/2 
  验证中      : epel-release-7-12.noarch                                    1/2 
  验证中      : epel-release-7-11.noarch                                    2/2 

更新完毕:
  epel-release.noarch 0:7-12                                                    

完毕!

安装ntfs-3g

shell
# yum install ntfs-3g.x86_64
已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 ntfs-3g.x86_64.2.2017.3.23-11.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

================================================================================
 Package         架构           版本                         源            大小
================================================================================
正在安装:
 ntfs-3g         x86_64         2:2017.3.23-11.el7           epel         265 k

事务概要
================================================================================
安装  1 软件包

总下载量:265 k
安装大小:612 k
Is this ok [y/d/N]: y
Downloading packages:
ntfs-3g-2017.3.23-11.el7.x86_64.rpm                        | 265 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : 2:ntfs-3g-2017.3.23-11.el7.x86_64                           1/1 
  验证中      : 2:ntfs-3g-2017.3.23-11.el7.x86_64                           1/1 

已安装:
  ntfs-3g.x86_64 2:2017.3.23-11.el7                                             

完毕!

重新生成引导项

# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-1062.4.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1062.4.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-48b8fac2a2c24724a135e690a4776799
Found initrd image: /boot/initramfs-0-rescue-48b8fac2a2c24724a135e690a4776799.img
Found Windows 7 (loader) on /dev/sda1
done

修复方法二:

进入su模式,修改grub.cfg

# su
密码:
#vim /boot/grub2/grub.cfg

找到 ### BEGIN /etc/grub.d/30_os-prober ###

然后添加:

menuentry "Windows 7" {
set root='(hd0,1)'
chainloader +1
}

注意,hd0表示系统第一块硬盘,1表示C分区,根据实际情况修改。

然后执行下面的命令,

# grub2-mkconfig -o /boot/grub2/grub.cfg

然后重新启动机器。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

steventian72

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值