4.7. Changing boot entries with the GRUB configuration file


The /etc/default/grub GRUB configuration file contains the GRUB_CMDLINE_LINUX key, which lists kernel command-line arguments to add to boot entries for the Linux kernel. For example:

GRUB_CMDLINE_LINUX="crashkernel=2G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap"

To change the boot entries, overwrite Boot Loader Specification (BLS) snippets with the contents of the GRUB_CMDLINE_LINUX values.

Prerequisites

  • A fresh Red Hat Enterprise Linux 10 installation.

Procedure

  1. Add or remove a kernel parameter for individual kernels in a post installation script with grubby:

    # grubby --update-kernel <PATH_TO_KERNEL> --args "<NEW_ARGUMENTS>"

    For example, add the noapic parameter to the chosen kernel:

    # grubby --update-kernel /boot/vmlinuz-6.12.0-0.el10_0.x86_64 --args "noapic"

    The parameter is propagated into the BLS snippets, but not into the /etc/default/grub file.

  2. Overwrite BLS snippets with the contents of the GRUB_CMDLINE_LINUX values present in the /etc/default/grub file:

    # grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline
    Generating grub configuration file …​
    Adding boot menu entry for UEFI Firmware Settings …​
    done
    注意

    Other changes, such as changes made to GRUB_TIMEOUT key (also included in the /etc/default/grub GRUB configuration file) are propagated to the new grub.cfg file by executing grub2-mkconfig command.

Verification

  1. Reboot your system.
  2. Verify that the parameters are included in the /proc/cmdline file.

    For example, if you added the noapic:

    BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.12.0-0.el10_0.x86_64 root=/dev/mapper/RHELCSB-Root ro vconsole.keymap=us crashkernel=2G-64G:256M,64G-:512M rd.lvm.lv=RHELCSB/Root rd.luks.uuid=luks-d8a28c4c-96aa-4319-be26-96896272151d rhgb quiet noapic rd.luks.key=d8a28c4c-96aa-4319-be26-96896272151d=/keyfile:UUID=c47d962e-4be8-41d6-8216-8cf7a0d3b911 ipv6.disable=1
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部