Kernel parameters
There are three ways to pass options to the kernel and thus control its behaviour:
- When building the kernel. See Kernel Compilation for details.
- When starting the kernel (usually, when invoked from a boot loader).
- At runtime (through the files in
/procand/sys). See sysctl for details.
This page now explains in more detail the second method and shows a list of most used kernel parameters in Arch Linux.
Contents
Configuration
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.
Here we are adding the parameters quiet and splash to Syslinux, GRUB, GRUB Legacy, LILO, Gummiboot and rEFInd.
Syslinux
- Press
Tabwhen the menu shows up and add them at the end of the string:
-
linux /boot/vmlinuz-linux root=/dev/sda3 initrd=/boot/initramfs-linux.img quiet splash
- Press
Enterto boot with these parameters.
- To make the change persistent after reboot, edit
/boot/syslinux/syslinux.cfgand add them to theAPPENDline:
-
APPEND root=/dev/sda3 quiet splash
For more information on configuring Syslinux, see the Syslinux article.
GRUB
- Press
ewhen the menu shows up and add them on thelinuxline:
-
linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff quiet splash
- Press
bto boot with these parameters.
- To make the change persistent after reboot, while you could manually edit
/boot/grub/grub.cfgwith the exact line from above, for beginners it's recommended to:
- Edit
/etc/default/gruband append your kernel options to theGRUB_CMDLINE_LINUX_DEFAULTline:
-
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
-
- And then automatically re-generate the
grub.cfgfile with:
-
# grub-mkconfig -o /boot/grub/grub.cfg
-
For more information on configuring GRUB, see the GRUB article.
GRUB Legacy
- Press
ewhen the menu shows up and add them on thekernelline:
-
kernel /boot/vmlinuz-linux root=/dev/sda3 quiet splash
- Press
bto boot with these parameters.
- To make the change persistent after reboot, edit
/boot/grub/menu.lstand add them to thekernelline, exactly like above.
For more information on configuring GRUB Legacy, see the GRUB Legacy article.
LILO
- Add them to
/etc/lilo.conf:
-
image=/boot/vmlinuz-linux ... quiet splash
For more information on configuring LILO, see the LILO article.
Gummiboot
- Press
ewhen the menu appears and add the parameters to the end of the string:
-
initrd=\initramfs-linux.img root=/dev/sda2 quiet splash
- Press
Enterto boot with these parameters.
- To make the change persistent after reboot, edit
/boot/loader/entries/arch.conf(assuming you set up your EFI System Partition and configuration files according to the instructions in the Beginners' Guide) and add them to theoptionsline:
-
options root=/dev/sda2 quiet splash
For more information on configuring Gummiboot, see the Gummiboot article.
rEFInd
- To make the change persistent after reboot, edit
/boot/EFI/arch/refind_linux.conf(ie. refind_linux.conf in the folder your kernel is located in) and append them to all/required lines, for example:
-
"Boot to X" "root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff quiet splash
- If you have disabled auto-detection of OS's in rEFInd and are defining OS stanzas instead in
/boot/EFI/refind/refind.confto load your OS's, you can edit it like:
-
menuentry "Arch" { loader /EFI/arch/vmlinuz-arch.efi options "root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff quiet splash"
For more information on configuring kernel parameters in rEFInd, see Configuring the rEFInd Bootmanager
EFISTUB/efibootmgr
See EFISTUB#Using UEFI directly (efibootmgr).
Parameter list
Parameters always come in parameter or parameter=value. All of these parameters are case-sensitive.
| parameter | Description |
|---|---|
| root= | Root filesystem. |
| 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= | |
| systemd.unit=multi-user | Boot to a specified runlevel. |
| systemd.unit=rescue | Boot to single-user mode (root). |
| 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).
For a complete list of all options, please see the kernel documentation.