首先默认是安装win10系统然后在安装centos
一个硬盘两个系统:
首先将磁盘压缩出40个G出来
磁盘管理
然后分出40G压缩卷。
两个硬盘两个系统:
如果是两个硬盘就在win10的盘符下分出1024MB压缩卷,注意系统引导要在win10的盘符下 。也就下面自定义centos7
安装的时候分卷的boot目录它的安装地址是在win10的硬盘上也就是分出来的1024MB空间,其他分卷安装在另一个硬盘上。
其他:
win10安装就略过
linux注意:
1.选择自定义安装
2.设置分区
一个盘:
如图所示boot目录在一个盘是默认在同一个盘分出的40G压缩卷
如果是两硬盘就是boot放在win10硬盘分出的1G压缩卷。其他放在第二个硬盘下面
注:
swap:是内存缓存,一般是内存1~2倍。
其他和正常安装centos一样。
安装完成必然在启动页面没有win10启动选项
解决办法
yum update
yum install epel-release
yum install ntfs-3g
grub2-mkconfig -o /boot/grub2/grub.cfg
设置第一启动项为win10
#找文件
find /boot -name 'grub*.cfg'
找到然后修改grub.cfg
### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-1160.71.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.71.1.el7.x86_64-advanced-07f2fcdf-8121-424c-a791-6a915078df9e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 8cae82e5-b99d-40a9-b43d-a7f688c44da6
else
search --no-floppy --fs-uuid --set=root 8cae82e5-b99d-40a9-b43d-a7f688c44da6
fi
linux16 /vmlinuz-3.10.0-1160.71.1.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
initrd16 /initramfs-3.10.0-1160.71.1.el7.x86_64.img
}
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-07f2fcdf-8121-424c-a791-6a915078df9e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 8cae82e5-b99d-40a9-b43d-a7f688c44da6
else
search --no-floppy --fs-uuid --set=root 8cae82e5-b99d-40a9-b43d-a7f688c44da6
fi
linux16 /vmlinuz-3.10.0-1062.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
initrd16 /initramfs-3.10.0-1062.el7.x86_64.img
}
menuentry 'CentOS Linux (0-rescue-bd7ddf0ddff841269bdf9f106c15e59b) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-bd7ddf0ddff841269bdf9f106c15e59b-advanced-07f2fcdf-8121-424c-a791-6a915078df9e' {
load_video
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 8cae82e5-b99d-40a9-b43d-a7f688c44da6
else
search --no-floppy --fs-uuid --set=root 8cae82e5-b99d-40a9-b43d-a7f688c44da6
fi
linux16 /vmlinuz-0-rescue-bd7ddf0ddff841269bdf9f106c15e59b root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
initrd16 /initramfs-0-rescue-bd7ddf0ddff841269bdf9f106c15e59b.img
}
if [ "x$default" = 'CentOS Linux (3.10.0-1160.71.1.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-1160.71.1.el7.x86_64) 7 (Core)'; fi;
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 10 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-E6F0D293F0D268F7' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' E6F0D293F0D268F7
else
search --no-floppy --fs-uuid --set=root E6F0D293F0D268F7
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}
修改后
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Windows 10 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-E6F0D293F0D268F7' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' E6F0D293F0D268F7
else
search --no-floppy --fs-uuid --set=root E6F0D293F0D268F7
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry 'CentOS Linux (3.10.0-1160.71.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.71.1.el7.x86_64-advanced-07f2fcdf-8121-424c-a791-6a915078df9e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 8cae82e5-b99d-40a9-b43d-a7f688c44da6
else
search --no-floppy --fs-uuid --set=root 8cae82e5-b99d-40a9-b43d-a7f688c44da6
fi
linux16 /vmlinuz-3.10.0-1160.71.1.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
initrd16 /initramfs-3.10.0-1160.71.1.el7.x86_64.img
}
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-07f2fcdf-8121-424c-a791-6a915078df9e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 8cae82e5-b99d-40a9-b43d-a7f688c44da6
else
search --no-floppy --fs-uuid --set=root 8cae82e5-b99d-40a9-b43d-a7f688c44da6
fi
linux16 /vmlinuz-3.10.0-1062.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
initrd16 /initramfs-3.10.0-1062.el7.x86_64.img
}
menuentry 'CentOS Linux (0-rescue-bd7ddf0ddff841269bdf9f106c15e59b) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-bd7ddf0ddff841269bdf9f106c15e59b-advanced-07f2fcdf-8121-424c-a791-6a915078df9e' {
load_video
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 8cae82e5-b99d-40a9-b43d-a7f688c44da6
else
search --no-floppy --fs-uuid --set=root 8cae82e5-b99d-40a9-b43d-a7f688c44da6
fi
linux16 /vmlinuz-0-rescue-bd7ddf0ddff841269bdf9f106c15e59b root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
initrd16 /initramfs-0-rescue-bd7ddf0ddff841269bdf9f106c15e59b.img
}
if [ "x$default" = 'CentOS Linux (3.10.0-1160.71.1.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-1160.71.1.el7.x86_64) 7 (Core)'; fi;
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
然后在修改grub
vim /etc/default/grub
#第一项是win10 所以设置为0
GRUB_DEFAULT=0
最后
reboot