How to Add Kernel Parameters in Linux
You can add kernel parameters in linux either temporarily at boot time or permanently by editing your bootloader configuration. The exact method depends on whether your system uses GRUB, systemd-boot, or another bootloader, but the goal is always the same, pass extra options on the kernel command line when Linux starts.
What kernel parameters are
Kernel parameters are options passed to the Linux kernel during startup. They can change how the system boots, how hardware is detected, or how certain features behave. Some parameters are used for troubleshooting, while others are used to enable or disable a specific kernel behavior.
Examples include quiet, splash, nomodeset, and security-related options such as mitigations=off in test environments. A parameter is only active if it appears on the kernel command line for that boot.
Before you change anything
Before editing boot settings, identify two things: your bootloader and whether you want a temporary or permanent change. That decision matters because the steps are different.
- Temporary change, useful for testing or recovery, applies only to the next boot.
- Permanent change, saved in the bootloader configuration, applies after every reboot until you remove it.
If you are unsure which bootloader you use, check your distribution documentation or look for boot menu entries such as GRUB or systemd-boot at startup.
Add kernel parameters temporarily at boot
This is the safest way to test a parameter before making it permanent. If the system fails to boot, the change disappears on the next restart.
Temporary change in GRUB
- Reboot to the GRUB menu.
- Highlight the Linux entry you want to boot.
- Press e to edit the entry.
- Find the line that starts with linux or linuxefi.
- Add your kernel parameters at the end of that line.
- Boot with the edited entry, usually by pressing Ctrl+X or F10.
Example:
linux /vmlinuz-linux root=UUID=... rw quiet nomodesetUse this method when you want to test whether a driver issue, display problem, or boot issue is related to a specific kernel option.
Temporary change with systemd-boot
systemd-boot usually lets you edit the boot entry before startup as well. The exact keys may vary by firmware and distribution, but the idea is the same, edit the entry and add the parameter on the options line for that boot only.
Example of an options line:
options root=UUID=... rw quietIf your boot menu supports editing, add the parameter there, then boot normally. The exact editing keys depend on the menu presented by your system.
Make the change permanent in GRUB
If your system uses GRUB, the most common permanent change is to update the GRUB kernel command line settings and regenerate the configuration file.
1. Edit the GRUB configuration source
On many distributions, the main file is:
/etc/default/grubLook for the line that defines kernel command line options, often called GRUB_CMDLINE_LINUX or GRUB_CMDLINE_LINUX_DEFAULT.
Example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
Add your parameters inside the quotes. For example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
Be careful not to remove existing settings that your system needs.
2. Regenerate the GRUB configuration
After editing the file, rebuild the GRUB config so the change takes effect.
Common commands include:
sudo update-grubor, on some distributions:
sudo grub-mkconfig -o /boot/grub/grub.cfgSome systems place GRUB files in different paths, especially with UEFI setups, so follow your distribution’s documented command if it differs.
Add kernel parameters in systemd-boot
With systemd-boot, kernel parameters are usually stored in a boot entry file rather than a central GRUB-style configuration file. This makes the change straightforward, but the path may differ based on how your system is installed.
1. Find the boot entry file
Common locations include:
/boot/loader/entries//efi/loader/entries/
Look for a file ending in .conf.
2. Edit the options line
Open the relevant entry file and find the options line. Add your kernel parameter to the end of that line.
Example:
title Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=... rw quiet splashSave the file and reboot. The change applies on the next boot.
Make the change permanent safely
If you are not sure whether a parameter is safe, test it temporarily first. Once the system boots correctly, add the same parameter permanently in the bootloader configuration.
A good workflow is:
- Test the parameter once at boot.
- Confirm that the system starts normally.
- Add it to the bootloader config file.
- Reboot and verify the result.
This avoids lockouts caused by a typo or an unsupported option.
Verify the active kernel command line
After rebooting, confirm that the parameter is actually active. The most reliable way is to read the running kernel command line.
cat /proc/cmdlineYou should see the kernel parameters that were used for the current boot. If your new option is missing, the bootloader change was not applied correctly.
You can also check whether the intended behavior changed, but /proc/cmdline is the cleanest confirmation step.
Common kernel parameters and what they do
Here are a few common parameters you may see while learning how to add kernel parameters in linux.
| Parameter | Typical use | Notes |
|---|---|---|
quiet | Reduces boot messages | Useful for cleaner boot output |
splash | Enables a graphical boot splash on some distributions | Only works where supported |
nomodeset | Disables kernel mode setting for graphics | Often used to troubleshoot display driver issues |
single | Boots into a single-user style recovery mode on some systems | Behavior varies by distribution |
systemd.unit=rescue.target | Boots into rescue mode | Useful for recovery and maintenance |
Not every parameter applies to every distribution or hardware setup. Always verify what a parameter does before relying on it.
Troubleshooting and rollback
If a parameter causes boot problems, the fix is usually to remove it from the bootloader configuration or edit the boot entry temporarily and boot without it.
- Wrong or unsupported parameter, remove it and try again.
- Typo in the command line, check for missing spaces or broken quotes.
- Bootloader config not regenerated, rebuild the config after editing.
- System still uses old options, verify the active entry and read
/proc/cmdline.
If the machine does not boot normally, return to the boot menu and edit the entry temporarily. Remove the problematic option, boot once, then fix the permanent configuration from the running system.
On systems that use an initramfs, some hardware or storage changes may also require rebuilding the initramfs after a kernel-related change. That is not needed for every kernel parameter, but it matters in some recovery workflows.
Distro-specific things to watch for
Different Linux distributions store boot settings in different places. The kernel itself behaves the same, but the files you edit may change.
- Ubuntu and Debian, commonly use GRUB by default.
- Fedora, often uses GRUB, though some installations may use other boot methods.
- Arch Linux, may use GRUB, systemd-boot, or another bootloader depending on the install.
- UEFI systems, often use a separate EFI partition, which can change where boot files live.
If your system was installed with a custom layout, verify the bootloader and file paths before editing anything.
Best practices for adding kernel parameters
- Test temporarily before making permanent changes.
- Keep a record of the original boot options.
- Add only one new parameter at a time when troubleshooting.
- Use
/proc/cmdlineto confirm the result after reboot. - Revert unwanted changes quickly if the system becomes unstable.
These habits make it easier to isolate problems and avoid breaking a working boot setup.
Frequently Asked Questions About how to add kernel parameters in linux
How do I permanently add kernel parameters in Linux?
Edit the bootloader configuration, not just the boot menu entry. For GRUB, that usually means updating /etc/default/grub and regenerating the GRUB config. For systemd-boot, edit the relevant entry file under /boot/loader/entries/ or the EFI equivalent.
How do I add kernel parameters temporarily at boot?
Edit the boot entry from the boot menu, add the parameter to the kernel command line, and boot once with the change. This is the safest way to test a new option before saving it permanently.
How do I check which kernel parameters are currently active?
Run cat /proc/cmdline. It shows the exact kernel command line used for the current boot.
What happens if I add the wrong kernel parameter?
The system may ignore it, or it may fail to boot properly if the option is invalid or incompatible. If that happens, remove the parameter from the bootloader config or boot once without it from the boot menu.
Do I need to rebuild initramfs after changing kernel parameters?
Usually no, not for a simple command-line change. Some kernel or driver-related changes may require rebuilding initramfs, but that depends on the specific situation and distribution.
Why do my changes disappear after reboot?
You probably edited a temporary boot entry instead of the permanent bootloader configuration. Save the parameter in the correct config file, then regenerate the bootloader configuration if your distribution requires it.
Conclusion
The safest way to add kernel parameters in linux is to test them temporarily first, then save them permanently only after you confirm they work. GRUB users usually edit the GRUB command line settings and regenerate the config, while systemd-boot users edit the boot entry file directly. After rebooting, verify the result with /proc/cmdline so you know the parameter is really active.
