安装Windows 7 和 CentOS 7 双系统(转)

第一步:安装Windows

这一步比较简单。开机按 delete 进入BIOS(不同电脑进入BIOS方法不同),设置 USB 为第一启动项。 启动win7安装程序
一直 【下一步】,在创建分区时,分配100G给 Windows 7,100G预留给 CentOS 7,分别格式化两个主分区,把 Windows 7 安装在第一个主分区,N个【下一步】等待一会儿,安装完成进入桌面,Windows 7 安装成功。

第二步:安装CentOS 7

1.关闭Windows 7,插入用 UltraISO 制作的 Centos 7 引导U盘,启动安装程序,手动设置分区

2.选择磁盘,!!! 必须选择手动分区,否则新安装的CentOS 7 会覆盖之前安装的 Windows 7 !!!

3.挂载分区

完成第上图后,在 New CentOS 7 Installatioin 下面应该会有一栏 /root 10GB(我自己分配的root目录大小),这时不要点击【Done】,接着点击上图 中的 【+】号依次添加boot、swap分区,此时New CentOS 7 Installatioin 下应该会有三栏信息 (分区大小根据需要自行设置)

/root      10GB
/boot     1024MB
/swap      1024MB
/        87GB

此时点击 【Done】接受更改,安装程序格式化所有分区,进入正常安装程序,CentOS 7 安装完成。

第三步:设置双启动

  这时重启电脑,进入的会是 CentOS 7,登录后 编辑 /etc/grub.d/40_custom 文件,添加如下 内容

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

  
保存后,执行如下命令:

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-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.8.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.8.1.el7.x86_64.img
Found Windows 7 (loader) on /dev/sda1
done

附:如果C盘是NTFS格式,则需要安装 ntfs-3g。执行下列安装命令

# 添加阿里云源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum -y update
yum makecache
yum -y install ntfs-3g

第四步:体验
  关机重启后,出现双系统引导

  启动 CentOS 7
  启动 Windows 7

  

参考文章:https://www.dedoimedo.com/computers/dual-boot-windows-7-centos-7.html

posted @ 2022-07-11 10:42  汉学  阅读(738)  评论(0)    收藏  举报