BootPrompt HOWTO: Linux kernel command-line parameters
The kernel command line is a single line of text that the boot loader passes to the Linux kernel. It names the root file system and can switch drivers, logging, the graphics mode and the systemd target. You can see the current line in /proc/cmdline, change it for one boot from the GRUB or systemd-boot menu, and make changes permanent with update-grub, grubby or /etc/kernel/cmdline, depending on your distribution.
The 2001 BootPrompt HOWTO listed parameters for ISA sound cards and LILO's boot: prompt. LILO is gone (see the LILO mini-HOWTO), and the full, current list of parameters lives in the kernel's own documentation. This page covers how to set them and the ones that matter in practice.
How the kernel reads the line
$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-6.12.…-amd64 root=UUID=3f1c…e9 ro quiet
- Parameters are separated by spaces. Use double quotes to protect a space inside a value:
param="spaces in here". Dashes and underscores in names are the same thing. name.param=valuesets a parameter of a module, for exampleusbcore.autosuspend=-1. This works for built-in drivers and for modules loaded later, becausemodprobealso reads/proc/cmdline.modinfo -p modulelists a module's parameters.- Anything the kernel does not recognize, and that has no dot, goes to the init program (systemd):
name=valuewords become environment variables, other words become arguments. Everything after--also goes to init. - The initramfs tools (dracut on Fedora/RHEL, initramfs-tools on Debian/Ubuntu) read the line too. That is where
rd.*options come from.
Change it for one boot
This is the safe way to test a parameter. Nothing is saved, so a bad value disappears on the next reboot.
GRUB
- Show the menu. If it is hidden, hold Shift or press Esc (or F4) while the machine starts.
- Highlight the entry and press e.
- Find the line that starts with
linuxand add or change parameters at its end. - Press Ctrl+x to boot. Esc discards the edit.
systemd-boot
Highlight the entry, press e, edit the line, and press Enter to boot it. Esc cancels. If the menu is not shown (timeout 0), hold down Space before the boot loader starts, or press it repeatedly during boot, or run systemctl reboot --boot-loader-menu=30 to show it for 30 seconds on the next boot. The editor uses a US keyboard layout unless the firmware is set otherwise.
Make it permanent
| System | Edit | Then run |
|---|---|---|
| Debian 13, Ubuntu 24.04/26.04 (GRUB) | GRUB_CMDLINE_LINUX in /etc/default/grub | sudo update-grub |
| Fedora, RHEL/Alma/Rocky 9–10 (GRUB + BLS) | grubby --update-kernel=ALL --args=… | nothing more |
| Arch Linux with GRUB | /etc/default/grub | sudo grub-mkconfig -o /boot/grub/grub.cfg |
| Any system with systemd-boot | /etc/kernel/cmdline (and existing entry files) | reinstall the kernel or edit options in the entry |
Debian and Ubuntu
Two variables matter. GRUB_CMDLINE_LINUX is added to every Linux entry, including recovery mode. GRUB_CMDLINE_LINUX_DEFAULT is added only to the normal entries, after the values from GRUB_CMDLINE_LINUX. Debugging or display options usually belong in the second; anything the system needs to boot at all belongs in the first.
sudo nano /etc/default/grub
# GRUB_CMDLINE_LINUX_DEFAULT="quiet"
# GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200"
sudo update-grub
update-grub is a short wrapper for grub-mkconfig -o /boot/grub/grub.cfg. Never edit grub.cfg itself: the next kernel update regenerates it and your change is lost.
Fedora, RHEL, AlmaLinux and Rocky Linux
These distributions keep one small file per kernel in /boot/loader/entries/ (the Boot Loader Specification, BLS), each with its own options line. grubby edits them:
sudo grubby --update-kernel=ALL --args="console=ttyS0,115200"
sudo grubby --update-kernel=ALL --remove-args="quiet"
sudo grubby --update-kernel=/boot/vmlinuz-$(uname -r) --args="nosmt" # one kernel only
sudo grubby --info=ALL | grep -E '^(kernel|args)'
New kernels copy the arguments of the current default kernel, so changes made with --update-kernel=ALL carry over. If you prefer /etc/default/grub, edit GRUB_CMDLINE_LINUX and run sudo grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline; without --update-bls-cmdline, existing entries keep their old options. The same path is correct on BIOS and UEFI systems.
systemd-boot
Each entry is a text file on the EFI system partition (or the XBOOTLDR partition), such as /boot/loader/entries/…conf, with an options line holding the command line. When a kernel is installed, kernel-install takes the command line from /etc/kernel/cmdline (falling back to /usr/lib/kernel/cmdline, then the running kernel's /proc/cmdline). So put your permanent line in /etc/kernel/cmdline for future kernels, and edit the options line of existing entries by hand. Run bootctl list to see the entries and their file paths.
Parameters you will actually use
| Parameter | What it does | Use it when |
|---|---|---|
quiet | Hides most kernel and systemd messages | Remove it to see where boot hangs |
loglevel=7 | Prints all kernel messages up to debug level to the console | Debugging driver problems |
nomodeset | Stops graphics drivers from changing the display mode; only the firmware framebuffer is used | Black screen after the boot loader; then install the right driver and remove it |
console=ttyS0,115200 | Sends console output to the first serial port at 115200 baud (add console=tty0 to keep the screen too) | Servers, VMs, headless boards |
systemd.unit=rescue.target (or rescue, single, 1) | Single-user rescue mode: file systems mounted, almost no services | Repairs that need a mostly working system |
systemd.unit=emergency.target (or emergency) | Most minimal shell: no other services or mounts | A broken /etc/fstab or unit stops normal boot |
3 / 5 | Same as multi-user.target / graphical.target | Boot to a text console once without the desktop |
systemd.debug_shell | Starts a root shell on tty9 early in boot | Debugging hangs (never leave it on) |
rd.break | dracut stops at the end of the initramfs, before switching to the real root | Fedora/RHEL recovery (see below) |
init=/bin/bash | Runs a shell instead of systemd as process 1 | Last-resort recovery on Debian/Ubuntu |
ro / rw | Mount the root file system read-only / read-write at first | Distributions set this; leave it |
rootwait, rootdelay=10 | Wait for the root device (USB, MMC) to appear | Booting from slow or USB storage without an initramfs |
module_blacklist=nouveau | Never loads the named modules (comma-separated) | A driver crashes or conflicts at boot |
panic=10 | Reboots 10 seconds after a kernel panic | Unattended servers |
nosmt | Turns off simultaneous multithreading (Hyper-Threading) | Security policy or testing |
mitigations=off | Turns off CPU vulnerability mitigations | Only isolated benchmark machines; it removes security protections |
For the full list, see the kernel's kernel-parameters page. For screen resolution parameters (video=), see the Framebuffer HOWTO; for serial consoles, the Text-Terminal HOWTO.
Recovering a lost root password
On Fedora and RHEL-family systems, add rd.break to the linux line for one boot. You get a shell inside the initramfs, with the real root mounted read-only at /sysroot:
mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel # SELinux must relabel the changed password file
exit
exit
The relabel makes the next boot slower. If you skip it on an SELinux system, you may not be able to log in at all. On Debian and Ubuntu, add init=/bin/bash instead, then run mount -o remount,rw /, passwd, sync, and reboot -f. If the disk is encrypted, you still need its passphrase to get this far. Anyone with physical access can do this, which is why boot menus on shared machines should have a GRUB password and disks should be encrypted.
Check that it worked
cat /proc/cmdline # after rebooting
sudo grubby --info=DEFAULT # Fedora/RHEL: what the next boot will use
grep -A1 "^menuentry" /boot/grub/grub.cfg | head # Debian/Ubuntu: generated entries
cat /sys/module/usbcore/parameters/autosuspend # value a module actually uses
Mistakes to avoid
- Test with a one-time edit first. A permanent typo in
root=leaves every entry unbootable; keep a rescue USB (see the Bootdisk HOWTO). - Do not leave
nomodeseton after the problem is fixed. It keeps the graphics driver from loading, so you get no accelerated rendering and no display-mode changes. - Forgetting
update-grub(Debian/Ubuntu) or--update-bls-cmdline(Fedora/RHEL) after editing/etc/default/grubmeans nothing changes. - Put module options you want permanently in
/etc/modprobe.d/*.confinstead, unless the module is built in or loads from the initramfs before that file is read.
The classic BootPrompt HOWTO is kept by the LDP at tldp.org.
Sources
- The kernel's command-line parameters, kernel.org and kernel-parameters.txt
- kernel-command-line(7), systemd(1) and systemd-debug-generator(8), man7.org
- systemd.special(7) and systemctl(1), man7.org
- dracut.cmdline(7), man7.org
- GNU GRUB 2.14 release (manual source docs/grub.texi), ftp.gnu.org
- update-grub(8), Debian
- Managing, monitoring, and updating the kernel: configuring kernel command-line parameters (RHEL 10), Red Hat
- grubby(8), rhboot/grubby
- systemd-boot(7), bootctl(1) and kernel-install(8), man7.org
- Boot Loader Specification, UAPI Group