Changing Kernel Command Line Boot Parameters

Sometimes you might need to edit the GRUB 2 configuration to specify particular kernel boot parameters on the kernel command line. Setting parameters in the GRUB 2 configuration means that the parameters are used for the affected kernels at every boot.

You can update the GRUB 2 boot configuration for a specific kernel, or across all kernels that are installed on the system by doing the following:

  1. Use the grubby --update-kernel command to update a kernel entry with --args to add new arguments or to change existing argument values, or --remove-args to remove existing arguments.

    Multiple arguments can be specified for each option in a quoted space-separated list. You can add and remove arguments in the same operation. When using the --args option, if an argument already exists the new value replaces the old values.

    To update a specific kernel, run the grubby --update-kernel command with the full path to the kernel that you want to update. To update all kernel entries to use a specific kernel boot argument, you can use grubby --update-kernel=ALL.

    For example, you can update all kernel entries to change the loglevel and LANG arguments:

    sudo grubby --update-kernel=ALL --args"loglevel=3,LANG=en_GB.UTF-8"

    See Kernel Boot Parameter Reference for more information about kernel parameters.

  2. Verify that the changes have taken effect and that the command line arguments are correct for the kernel that you updated.

    For example, if you have made a change to all kernels, use the grubby --info ALL command to check that the change is implemented across all kernels:

    sudo grubby --info ALL