Kernel parameters

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

  1. When building the kernel—in the kernel's config file. See Kernel#Compilation for details.
  2. When starting the kernel—using command line parameters (usually through a boot loader).
  3. At runtime—through the files in /proc/sys/ (see sysctl) and /sys/.
Note: The options of loadable modules can be set via .conf files in /etc/modprobe.d/. See Kernel module#Using files in /etc/modprobe.d/.

Between the three methods, the configurable options differ in availability, their name and the method in which they are specified. This page only explains the second method (kernel command line parameters) and shows a list of the most used kernel parameters in Arch Linux.

Most parameters 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.

Kernel command line parameters either have the format parameter or parameter=value.

Note: All kernel parameters are case-sensitive.

Configuration

Note:
  • You can check the parameters your system was booted up with by running cat /proc/cmdline and see if it includes your changes.
  • The Arch Linux installation medium uses Syslinux for BIOS systems, and GRUB for UEFI systems.

Kernel parameters can be set either temporarily by editing the boot entry in the boot loader's boot selection menu, or permanently 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

  • Press Tab when the menu shows up and add them at the end of the string:
Press to boot with these parameters.
  • To make the change persistent after reboot, edit and add them to the line:
APPEND root=UUID=0a3407de-014b-458b-b5c1-848e92a327a3 rw '''quiet splash'''

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

systemd-boot

  • Press when the menu appears and add the parameters to the end of the string:
initrd=\initramfs-linux.img root=UUID=0a3407de-014b-458b-b5c1-848e92a327a3 rw '''quiet splash'''
Press to boot with these parameters.
  • To make the change persistent after reboot, edit (assuming you set up your EFI system partition) and add them to the line:

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

GRUB

  • Press when the menu shows up and add them on the line:
Press to boot with these parameters.
Edit /etc/default/grub and append your kernel options between the quotes in the line:
And then automatically re-generate the file with:

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

GRUB Legacy

  • Press when the menu shows up and add them on the kernel line:
Press to boot with these parameters.
  • To make the change persistent after reboot, edit and add them to the kernel line, exactly like above.

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

LILO

  • Add them to :
image=/boot/vmlinuz-linux
        ...
        '''quiet splash'''

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

rEFInd

  • Press , , or on the desired menu entry and press it again on the submenu entry. Add kernel parameters at the end of the string:
Press to boot with these parameters.
  • To make the change persistent after reboot, edit and append them between the quotes in all required lines, for example
  • If you have disabled auto-detection of OSes in rEFInd and are defining OS stanzas instead in esp/EFI/refind/refind.conf to load your OSes, you can edit it like:

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

EFISTUB

See EFISTUB#Using UEFI directly.

dracut

dracut is capable of embedding the kernel parameters in the initramfs, thus allowing to omit them from the boot loader configuration. See dracut#Kernel command line options.

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 which stores the kernel parameters. However 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

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 , so it will work even if root is mounted read-only. You can 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.

parameterDescription
initRun specified binary instead of as init process. The package symlinks to to use systemd. Set it to to boot to the shell.
initrdSpecify the location of the initial ramdisk. For UEFI boot managers and EFISTUB, the path must be specified using backslashes (\) as path separators.
cryptdeviceSpecify the location of a dm-crypt-encrypted partition plus a device mapper name.
debugEnable kernel debugging (events log level).
lsmSet the initialisation order of the Linux security modules, used to enable AppArmor, SELinux or TOMOYO.
maxcpusMaximum number of processors that an SMP kernel will bring up during bootup.
memForce usage of a specific amount of memory to be used.
netdevNetwork devices parameters.
nomodesetDisable Kernel mode setting.
panicTime before automatic reboot on kernel panic.
resumeSpecify a swap device to use when waking from hibernation.
roMount root device read-only on boot (default1).
rootRoot filesystem. See init/do_mounts.c for kernel's supported device name formats. Note that an initramfs with udev supports more name formats.
rootflagsRoot filesystem mount options. Useful for setting options that cannot be applied by remounting (i.e. by ). For example, the option of an XFS root volume.
rwMount root device read-write on boot.
systemd.unitBoot to a specified target.
videoOverride framebuffer video defaults.

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

gollark: The predator drones have been shelved due to navigational issues, and the cartdrones have proven much more stable in initial testing.
gollark: It's one of GTech's experimental projects. I may have borrowed the idea and some of the code from Frogcat Industrial's research.
gollark: Both OC drones, and "cartdrone" technology.
gollark: Although they ARE a little unreliable.
gollark: Besides, I have drones too.

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.