如何双启动 CentOS 7 和 Windows 10
本指南将向您展示如何轻松地在 Windows 10 上双重启动 CentOS 7。这也适用于在 Windows 7 和 Windows 10 上双重启动 CentOS 7。
默认情况下,CentOS anaconda 安装程序不会配置 grub处理 NTFS 文件系统或分区。因此需要手动干预来双启动 CentOS 7 和 Windows 10。
如何双启动 CentOS 7 和 Windows 10
启动 CentOS 7 机器并挂载包含 Windows 安装的分区。您可以安装gparted磁盘分区管理器来帮助您记录Windows分区,只需在终端中输入以下命令
sudo yum -y install epel-release
sudo yum install -y gparted
sudo gparted
为了能够在 CentOS 7 上挂载 NTFS 文件系统,请安装以下程序。
sudo yum -y install ntfs-3g fuse ntfsprogs ntfsprogs-gnomevfs
编辑/etc/grub.d/40_custom 文件。首先对其进行备份。
sudo cp /etc/grub.d/40_custom /etc/grub.d/40_custom.original
然后编辑/etc/grub.d/40_custom
文件,用vi编辑器或nano打开它。
sudo vi /etc/grub.d/40_custom
在底部添加以下行
Menuentry "Windows" {
set root=(hd0,3)
chailoader +1
}
您可以更改“ ”中的菜单项标题菜单以反映您的 Windows 操作系统版本,但这不是必需的。
root=(hd0, 3) 行表示第一个硬盘驱动器上的第四个分区。将 3 替换为从 gparted 获取的 Windows 分区号,因为下图中我的 WIndows 10 分区位于 /dev/sda3
跑步
sudo grub2-mkconfig -o /boot/grub2.cfg
检查新配置是否包含 Windows 详细信息
sudo cat /boot/grub.cfg
重新启动您的系统
sudo reboot
您现在应该能够双启动 CentOS 7 和 Windows 10。另请阅读:
在 Linux 上创建 Windows 10 可启动 USB