How to Edit GRUB Configuration and Kernel Parameters Safely

Change GRUB timeout, default kernel and kernel boot parameters the right way. Temporary edits at the menu, permanent edits in /etc/default/grub, and grubby.

Published November 27, 2026

Kernel parameters control a surprising amount of system behaviour: which root filesystem to mount, whether to show a splash screen, which CPU mitigations to enable, IOMMU for PCI passthrough, serial consoles, and more. GRUB is where you set them. This guide shows how to try a parameter once without risk, and how to make it permanent.

The concept

There are two ways to change parameters. A temporary edit at the GRUB menu applies to that single boot only. It is the safest way to test something like nomodeset or a different root=. A permanent edit goes in /etc/default/grub (or uses grubby on Red Hat systems) and requires regenerating grub.cfg.

In /etc/default/grub, GRUB_CMDLINE_LINUX applies to every entry including recovery mode, while GRUB_CMDLINE_LINUX_DEFAULT applies only to normal entries. Put functional options (IOMMU, console, cgroup settings) in the former and cosmetic ones (quiet splash) in the latter.

Temporary edit at boot

  1. At the GRUB menu, highlight the entry and press e
  2. Find the line starting with linux
  3. Append parameters at the end, for example nomodeset
  4. Press Ctrl+X or F10 to boot with the change once
  5. If it works, make it permanent in /etc/default/grub
Try first, then persist.

/etc/default/grub settings

SettingExampleEffect
GRUB_DEFAULT0 or saved or "Advanced options>..."Which entry boots by default
GRUB_TIMEOUT5Seconds to show the menu
GRUB_TIMEOUT_STYLEmenu / hiddenShow or hide the menu
GRUB_CMDLINE_LINUX"intel_iommu=on console=ttyS0"Params for all entries
GRUB_CMDLINE_LINUX_DEFAULT"quiet splash"Params for normal entries only
GRUB_DISABLE_OS_PROBERfalseDetect Windows/other OSes

Kernel parameters worth knowing

ParameterUse case
nomodesetBlack screen with new GPUs: skip kernel mode setting until drivers install
systemd.unit=rescue.targetBoot to single-user rescue mode
init=/bin/bashLast-resort shell (root mounted read-only)
intel_iommu=on iommu=ptEnable IOMMU for VFIO/PCI passthrough
console=ttyS0,115200Kernel output on serial console (VMs, servers)
mem=4G / maxcpus=2Limit memory or CPUs for testing
mitigations=offDisable CPU vulnerability mitigations (benchmarks only)

A permanent change end to end

sudo sed -i 's/^GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="\1 intel_iommu=on iommu=pt"/' /etc/default/grub
grep ^GRUB_CMDLINE_LINUX= /etc/default/grub
GRUB_CMDLINE_LINUX=" intel_iommu=on iommu=pt"
sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.0-49-generic
done
sudo reboot
cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-6.8.0-49-generic root=UUID=3f1c... ro intel_iommu=on iommu=pt quiet splash
Permanent change, regenerate, reboot, verify.

Practical examples

RHEL/Fedora: use grubby

grubby edits BootLoaderSpec entries directly, no regeneration needed.

sudo grubby --update-kernel=ALL --args="intel_iommu=on iommu=pt"
sudo grubby --update-kernel=ALL --remove-args="rhgb quiet"
sudo grubby --info=DEFAULT

Boot an older kernel by default

Use the saved mechanism and pick an entry by title.

# /etc/default/grub
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=false
# then
sudo update-grub
sudo grub-set-default "Advanced options for Ubuntu>Ubuntu, with Linux 6.8.0-45-generic"

Boot into the next kernel only once

Useful for testing on remote machines: if it fails, a reboot returns to the old default.

sudo grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 6.11.0-9-generic"
sudo reboot

Common mistakes

  • Forgetting to run update-grub after editing /etc/default/grub.
  • Breaking the quotes in GRUB_CMDLINE_LINUX so the whole file fails to parse.
  • Testing risky parameters permanently on a remote server with no console access. Use grub-reboot or a temporary edit.
  • Adding mitigations=off to production machines for a small speed boost.

Key takeaways

  • Press e at the GRUB menu for one-time, risk-free parameter tests.
  • Persistent changes go in /etc/default/grub, followed by update-grub or grub2-mkconfig.
  • Use GRUB_CMDLINE_LINUX for functional options and _DEFAULT for cosmetic ones.
  • Verify with cat /proc/cmdline after reboot.

FAQ

How do I see current kernel parameters?

cat /proc/cmdline shows exactly what the running kernel was booted with.

Where are module parameters set on the kernel command line?

Use module.param=value, for example kvm_intel.nested=1. It works for both built-in and loadable modules.

Can I password-protect GRUB?

Yes. Generate a hash with grub-mkpasswd-pbkdf2 and add set superusers and password_pbkdf2 lines in /etc/grub.d/40_custom, which stops people editing entries at boot.

More Linux articles