grub2-set-default

grub2-set-default

设置系统默认的启动内核

语法

Usage: grub2-set-default [OPTION] MENU_ENTRY
Set the default boot menu entry for GRUB.
This requires setting GRUB_DEFAULT=saved in /etc/default/grub.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  --boot-directory=DIR    expect GRUB images under the directory DIR/grub2
                          instead of the /boot/grub2 directory

MENU_ENTRY is a number, a menu item title or a menu item identifier.

Report bugs to <bug-grub@gnu.org>.

实例

查看可选的系统内核:

# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (5.4.219-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-1160.76.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-3221d376917c458992a952d6327f2d6a) 7 (Core)

grub2-set-default后面的序号从0开始。所以,如果想设置第一个选项为默认启动内核,则可以使用下面的命令:

# grub2-set-default 0

如果想使用CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)内核版本,则可以将0改为2

重启系统

~]# init 6

若文章对你有帮助,可以点赞或打赏支持我们。发布者:Aurora,转载请注明出处:http://61.174.243.28:13541/AY-knowledg-hub/grub2-set-default/

(0)
AuroraAurora站点维系者
上一篇 2023年 12月 14日 下午6:54
下一篇 2023年 12月 14日 下午6:54

相关推荐

  • Helm 依赖

    管理chart依赖 文章目录简介可选项从父命令继承的命令请参阅 简介 管理chart依赖 Helm chart将依赖存储在’charts/’。对于chart…

    入门教程 2023年 12月 14日
  • top

    文章目录top补充说明语法选项top交互命令实例 top 显示或管理执行中的程序 补充说明 top命令 可以实时动态地查看系统的整体运行情况,是一个综合了多方信息监测系统性能和运行…

    入门教程 2024年 3月 11日
  • HTTP content-type

    Content-Type(内容类型),一般是指网页中存在的 Content-Type,用于定义网络文件的类型和网页的编码,决定浏览器将以什么形式、什么编码读取这个文件,这就是经常看…

    2023年 5月 14日
  • compress

    文章目录compress补充说明语法选项参数实例 compress 使用Lempress-Ziv编码压缩数据文件 补充说明 compress命令 使用“Lempress-Ziv”编…

    入门教程 2023年 12月 7日
  • quota

    文章目录quota补充说明语法选项参数实例 quota 显示磁盘已使用的空间与限制 补充说明 quota命令 用于显示用户或者工作组的磁盘配额信息。输出信息包括磁盘使用和配额限制。…

    入门教程 2024年 3月 1日
  • Warning: The resulting partition is not properly aligned for best performance

    在使用parted创建分区时产生告警信息, “Warning: The resulting partition is not properly aligned for …

    入门教程 2023年 7月 11日
  • poweroff

    文章目录poweroff补充说明语法选项例子 poweroff 关闭Linux系统,关闭记录会被写入到/var/log/wtmp日志文件中 补充说明 grename命令 可以重命名…

    入门教程 2024年 3月 1日
  • HTML 表格

    表格由 <table> 标签来定义。每个表格均有若干行(由 <tr> 标签定义),每行被分割为若干单元格(由 <td> 标签定义)。字母 td …

    2023年 4月 13日
  • logout

    文章目录logout补充说明语法 logout 退出当前登录的Shell 补充说明 logout命令 用于退出当前登录的Shell,logout指令让用户退出系统,其功能和logi…

    入门教程 2023年 12月 19日
  • dpkg-reconfigure

    文章目录dpkg-reconfigure补充说明语法选项参数实例 dpkg-reconfigure Debian Linux中重新配制一个已经安装的软件包 补充说明 dpkg-re…

    入门教程 2023年 12月 7日

发表回复

登录后才能评论
Translate »