KernelBootParameters

Differences between revisions 14 and 15
Revision 14 as of 2019-01-08 23:47:37
Size: 5342
Editor: tomreyn
Comment:
Revision 15 as of 2020-01-22 13:02:20
Size: 5636
Editor: tomreyn
Comment: Refer to man pages for kernel / initrd parameters
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
The list of valid parameters may change between different kernel versions. For a list of the very latest see [[https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html|The kernel’s command-line parameters]] The list of valid parameters may change between different kernel versions. For a list of the very latest mainline kernel options see [[https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html|The kernel’s command-line parameters]]. Other options are documented in [[https://help.ubuntu.com/community/man|man pages]] [[https://manpages.ubuntu.com/manpages/focal/en/man7/bootparam.7.html|bootparam(7)]] and [[https://manpages.ubuntu.com/manpages/focal/en/man7/bootparam.7.html|kernel-command-line(7)]].

About Kernel Boot Parameters

This document provides simple instructions for adding a Linux kernel boot parameter to an Ubuntu system using GRUB 2.

When advised to try using a particular kernel boot parameter, it is usually a good idea to first add the parameter temporarily for testing. Once you have determined that adding the parameter has the desired effect, you can then add it permanently. Directions for both methods are below.

Kernel boot parameters are text strings which are interpreted by the system to change specific behaviors and enable or disable certain features. Kernel boot parameters:

  • are case-sensitive
  • are sometimes just a simple word ("splash" or "noapic")

  • sometimes have an = sign with various possible values ("acpi_backlight=vendor")

  • sometimes include punctuation ("i8042.noloop")

Always enter kernel boot parameters exactly as advised. Errors in spelling or formatting or invalid values will not result in any error message, they will simply have no effect.

The list of valid parameters may change between different kernel versions. For a list of the very latest mainline kernel options see The kernel’s command-line parameters. Other options are documented in man pages bootparam(7) and kernel-command-line(7).

Temporarily Add a Kernel Boot Parameter for Testing

  1. Restart your system, or shut it down and then power it on again.
  2. As the system starts to boot repeated tap the Esc key in order to force the "GNU GRUB" menu to appear. For BIOS-mode (not UEFI-mode) booting a SHIFT key can be held down continuously until the menu appears. The "GNU GRUB" menu will look something like this:

    • https://wiki.ubuntu.com/Kernel/KernelBootParameters?action=AttachFile&do=get&target=grub2_default_menu.png
      The Grub menu allows for choosing between different boot targets and modes

    • If the system hangs at the initial vendor logo screen when you hold down SHIFT, just release the SHIFT key briefly then hold it down again until the "GNU GRUB" menu appears.

  • Once the "GNU GRUB" menu appears highlight the desired entry and press the e key to enter edit mode. The edit mode screen will look something like this:

    • https://wiki.ubuntu.com/Kernel/KernelBootParameters?action=AttachFile&do=get&target=grub2_menu_editing.png
      By editing the linux line, kernel and initrd parameters can be modified for just a single boot

  • Use the down arrow key to move the cursor to the line beginning with the word "linux", then press the END key to move the cursor to the end of that line. Normally this will be just after the words "quiet splash".

  • Press SPACE to add a blank space (after "splash") then carefully type in the kernel boot parameter that you need to add. (If you need to add multiple parameters separate them with SPACE but do not add spaces before or after any = signs or punctuation in the parameters themselves).

  • Press Ctrl+X to boot the system using the parameters you've added.

Note: The parameter(s) you've added to the linux line are only temporary: They will affect this boot session, but once you restart the system they will no longer be in effect.

Permanently Add a Kernel Boot Parameter

  1. Log in to the system and start a terminal window (Applications->Accessories->Terminal).

  2. In the terminal window at the $ prompt, enter the command: sudo gedit /etc/default/grub

    • Enter your password when prompted by [sudo].
    • If the file /etc/default/grub appears to be empty or does not exist, see the instructions for earlier releases above).
  3. In the editor window, use the arrow keys to move the cursor to the line beginning with "GRUB_CMDLINE_LINUX_DEFAULT" then edit that line, adding your parameter(s) to the text inside the double-quotes after the words "quiet splash". (Be sure to add a SPACE after "splash" before adding your new parameter.) Click the Save button, then close the editor window.

  4. In the terminal window at the $ prompt, enter the command: sudo update-grub

  5. Restart the system.

Note: The parameter(s) you've added to the GRUB_CMDLINE_LINUX_DEFAULT line are persistent, and will be in effect for every subsequent boot session (unless you remove them by repeating the procedure above).

Kernel/KernelBootParameters (last edited 2022-12-02 14:25:41 by merlijn-sebrechts)