zoukankan      html  css  js  c++  java
  • CentOS 8.x 和 RHEL 8.x 更改默认启动项

    安装 grubby

    [root@aikaiyuan ~]# dnf install grubby

    一般默认都以安装

    查看默认启动项

    [root@aikaiyuan ~]# grubby --default-kernel
    /boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64

    查看所有内核

    [root@aikaiyuan ~]# grubby --info=ALL
    index=0
    kernel="/boot/vmlinuz-4.18.0-80.11.2.el8_0.x86_64"
    args="ro crashkernel=auto resume=UUID=b9b14ba1-0b5c-49ac-842f-f11fa2081cfd console=ttyS0 tuned_params"
    root="UUID=3db5c437-b4f7-46cf-a20e-0345459003f3"
    initrd="/boot/initramfs-4.18.0-80.11.2.el8_0.x86_64.imgtuned_initrd"
    title="CentOS Linux (4.18.0-80.11.2.el8_0.x86_64) 8 (Core)"
    id="f56bd0e5ce8b45e594c3fb6d1753d61d-4.18.0-80.11.2.el8_0.x86_64"
    index=1
    kernel="/boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64"
    args="ro crashkernel=auto resume=UUID=b9b14ba1-0b5c-49ac-842f-f11fa2081cfd console=ttyS0 tuned_params"
    root="UUID=3db5c437-b4f7-46cf-a20e-0345459003f3"
    initrd="/boot/initramfs-4.18.0-80.7.1.el8_0.x86_64.imgtuned_initrd"
    title="CentOS Linux (4.18.0-80.7.1.el8_0.x86_64) 8 (Core)"
    id="f56bd0e5ce8b45e594c3fb6d1753d61d-4.18.0-80.7.1.el8_0.x86_64"
    index=2
    kernel="/boot/vmlinuz-4.18.0-80.el8.x86_64"
    args="ro crashkernel=auto resume=UUID=b9b14ba1-0b5c-49ac-842f-f11fa2081cfd console=ttyS0 tuned_params"
    root="UUID=3db5c437-b4f7-46cf-a20e-0345459003f3"
    initrd="/boot/initramfs-4.18.0-80.el8.x86_64.imgtuned_initrd"
    title="CentOS Linux (4.18.0-80.el8.x86_64) 8 (Core)"
    id="f56bd0e5ce8b45e594c3fb6d1753d61d-4.18.0-80.el8.x86_64"
    index=3
    kernel="/boot/vmlinuz-0-rescue-f56bd0e5ce8b45e594c3fb6d1753d61d"
    args="ro crashkernel=auto resume=UUID=b9b14ba1-0b5c-49ac-842f-f11fa2081cfd console=ttyS0"
    root="UUID=3db5c437-b4f7-46cf-a20e-0345459003f3"
    initrd="/boot/initramfs-0-rescue-f56bd0e5ce8b45e594c3fb6d1753d61d.img"
    title="CentOS Linux (0-rescue-f56bd0e5ce8b45e594c3fb6d1753d61d) 8 (Core)"
    id="f56bd0e5ce8b45e594c3fb6d1753d61d-0-rescue"

    查看指定内核启动项

    [root@aikaiyuan ~]# grubby --info=/boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64
    index=1
    kernel="/boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64"
    args="ro crashkernel=auto resume=UUID=b9b14ba1-0b5c-49ac-842f-f11fa2081cfd console=ttyS0 tuned_params"
    root="UUID=3db5c437-b4f7-46cf-a20e-0345459003f3"
    initrd="/boot/initramfs-4.18.0-80.7.1.el8_0.x86_64.imgtuned_initrd"
    title="CentOS Linux (4.18.0-80.7.1.el8_0.x86_64) 8 (Core)"
    id="f56bd0e5ce8b45e594c3fb6d1753d61d-4.18.0-80.7.1.el8_0.x86_64"

    修改默认启动

    [root@aikaiyuan ~]# grubby --set-default /boot/vmlinuz-4.18.0-80.11.2.el8_0.x86_64
    The default is /boot/loader/entries/f56bd0e5ce8b45e594c3fb6d1753d61d-4.18.0-80.11.2.el8_0.x86_64.conf with index 0 and kernel /boot/vmlinuz-4.18.0-80.11.2.el8_0.x86_64
    [root@aikaiyuan ~]# grubby --default-kernel
    /boot/vmlinuz-4.18.0-80.11.2.el8_0.x86_64

    修改内核启动项参数

    [root@aikaiyuan ~]# grubby --update-kernel=/boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64 --args=console=ttyS0,115200
    
    [root@aikaiyuan ~]# grubby --info=/boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64
    index=1
    kernel="/boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64"
    args="ro crashkernel=auto resume=UUID=b9b14ba1-0b5c-49ac-842f-f11fa2081cfd tuned_params console=ttyS0,115200"
    root="UUID=3db5c437-b4f7-46cf-a20e-0345459003f3"
    initrd="/boot/initramfs-4.18.0-80.7.1.el8_0.x86_64.imgtuned_initrd"
    title="CentOS Linux (4.18.0-80.7.1.el8_0.x86_64) 8 (Core)"
    id="f56bd0e5ce8b45e594c3fb6d1753d61d-4.18.0-80.7.1.el8_0.x86_64"

    –update-kernel=/boot/vmlinuz-4.18.0-80.7.1.el8_0.x86_64
    –update-kernel=ALL 也可以更新 所有内核
    console=ttyS0,115200

  • 相关阅读:
    组合数取模 Lucas定理
    关于上下界的二分查找
    POJ 1091 跳蚤
    Eular 函数模板
    POJ 数学(3)
    SRM 567 div2
    SRM 570 div2
    最大最小搜索,alpha beta 剪枝
    JavaScript:prototype属性使用方法
    ArcGIS网络分析之Silverlight客户端服务区分析(五)
  • 原文地址:https://www.cnblogs.com/xwhgr/p/13958719.html
Copyright © 2011-2022 走看看