修改Fedora 25与Windows 10的默认启动顺序

2023-11-16

首先贴出Fedora25下/boot/grub2/grub.cfg的内容:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set pager=1

if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

terminal_output console
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
  source ${prefix}/user.cfg
  if [ -n "${GRUB2_PASSWORD}" ]; then
    set superusers="root"
    export superusers
    password_pbkdf2 root ${GRUB2_PASSWORD}
  fi
fi
### END /etc/grub.d/01_users ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora (4.8.8-300.fc25.x86_64) 25 (Twenty Five)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.8.6-300.fc25.x86_64-advanced-3732e5b3-67be-4efa-a64e-08e51d341084' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos6'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  3732e5b3-67be-4efa-a64e-08e51d341084
    else
      search --no-floppy --fs-uuid --set=root 3732e5b3-67be-4efa-a64e-08e51d341084
    fi
    linux16 /boot/vmlinuz-4.8.8-300.fc25.x86_64 root=UUID=3732e5b3-67be-4efa-a64e-08e51d341084 ro rhgb quiet LANG=zh_CN.UTF-8
    initrd16 /boot/initramfs-4.8.8-300.fc25.x86_64.img
}
menuentry 'Fedora (4.8.6-300.fc25.x86_64) 25 (Twenty Five)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.8.6-300.fc25.x86_64-advanced-3732e5b3-67be-4efa-a64e-08e51d341084' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos6'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  3732e5b3-67be-4efa-a64e-08e51d341084
    else
      search --no-floppy --fs-uuid --set=root 3732e5b3-67be-4efa-a64e-08e51d341084
    fi
    linux16 /boot/vmlinuz-4.8.6-300.fc25.x86_64 root=UUID=3732e5b3-67be-4efa-a64e-08e51d341084 ro rhgb quiet LANG=zh_CN.UTF-8
    initrd16 /boot/initramfs-4.8.6-300.fc25.x86_64.img
}
menuentry 'Fedora (0-rescue-0c394733687b44ac9de7038631d76a55) 25 (Twenty Five)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-0c394733687b44ac9de7038631d76a55-advanced-3732e5b3-67be-4efa-a64e-08e51d341084' {
    load_video
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos6'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  3732e5b3-67be-4efa-a64e-08e51d341084
    else
      search --no-floppy --fs-uuid --set=root 3732e5b3-67be-4efa-a64e-08e51d341084
    fi
    linux16 /boot/vmlinuz-0-rescue-0c394733687b44ac9de7038631d76a55 root=UUID=3732e5b3-67be-4efa-a64e-08e51d341084 ro rhgb quiet
    initrd16 /boot/initramfs-0-rescue-0c394733687b44ac9de7038631d76a55.img
}

### 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 Enterprise (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-10FF15F410FF15F4' {
    insmod part_msdos
    insmod ntfs
    set root='hd1,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  10FF15F410FF15F4
    else
      search --no-floppy --fs-uuid --set=root 10FF15F410FF15F4
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
}

### 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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
显然,其中没有找到传说中的

# boot=/dev/sda
default=0
timeout=5

所以无法通过修改grub.cfg来调整系统的默认启动顺序。不过无意中,发现可以用三条命令解决这个问题,具体代码如下:

# 首先找到windows的menuentry
cat /boot/grub2/grub.cfg | grep windows   
# 然后设置windows作为默认的启动项
grub2-set-default "Windows *** " 
# 用第一步得到的结果执行第2步
# 验证默认的启动项
grub2-editenv list
修改前后使用第三条命令的结果也同样贴出:

saved_entry=Fedora (4.8.8-300.fc25.x86_64) 25 (Twenty Five)
saved_entry=Windows 10 Enterprise (loader) (on /dev/sdb1)
这样就可以在Fedora25中修改了grub启动配置文件,下一次电脑启动时Win10将会出现在第一条,即默认启动系统。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

修改Fedora 25与Windows 10的默认启动顺序 的相关文章

