一、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