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
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
noapicparameter 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/grubfile.Overwrite BLS snippets with the contents of the
GRUB_CMDLINE_LINUXvalues present in the/etc/default/grubfile:# 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_TIMEOUTkey (also included in the/etc/default/grubGRUB configuration file) are propagated to the newgrub.cfgfile by executinggrub2-mkconfigcommand.
Verification
- Reboot your system.
Verify that the parameters are included in the
/proc/cmdlinefile.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