随机推荐

  • Python Matplotlib基本使用

    1 对坐标轴的操作 import matplotlib pyplot as plt plt figure num 1 x np linspace 0 np pi y sin np sin x plt plot x y sin 生成线段图 p
  • 使用Pytorch计算分类模型的混淆矩阵

    第一部分 基础原理 参考链接 1 使用pytorch和tensorflow计算分类模型的混淆矩阵 B站视频讲解 推荐博文 4 4 2分类模型评判指标 一 混淆矩阵 Confusion Matrix 第二部分 代码详解 1 YOLOV5 5
  • 真正的opencv配置,搞了好久。

    opencv VS2010 win7 64位 首先 opencv版本 vs版本 系统多少位都没关系 虽然系统是64位的 但是只要你想编写在32位上也可以跑的程序 那就按这个来就行 1 环境变量 新建环境变量例如opencv 然后在path里
  • python实现将给定列表划分为元素和大致相等的两个子列表

    假设现有列表 300 150 75 38 19 9 5 2 我想把它划分为两个子列表 并要求两个列表的元素和大致相等 应该如何做 这是一个很有意思的问题 我们期待的答案应该是 list1 300 list2 150 75 38 19 9 5
  • 接口测试面试题,等你来看

    1 你们公司的接口测试流程是 接口测试我们是在xx项目做的 主要有xx接口 xx接口等 1 首先是从开发那里拿到API接口文档 了解接口业务 包括接口地址 接口方式 入参 出参 token鉴权 返回格式等信息 2 然后使用postman或j
  • 人工智能---深度学习神经网络神经元的实现

    系列文章目录 人工智能 深度学习从感知机到神经网络 文章目录 系列文章目录 前言 一 神经元的组成 二 激活函数的实现 1 什么是激活函数 2 常见的激活函数 3 激活函数实现 三 神经元实现 1 初始化参数 2 权重设置 3 偏置设置 4
  • servlet和java区别_Java中Applet和Servlet之间的区别是什么

    在Java中 Applet和servlet的主要区别是 applet是在客户端计算机上执行的应用程序 Applet和servlet是小型Java程序或应用程序 但是它们之间存在着许多差异 本篇文章就给大家介绍Applet和servlet的区
  • 中标麒麟QT中qDebug无输出问题解决办法

    一 系统环境 中标麒麟V5 qt creator 4 3 1 qt5 qtbase 5 6 2 二 问题 代码中qDebug 函数无输出 但qInfo 和qWarning 有输出 创建一个test工程 使用qDebug 打印信息 但是没有任
  • 新冠肺炎国内外数据实时API接口

    这个是从丁香园和百度疫情获取的两套疫情数据 使用Springboot封装了一下 对外提供API接口 数据包括 国内疫情数据 全球疫情数据 疫情最新资讯 其中丁香园包含了各种JPG格式的图表 百度包含今日疫情热搜等 百度包含了疫情历史数据 具
  • 3.4 DML

    package com atguigu import org apache hadoop hbase Cell import org apache hadoop hbase CellUtil import org apache hadoop
  • 【python】python获取两个list交集

    获取两个list 的交集 方法一 a 2 3 4 5 b 2 5 8 tmp val for val in a if val in b print tmp 2 5 方法二 比方法一快 print list set a intersectio
  • js实现WebSocket 连接

    一 WebSocket 简单介绍 1 HTTP和WebSocket的区别 http 通信只能由客户端发起 WebSocket 服务器可以主动向客户端推送信息 客户端也可以主动向服务器发送信息 是真正的双向平等对话 属于服务器推送技术的一种
  • 崩坏3渠道服扫码登录桌面版的方法教程

    文章目录 一 渠道服分类 二 扫码登录方法 1 官服或手机有相应渠道服版本 2 B服 vivo oppo UC 小米 3 应用宝 QQ 微信 华为 魅族 三 注意事项及问题解决方法 一 渠道服分类 崩坏3rd 渠道服扫码登录桌面版方法 崩坏
  • 算法:多个无序数组合并排序

    思路1 先单独排序 再合并 注意 sorted函数是又返回值的 不改变原来list 注意 若是多个数组 则可以对其中所有第一个数进行再排序 def sort1 list1 list2 list1 sorted list1 list2 sor
  • 深度网络架构的设计技巧(三)之ConvNeXt:打破Transformer垄断的纯CNN架构

    单位 FAIR DenseNet共同一作 曾获CVPR2017 best paper UC伯克利 ArXiv https arxiv org abs 2201 03545 Github https github com facebookre
  • vue3.0 toRef与toRefs

    toRef与toRefs toRef 代码示例 toRef toRefs toRef 作用 创建一个ref对象 其value值指向另一个对象中的某个属性 语法 const name toRef person name 应用 要将响应式中的某
  • git 使用经验

    常用命令 git stash 暂存当前已修改的文件 git stash pop 释放暂存的文件 git status 查看当前状态 git checkout master 切换到主分支 提交文件相关 git add 增加文件 git rm
  • lammps案例:液体平衡态rdf计算模拟练习

    分享一个2维液态平衡模拟案例代码 随机生成400 0 8个原子并进行温度初始化 原子在LJ力场作用下运动到一定位置后达到平衡 并输出rdf数据 代码已经注释 以供参考 当原子数量超过400 0 9时 体系接近固态 可自行更改参数并结合rdf
  • scrapy_redis配置redis集群

    单节点的redis太容易挂了 总是出现意外情况 借助scrapy redis sentinel库实现scrapy redis对redis集群的使用 按照官方库的说明去修改后启动项目会报错 报错的原因其实是作者的源码包中一个叫queue py
  • 修改Fedora 25与Windows 10的默认启动顺序

    首先贴出Fedora25下 boot grub2 grub cfg的内容 DO NOT EDIT THIS FILE It is automatically generated by grub2 mkconfig using templat