zoukankan      html  css  js  c++  java
  • grub2 设置Windows为默认启动系统

    1. 首先找到Windows的菜单menuentry.
    <blockquote># cat /boot/grub2/grub.cfg | grep Windows

    结果: menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os {</blockquote>
    2. 设置Windows 作为默认的启动项(这儿只能使用上面命令输出中双引号 " " 或 者单引号 '' 中的内容)。
    <blockquote># grub2-set-default 'Windows 7 (loader) (on /dev/sda1)'
    这里最好是复制上面输出的内容,连同单引号一起复制,不然可能不成功哦~~</blockquote>
    (3). 验证默认启动项
    <blockquote># grub2-editenv list
    输出:saved_entry=Windows 7 (loader) (on /dev/sda1)</blockquote>
    4.写入配置文件中
    <blockquote>grub2-mkconfig -o /boot/grub2/grub.cfg</blockquote>
    &nbsp;
    <blockquote>[sbso@localhost ~]$ cat /boot/grub2/grub.cfg | grep Windows
    menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-9278835A78833C4B' {

    [sbso@localhost ~]$ sudo grub2-set-default "Windows 7 (loader) (on /dev/sda1)"
    [sbso@localhost ~]$ grub2-editenv list
    saved_entry=Windows 7 (loader) (on /dev/sda1)
    [sbso@localhost ~]$
    [sbso@localhost ~]$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-4.1.6-201.fc22.x86_64
    Found initrd image: /boot/initramfs-4.1.6-201.fc22.x86_64.img
    Found linux image: /boot/vmlinuz-4.0.4-301.fc22.x86_64
    Found initrd image: /boot/initramfs-4.0.4-301.fc22.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-75741f182de6460990f27c895f165f1f
    Found initrd image: /boot/initramfs-0-rescue-75741f182de6460990f27c895f165f1f.img
    Found Windows 7 (loader) on /dev/sda1
    done
    [sbso@localhost ~]$</blockquote>
    &nbsp;

    PS: 如果不成功,可以手动修改 /etc/default/grub 文件,将里面的DEFAULT=0 OR DEFAULT=saved;改为DEFAULT=3 我的windows是3,就可以。

  • 相关阅读:
    【转】IOS开发:[1]Xcode5界面入门
    【转】Xcode中的iOS模拟器(iOS Simulator)的介绍和使用心得
    特征选择
    EM算法
    算法之美--3.2.3 KMP算法
    算法之美--3.2.2 MP算法
    图像质量评价方法PSNR+SSIM&&评估指标SROCC,PLCC
    C/C++二进制读写png文件
    大津法---OTSU算法
    一些优秀的面试笔试总结
  • 原文地址:https://www.cnblogs.com/liweilijie/p/4984592.html
Copyright © 2011-2022 走看看