Skip to content

How to Change the Kernel Command Line Permanently (grubby and GRUB)

Updated 2 min read

Updated: 28 September 2026 · Applies to: grubby 8.40 on AlmaLinux and Rocky Linux 9 and 10 and RHEL 9 and 10; GRUB on Ubuntu 24.04 and 26.04 and Debian 13

The kernel command line holds boot options such as crashkernel=, console=, transparent_hugepage= or ipv6.disable=1. This guide changes it permanently, for the current kernel and for kernels installed later. For a one-time change from the boot menu, see how to change GRUB kernel parameters before booting. On CentOS 7 and older releases the method was to edit /etc/default/grub and rebuild grub.cfg; on AlmaLinux, Rocky Linux and RHEL 9 and 10 the tool is grubby.

See the current command line

cat /proc/cmdline                  # what the running kernel was started with
grubby --info=DEFAULT              # what the default boot entry will use next time

AlmaLinux, Rocky Linux and RHEL 9 and 10

  1. Add a parameter to every boot entry:
    grubby --update-kernel=ALL --args="consoleblank=0"
  2. Remove one:
    grubby --update-kernel=ALL --remove-args="rhgb quiet"
  3. Change only the default kernel instead of all of them: use --update-kernel=DEFAULT.
  4. Check the result, then reboot:
    grubby --info=ALL | grep -E '^(title|args)'
    reboot

Kernels installed later take over the parameters of the current default kernel. If you also regenerate grub.cfg with grub2-mkconfig for other reasons, keep GRUB_CMDLINE_LINUX in /etc/default/grub in line with your changes.

Ubuntu and Debian

  1. Edit /etc/default/grub. Put parameters for normal boots in GRUB_CMDLINE_LINUX_DEFAULT, and parameters for every boot, including recovery mode, in GRUB_CMDLINE_LINUX:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=0"
  2. Rebuild the boot menu and reboot:
    update-grub
    reboot

Check after the reboot

cat /proc/cmdline

Common problems

  • A parameter was added twice: grubby replaces an existing name=value rather than adding a second one; check with grubby --info=ALL.
  • The server does not boot with the new option: choose an older entry in the GRUB menu, or remove the option for one boot as described in the linked guide above, then undo it with --remove-args.
  • Cloud or VPS images with their own settings files: some add files in /etc/default/grub.d/ that override /etc/default/grub on Ubuntu. Check that folder too.

Official documentation: Configuring kernel command-line parameters (Red Hat) and GNU GRUB manual.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket