zoukankan      html  css  js  c++  java
  • windows-linux(centos7)双系统-引导修复

    这是我安装的centos版本 :CentOS-7-x86_64-DVD-1908.iso。

    安装完双系统后发现开机引导界面只有linux项,我们需要在linux的引导菜单中加入windows的引导。

    如果要修改引导顺序请参考:https://www.cnblogs.com/dch0/p/11818760.html

    添加windows引导方法一(推荐)

    1.root身份编辑40_custom

    vi /etc/grub.d/40_custom
    #执行结果如下,在最后一行添加windows引导:
    #!/bin/sh exec tail -n +3 $0 # 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 # the 'exec tail' line above. menuentry 'Windows 10'{ set root=(hd0,1) chainloader +1 }

    hd0表示硬盘,1表示c盘,
    我的windows安装在硬盘的第一个分区,所以此处是 set root=(hd0,1),根据实际情况修改

    2.生成gurb.cfg文件

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

    然后reboot重启,就可以看到windows的引导项了。

    添加windows引导方法二

    1.编辑grub.cfg

    vi /boot/grub2/grub.cfg

    打开后,定位到这段,

    ### BEGIN /etc/grub.d/40_custom ###
    # 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
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###

    在 ### END /etc/grub.d/40_custom ### 前一行插入

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

    保存重启即可。

  • 相关阅读:
    影响Java EE性能的十大问题
    Android APK加壳技术方案【2】
    动态实时跟踪你的java程序
    ASP.NET MVC载入页面常用方法
    JavaWeb禁用浏览器缓存
    JavaWebresponse两个流
    nslookup命令用法
    GDAL交流 QQ群
    事件(二)——Jquery事件模型
    浅谈meta标签
  • 原文地址:https://www.cnblogs.com/dch0/p/11818576.html
Copyright © 2011-2022 走看看