首页 > 系统相关 >Linux基础——修改Bclinux8的内核启动顺序

Linux基础——修改Bclinux8的内核启动顺序

时间:2024-09-25 16:25:11浏览次数:1  
标签:kernel bel -- newosbc8 default 内核 Linux root Bclinux8

一、Grubby的参数

(base) [root@NewOSBC8 ~]# grubby --help
Usage: grubby [OPTION...]
      --add-kernel=kernel-path            add an entry for the specified kernel
      --args=args                         default arguments for the new kernel or new arguments for kernel being updated)
      --bad-image-okay                    don't sanity check images in boot entries (for testing only)
  -c, --config-file=path                  path to grub config file to update ("-" for stdin)
      --copy-default                      use the default boot entry as a template for the new entry being added; if the default is not a linux image, or if the kernel referenced by the default image does not exist, the
                                          first linux entry whose kernel does exist is used as the template
      --default-kernel                    display the path of the default kernel
      --default-index                     display the index of the default kernel
      --default-title                     display the title of the default kernel
      --env=path                          path for environment data
      --grub2                             configure grub2 bootloader
      --info=kernel-path                  display boot information for specified kernel
      --initrd=initrd-path                initrd image for the new kernel
  -i, --extra-initrd=initrd-path          auxiliary initrd image for things other than the new kernel
      --make-default                      make the newly added entry the default boot entry
      --remove-args=STRING                remove kernel arguments
      --remove-kernel=kernel-path         remove all entries for the specified kernel
      --set-default=kernel-path           make the first entry referencing the specified kernel the default
      --set-default-index=entry-index     make the given entry index the default entry
      --title=entry-title                 title to use for the new kernel entry
      --update-kernel=kernel-path         updated information for the specified kernel
      --zipl                              configure zipl bootloader
  -b, --bls-directory                     path to directory containing the BootLoaderSpec fragment files

Help options:
  -?, --help                              Show this help message

二、grubby修改内核启动顺序

1、查看当前所有内核详情

(base) [root@NewOSBC8 ~]# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-4.19.0-240.23.35.el8_2.bclinux.x86_64+debug"
args="ro crashkernel=160M resume=/dev/mapper/bel_newosbc8-swap rd.lvm.lv=bel_newosbc8/root rd.lvm.lv=bel_newosbc8/swap rhgb quiet $tuned_params"
root="/dev/mapper/bel_newosbc8-root"
initrd="/boot/initramfs-4.19.0-240.23.35.el8_2.bclinux.x86_64+debug.img $tuned_initrd"
title="BigCloud Enterprise Linux (4.19.0-240.23.35.el8_2.bclinux.x86_64+debug) 8.2 (Core)"
id="ced6230f6fe049c493cd1845587c3c75-4.19.0-240.23.35.el8_2.bclinux.x86_64+debug"
index=1
kernel="/boot/vmlinuz-4.19.0-240.23.35.el8_2.bclinux.x86_64"
args="ro crashkernel=160M resume=/dev/mapper/bel_newosbc8-swap rd.lvm.lv=bel_newosbc8/root rd.lvm.lv=bel_newosbc8/swap rhgb quiet $tuned_params"
root="/dev/mapper/bel_newosbc8-root"
initrd="/boot/initramfs-4.19.0-240.23.35.el8_2.bclinux.x86_64.img $tuned_initrd"
title="BigCloud Enterprise Linux (4.19.0-240.23.35.el8_2.bclinux.x86_64) 8.2 (Core)"
id="ced6230f6fe049c493cd1845587c3c75-4.19.0-240.23.35.el8_2.bclinux.x86_64"
index=2
kernel="/boot/vmlinuz-4.19.0-240.23.11.el8_2.bclinux.x86_64"
args="ro crashkernel=160M resume=/dev/mapper/bel_newosbc8-swap rd.lvm.lv=bel_newosbc8/root rd.lvm.lv=bel_newosbc8/swap rhgb quiet $tuned_params"
root="/dev/mapper/bel_newosbc8-root"
initrd="/boot/initramfs-4.19.0-240.23.11.el8_2.bclinux.x86_64.img $tuned_initrd"
title="BigCloud Enterprise Linux (4.19.0-240.23.11.el8_2.bclinux.x86_64) 8.2 (Core)"
id="ced6230f6fe049c493cd1845587c3c75-4.19.0-240.23.11.el8_2.bclinux.x86_64"
index=3
kernel="/boot/vmlinuz-0-rescue-ced6230f6fe049c493cd1845587c3c75"
args="ro crashkernel=160M resume=/dev/mapper/bel_newosbc8-swap rd.lvm.lv=bel_newosbc8/root rd.lvm.lv=bel_newosbc8/swap rhgb quiet"
root="/dev/mapper/bel_newosbc8-root"
initrd="/boot/initramfs-0-rescue-ced6230f6fe049c493cd1845587c3c75.img"
title="BigCloud Enterprise Linux (0-rescue-ced6230f6fe049c493cd1845587c3c75) 8.2 (Core)"
id="ced6230f6fe049c493cd1845587c3c75-0-rescue"

