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
- At the GRUB menu, highlight the entry and press e
- Find the line starting with linux
- Append parameters at the end, for example nomodeset
- Press Ctrl+X or F10 to boot with the change once
- If it works, make it permanent in /etc/default/grub
/etc/default/grub settings
| Setting | Example | Effect |
|---|---|---|
| GRUB_DEFAULT | 0 or saved or "Advanced options>..." | Which entry boots by default |
| GRUB_TIMEOUT | 5 | Seconds to show the menu |
| GRUB_TIMEOUT_STYLE | menu / hidden | Show 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_PROBER | false | Detect Windows/other OSes |
Kernel parameters worth knowing
| Parameter | Use case |
|---|---|
| nomodeset | Black screen with new GPUs: skip kernel mode setting until drivers install |
| systemd.unit=rescue.target | Boot to single-user rescue mode |
| init=/bin/bash | Last-resort shell (root mounted read-only) |
| intel_iommu=on iommu=pt | Enable IOMMU for VFIO/PCI passthrough |
| console=ttyS0,115200 | Kernel output on serial console (VMs, servers) |
| mem=4G / maxcpus=2 | Limit memory or CPUs for testing |
| mitigations=off | Disable CPU vulnerability mitigations (benchmarks only) |
A permanent change end to end
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=DEFAULTBoot 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 rebootCommon 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.