https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ruleoneonezero&feedformat=atomArchWiki - User contributions [en]2024-03-29T00:18:38ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Kernel_parameters&diff=272010Kernel parameters2013-08-21T15:57:03Z<p>Ruleoneonezero: </p>
<hr />
<div>[[Category:Kernel]]<br />
[[es:Kernel parameters]]<br />
[[ja:Kernel parameters]]<br />
[[zh-CN:Kernel parameters]]<br />
There are three ways to pass options to the kernel and thus control its behaviour:<br />
<br />
# When building the kernel.<br />
# When starting the kernel (usually, when invoked from a boot loader).<br />
# At runtime (through the files in {{ic|/proc}} and {{ic|/sys}}).<br />
<br />
This page now explains in more detail the second method and shows a list of most used kernel parameters in Arch Linux.<br />
<br />
== Configuration ==<br />
<br />
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.<br />
<br />
Here we are adding the parameters {{ic|quiet}} and {{ic|splash}} to [[Syslinux]], [[GRUB]], [[GRUB Legacy]] and [[LILO]].<br />
<br />
==== Syslinux ====<br />
<br />
* Press {{Keypress|Tab}} when the menu shows up and add them at the end of the string:<br />
<br />
: {{bc|1=linux /boot/vmlinuz-linux root=/dev/sda3 initrd=/boot/initramfs-linux.img ''quiet splash''}}<br />
<br />
: Press {{Keypress|Enter}} to boot with these parameters.<br />
<br />
* To make the change persistent after reboot, edit {{ic|/boot/syslinux/syslinux.cfg}} and add them to the {{ic|APPEND}} line:<br />
<br />
: {{bc|1=APPEND root=/dev/sda3 ''quiet splash''}}<br />
<br />
For more information on configuring Syslinux, see the [[Syslinux]] article.<br />
<br />
==== GRUB ====<br />
<br />
* Press {{Keypress|e}} when the menu shows up and add them on the {{ic|linux}} line:<br />
<br />
: {{bc|1=linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff ''quiet splash''}}<br />
<br />
: Press {{Keypress|b}} to boot with these parameters.<br />
<br />
* To make the change persistent after reboot, while you ''could'' manually edit {{ic|/boot/grub/grub.cfg}} with the exact line from above, for beginners it's recommended to:<br />
<br />
:Edit {{ic|/etc/default/grub}} and append your kernel options to the {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} line:<br />
<br />
:: {{bc|1=GRUB_CMDLINE_LINUX_DEFAULT="''quiet splash''"}}<br />
<br />
:And then automatically re-generate the {{ic|grub.cfg}} file with:<br />
<br />
:: {{bc|# grub-mkconfig -o /boot/grub/grub.cfg}}<br />
<br />
For more information on configuring GRUB, see the [[GRUB]] article.<br />
<br />
==== GRUB Legacy ====<br />
<br />
* Press {{Keypress|e}} when the menu shows up and add them on the {{ic|kernel}} line:<br />
<br />
: {{bc|1=kernel /boot/vmlinuz-linux root=/dev/sda3 ''quiet splash''}}<br />
<br />
: Press {{Keypress|b}} to boot with these parameters.<br />
<br />
* To make the change persistent after reboot, edit {{ic|/boot/grub/menu.lst}} and add them to the {{ic|kernel}} line, exactly like above.<br />
<br />
For more information on configuring GRUB Legacy, see the [[GRUB Legacy]] article.<br />
<br />
==== LILO ====<br />
<br />
* Add them to {{ic|/etc/lilo.conf}}:<br />
<br />
: {{bc|<nowiki><br />
image=/boot/vmlinuz-linux<br />
...<br />
</nowiki>''quiet splash''}}<br />
<br />
For more information on configuring LILO, see the [[LILO]] article.<br />
<br />
==== rEFInd ====<br />
* To make the change persistent after reboot, edit {{ic|/boot/EFI/arch/refind_linux.conf}} and append them to all/required lines, for example:<br />
: {{bc|1="Boot to X" "root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff ro rootfstype=ext4 quiet splash}}<br />
<br />
* If you've disabled auto-detection of OS's in rEFInd and are defining OS stanzas instead in {{ic|/boot/EFI/refind/refind.conf}} to load your OS's, you can edit it like:<br />
: {{bc|<nowiki>menuentry "Arch" {<br />
loader /EFI/arch/vmlinuz-arch.efi<br />
options "quiet splash ro root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff"</nowiki>}}<br />
<br />
For more information on configuring kernel parameters in rEFInd, see <br />
# [http://www.rodsbooks.com/refind/linux.html Configuring the rEFInd Bootmanager]<br />
# [http://www.rodsbooks.com/refind/linux.html Methods of Booting Linux]<br />
<br />
== Parameter list ==<br />
<br />
Parameters always come in {{ic|parameter}} or {{ic|1=parameter=value}}. All of these parameters are case-sensitive.<br />
<br />
{{Note|Not all of the listed options 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.}}<br />
<br />
{| border="1"<br />
!parameter!!Description<br />
|-<br />
|{{ic|1=root=}}|| Root filesystem.<br />
|-<br />
|{{ic|1=ro}}|| Mount root device read-only on boot.<br />
|-<br />
|{{ic|1=rw}}|| Mount root device read-write on boot (default).<br />
|-<br />
|{{ic|1=initrd=}}|| Specify the location of the initial ramdisk.<br />
|-<br />
|{{ic|1=init=}}|| Run specified binary instead of {{ic|/sbin/init}} (symlinked to [[systemd]] in Arch) as init process.<br />
|-<br />
|{{ic|1=init=/bin/sh}}|| Boot to shell.<br />
|-<br />
|{{ic|1=systemd.unit=}}||<br />
|-<br />
|{{ic|1=systemd.unit=multi-user}}|| Boot to a specified runlevel.<br />
|-<br />
|{{ic|1=systemd.unit=rescue}}|| Boot to single-user mode (root).<br />
|-<br />
|{{ic|nomodeset}}|| Disable [[Kernel Mode Setting]].<br />
|-<br />
|}<br />
<br />
For a complete list of all options, please see the [https://www.kernel.org/doc/Documentation/kernel-parameters.txt kernel documentation].<br />
<br />
== See also ==<br />
<br />
* [[sysctl]]<br />
* [[Power saving#Kernel parameters]]<br />
* [http://files.kroah.com/lkn/lkn_pdf/ch09.pdf List of kernel parameters with further explanation and grouped by similar options]</div>Ruleoneonezerohttps://wiki.archlinux.org/index.php?title=Kernel_parameters&diff=272009Kernel parameters2013-08-21T15:56:01Z<p>Ruleoneonezero: </p>
<hr />
<div>[[Category:Kernel]]<br />
[[es:Kernel parameters]]<br />
[[ja:Kernel parameters]]<br />
[[zh-CN:Kernel parameters]]<br />
There are three ways to pass options to the kernel and thus control its behaviour:<br />
<br />
# When building the kernel.<br />
# When starting the kernel (usually, when invoked from a boot loader).<br />
# At runtime (through the files in {{ic|/proc}} and {{ic|/sys}}).<br />
<br />
This page now explains in more detail the second method and shows a list of most used kernel parameters in Arch Linux.<br />
<br />
== Configuration ==<br />
<br />
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.<br />
<br />
Here we are adding the parameters {{ic|quiet}} and {{ic|splash}} to [[Syslinux]], [[GRUB]], [[GRUB Legacy]] and [[LILO]].<br />
<br />
==== Syslinux ====<br />
<br />
* Press {{Keypress|Tab}} when the menu shows up and add them at the end of the string:<br />
<br />
: {{bc|1=linux /boot/vmlinuz-linux root=/dev/sda3 initrd=/boot/initramfs-linux.img ''quiet splash''}}<br />
<br />
: Press {{Keypress|Enter}} to boot with these parameters.<br />
<br />
* To make the change persistent after reboot, edit {{ic|/boot/syslinux/syslinux.cfg}} and add them to the {{ic|APPEND}} line:<br />
<br />
: {{bc|1=APPEND root=/dev/sda3 ''quiet splash''}}<br />
<br />
For more information on configuring Syslinux, see the [[Syslinux]] article.<br />
<br />
==== GRUB ====<br />
<br />
* Press {{Keypress|e}} when the menu shows up and add them on the {{ic|linux}} line:<br />
<br />
: {{bc|1=linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff ''quiet splash''}}<br />
<br />
: Press {{Keypress|b}} to boot with these parameters.<br />
<br />
* To make the change persistent after reboot, while you ''could'' manually edit {{ic|/boot/grub/grub.cfg}} with the exact line from above, for beginners it's recommended to:<br />
<br />
:Edit {{ic|/etc/default/grub}} and append your kernel options to the {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} line:<br />
<br />
:: {{bc|1=GRUB_CMDLINE_LINUX_DEFAULT="''quiet splash''"}}<br />
<br />
:And then automatically re-generate the {{ic|grub.cfg}} file with:<br />
<br />
:: {{bc|# grub-mkconfig -o /boot/grub/grub.cfg}}<br />
<br />
For more information on configuring GRUB, see the [[GRUB]] article.<br />
<br />
==== GRUB Legacy ====<br />
<br />
* Press {{Keypress|e}} when the menu shows up and add them on the {{ic|kernel}} line:<br />
<br />
: {{bc|1=kernel /boot/vmlinuz-linux root=/dev/sda3 ''quiet splash''}}<br />
<br />
: Press {{Keypress|b}} to boot with these parameters.<br />
<br />
* To make the change persistent after reboot, edit {{ic|/boot/grub/menu.lst}} and add them to the {{ic|kernel}} line, exactly like above.<br />
<br />
For more information on configuring GRUB Legacy, see the [[GRUB Legacy]] article.<br />
<br />
==== LILO ====<br />
<br />
* Add them to {{ic|/etc/lilo.conf}}:<br />
<br />
: {{bc|<nowiki><br />
image=/boot/vmlinuz-linux<br />
...<br />
</nowiki>''quiet splash''}}<br />
<br />
For more information on configuring LILO, see the [[LILO]] article.<br />
<br />
==== rEFInd ====<br />
* To make the change persistent after reboot, edit {{ic|/boot/EFI/arch/refind_linux.conf}} and append them to all/required lines, for example:<br />
: {{bc|1="Boot to X" "root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff ro rootfstype=ext4 quiet splash}}<br />
<br />
* If you've disabled auto-detection of OS's in rEFInd and are defining OS stanzas instead in {{ic|/boot/EFI/refind/refind.conf}} to load your OS's, you can edit it like:<br />
: {{bc|<nowiki>menuentry "Arch" {<br />
loader /EFI/arch/vmlinuz-arch.efi<br />
options "quiet splash ro root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff"</nowiki>}}<br />
<br />
For more information on configuring rEFInd, see <br />
# [http://www.rodsbooks.com/refind/linux.html Configuring the rEFInd Bootmanager]<br />
# [http://www.rodsbooks.com/refind/linux.html Methods of Booting Linux]<br />
<br />
== Parameter list ==<br />
<br />
Parameters always come in {{ic|parameter}} or {{ic|1=parameter=value}}. All of these parameters are case-sensitive.<br />
<br />
{{Note|Not all of the listed options 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.}}<br />
<br />
{| border="1"<br />
!parameter!!Description<br />
|-<br />
|{{ic|1=root=}}|| Root filesystem.<br />
|-<br />
|{{ic|1=ro}}|| Mount root device read-only on boot.<br />
|-<br />
|{{ic|1=rw}}|| Mount root device read-write on boot (default).<br />
|-<br />
|{{ic|1=initrd=}}|| Specify the location of the initial ramdisk.<br />
|-<br />
|{{ic|1=init=}}|| Run specified binary instead of {{ic|/sbin/init}} (symlinked to [[systemd]] in Arch) as init process.<br />
|-<br />
|{{ic|1=init=/bin/sh}}|| Boot to shell.<br />
|-<br />
|{{ic|1=systemd.unit=}}||<br />
|-<br />
|{{ic|1=systemd.unit=multi-user}}|| Boot to a specified runlevel.<br />
|-<br />
|{{ic|1=systemd.unit=rescue}}|| Boot to single-user mode (root).<br />
|-<br />
|{{ic|nomodeset}}|| Disable [[Kernel Mode Setting]].<br />
|-<br />
|}<br />
<br />
For a complete list of all options, please see the [https://www.kernel.org/doc/Documentation/kernel-parameters.txt kernel documentation].<br />
<br />
== See also ==<br />
<br />
* [[sysctl]]<br />
* [[Power saving#Kernel parameters]]<br />
* [http://files.kroah.com/lkn/lkn_pdf/ch09.pdf List of kernel parameters with further explanation and grouped by similar options]</div>Ruleoneonezero