2、设置内核启动顺序index值
(base) [root@NewOSBC8 ~]# grubby --set-default-index=1
The default is /boot/loader/entries/ced6230f6fe049c493cd1845587c3c75-4.19.0-240.23.35.el8_2.bclinux.x86_64.conf with index 1 and kernel /boot/vmlinuz-4.19.0-240.23.35.el8_2.bclinux.x86_64

3、查看默认启动内核信息
(base) [root@NewOSBC8 ~]# grubby --default-kernel
/boot/vmlinuz-4.19.0-240.23.35.el8_2.bclinux.x86_64

 

标签:kernel,bel,--,newosbc8,default,内核,Linux,root,Bclinux8
From: https://www.cnblogs.com/gkhost/p/18431579

相关文章

  • linux semaphore信号量操作
    信号量(semaphore)是操作系统中最常见的同步原语之一。spinlock是实现忙等待锁,而信号量则允许进程进入睡眠状态。下面将分析信号量的获取是释放操作。1、数据结构数据结构定义和初始化如下:include/linux/semaphore.h/*Pleasedon'taccessanymembersofthisstruc......
  • Linux常用命令(Mysql)
    --删除表内数据(Mysql)usedc;#切换到待删除表所在的数据库truncatetable[表名]#删除表--数据库导入SQL文件数据(Mysql)sourcea.sql;--SQL增删改查insertintostudent(id,name,sex,birth)values('01','赵雷','男','1990');deletefromstudentwhereid=......
  • Linux安装MQTT 服务器(图文教程)
    MQTT(MessageQueuingTelemetryTransport)是一种轻量级的消息传输协议,专为低带宽和不稳定的网络环境设计,非常适合物联网(IoT)应用。官网地址:https://www.emqx.com/一、版本选择根据自己的操作系统进行下载即可,推荐使用rpm安装方式。下载地址:https://www.emqx.com/zh/downloads-and-i......
  • Linux中MySQL配置主主复制操作
    一、GTIDGTID(GlobalTransactionIdentifier)是MySQL的一种用于标识分布式环境中事务的全局唯一标识符。它在MySQL的主从复制场景中尤为重要,尤其是在使用MariaDB或MySQL5.6及更高版本的环境中。GTID由两部分组成:服务器ID(标识执行该事务的服务器)和事务序号(表示在该服务器上执......
  • 女生学Linux云计算怎么样?
    现如今,生活压力较大,就业找工作也比较难,而为了能够获得满意的工作、稳定的发展,很多小伙伴都想要找一个薪酬高的行业,于是不少人将目光瞄准IT行业。而作为当下热门的技术,Linux云计算成为香饽饽,那么0基础女生转行学Linux云计算难吗?以下是详细的内容介绍。首先,我可以肯定的告诉......
  • linux 切换阿里云镜像源
    目录linux切换阿里云镜像源备份原有文件:创建阿里云CentOS仓库文件:清理缓存并更新软件包列表:测试是否成功:linux切换阿里云镜像源centos7安装好后,发现外网可以ping通,但是yum一直报错,看报错内容为镜像源问题于是切换镜像源备份原有文件:在进行任何更改之前,请确保备份原有的仓......
  • 【越学学糊涂的Linux系统】Linux指令篇(2)
    一、echo指令:✔️✔️在终端中显示文本内容或向文件中写入文本Ⅰ.基本用法:0x00打印字符串:打印字符串/显示文本内容;可以用双引号作为文本内容⬇️⬇️更推荐用单引号这里我将字符串打印出来了。和printf的功能一样;......
  • linux集群 keepalived+nginx实现高可用集群
    用keepalived配置高可用搭建高可用集群高可用集群,即“HA集群”,也常称作“双机热备”,用于关键业务。常见实现高可用的开源软件有heartbeat和keepalived,其中keepalived还有负载均衡的功能。这两个软件类似,核心原理都是通过心跳线连接两台服务器,正常情况下由一台服务器提供服务,......
  • centos(linux):用命令设置用户的shell以及/bin/false和/sbin/nologin的区别
    一,/bin/false和/sbin/nologin作为shell时的区别1,/bin/false/bin/false是一个什么都不做,立即返回非零退出状态的命令。它通常用于禁止用户登录用户不会收到任何错误或提示信息,登录尝试简单地被拒绝,没有任何解释2,/sbin/nologin/sbin/nologin是一个专门设计来阻止用户登录的程......
  • Linux 启动系统的过程中使用rd.break 在断点前进入shell
    参考:https://man7.org/linux/man-pages/man7/dracut.cmdline.7.html使用rd.break={cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}droptoashellbeforethedefinedbreakpointstarts介绍rd.break参数允许您在内核启动过程中......