[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Kernel parameters - ArchWiki

There are three ways to pass options to the kernel and thus control its behaviour:

  1. When building the kernel. See Kernel Compilation for details.
  2. When starting the kernel (usually, when invoked from a boot loader).
  3. At runtime (through the files in /proc and /sys). See sysctl for details.

This page explains in more detail the second method and shows a list of the most used kernel parameters in Arch Linux.

Not all parameters are always available. Most are associated with subsystems and work only if the kernel is configured with those subsystems built in. They also depend on the presence of the hardware they are associated with.

Parameters either have the format parameter or parameter=value.

Note: All kernel parameters are case-sensitive. Most of them are lower case, writing those in upper case does not work.

Configuration

Note:

Kernel parameters can be set either temporarily by editing the boot menu when it shows up, or by modifying the boot loader's configuration file.

The following examples add the quiet and splash parameters to Syslinux, systemd-boot, GRUB, GRUB Legacy, LILO, and rEFInd.

Syslinux

linux /boot/vmlinuz-linux root=/dev/sda3 initrd=/boot/initramfs-linux.img quiet splash
Press Enter to boot with these parameters.
APPEND root=/dev/sda3 quiet splash

For more information on configuring Syslinux, see the Syslinux article.

systemd-boot

initrd=\initramfs-linux.img root=/dev/sda2 quiet splash
Press Enter to boot with these parameters.

Note: If you have not set a value for menu timeout, you will need to hold Space while booting for the systemd-boot menu to appear.

options root=/dev/sda2 quiet splash

For more information on configuring systemd-boot, see the systemd-boot article.

GRUB

linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff quiet splash
Press Ctrl+x to boot with these parameters.
Edit /etc/default/grub and append your kernel options to the GRUB_CMDLINE_LINUX_DEFAULT line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
And then automatically re-generate the grub.cfg file with:
# grub-mkconfig -o /boot/grub/grub.cfg

For more information on configuring GRUB, see the GRUB article.

GRUB Legacy

kernel /boot/vmlinuz-linux root=/dev/sda3 quiet splash
Press b to boot with these parameters.

For more information on configuring GRUB Legacy, see the GRUB Legacy article.

LILO

image=/boot/vmlinuz-linux
        ...
        quiet splash

For more information on configuring LILO, see the LILO article.

rEFInd

"Boot using default options"   "root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff rw quiet splash"
menuentry "Arch Linux" {
	...
	options  "root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff rw quiet splash"
	...
}

For more information on configuring rEFInd, see the rEFInd article.

EFISTUB

See EFISTUB#Using UEFI directly.

Hijacking cmdline

Even without access to your bootloader it is possible to change your kernel parameters to enable debugging (if you have root access). This can be accomplished by overwriting /proc/cmdline which stores the kernel parameters. However /proc/cmdline is not writable even as root, so this hack is accomplished by using a bind mount to mask the path.

First create a file containing the desired kernel parameters

/root/cmdline
root=/dev/disk/by-label/ROOT ro console=tty1 logo.nologo debug

Then use a bind mount to overwrite the parameters

# mount -n --bind -o ro /root/cmdline /proc/cmdline

The -n option skips adding the mount to /etc/mtab, so it will work even if root is mounted read-only. You can cat /proc/cmdline to confirm that your change was successful.

Parameter list

This list is not comprehensive. For a complete list of all options, please see the kernel documentation.

parameter Description
root= Root filesystem.
rootflags= Root filesystem mount options.
ro Mount root device read-only on boot (default1).
rw Mount root device read-write on boot.
initrd= Specify the location of the initial ramdisk.
init= Run specified binary instead of /sbin/init (symlinked to systemd in Arch) as init process.
init=/bin/sh Boot to shell.
systemd.unit= Boot to a specified target.
resume= Specify a swap device to use when waking from hibernation.
nomodeset Disable Kernel mode setting.
zswap.enabled Enable Zswap.
video=<videosetting> Override framebuffer video defaults.

1 mkinitcpio uses ro as default value when neither rw or ro is set by the boot loader. Boot loaders may set the value to use, for example GRUB uses rw by default (see FS#36275 as a reference).

See also