需求
测试环境可能出现的是测试nfs的时候需要一个linux系统,测试cifs的时候又需要切换到windows系统下,如果反复切换,反复装系统会耗费大量的时间,所以在一开始就把客户端环境做成双系统会节约比较多的时间
操作步骤
本篇是以windows server 2012 R2和centos7 双系统举例的,其它操作步骤类似,因为服务器现在基本都支持UEFI引导,所以这里也以UEFI举例
安装windows系统
windows系统会覆盖掉linux的引导,但是linux不会覆盖windows的引导,还会自动添加进来,所以这里最简单的方法就是先安装windows的就行
规划好需要使用的空间,然后点应用会自动分区,这里就是60G
可以看到自动分了好几个区,这里就是我们windows需要用到的分区,这个就可以开始安装系统了,点击下一步就可以,安装好了后换linux的ISO重新启动安装
安装centos7系统
其它的根据需求选择即可,这个存储的地方是需要选择的地方
选择自定义分区
上面的就是windows下面分好的区,我们不动里面的任何东西
直接新增分区
根分区和efi分区是必须的,这个增加两个即可
分完以后就是下面的这种
然后点击安装即可
启动选择
grub页面有三个选项,第一个就是linux,第三个就是windows,默认是linux启动,我们如果需要默认windows启动,在linux下调整
[root@192 ~]# cat /etc/grub2-efi.cfg |grep menu
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
set timeout_style=menu
menuentry 'CentOS Linux (3.10.0-1062.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1062.el7.x86_64-advanced-d64661ea-bd61-4126-a1c2-47a96f2ec51f' {
menuentry 'CentOS Linux (0-rescue-3f6737a82e2e4152acf9932b69cc3360) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-3f6737a82e2e4152acf9932b69cc3360-advanced-d64661ea-bd61-4126-a1c2-47a96f2ec51f' {
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-409A-65EF' {
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
[root@192 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1062.el7.x86_64) 7 (Core)
[root@192 ~]# grub2-set-default 'Windows Boot Manager (on /dev/sda2)'
[root@192 ~]# grub2-editenv list
saved_entry=Windows Boot Manager (on /dev/sda2)
如果需要恢复linux启动,就手动选择linux启动,然后改默认启动项目即可