Kernel boot param: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
No edit summary
Line 27: Line 27:
$cat /proc/cmdline.
$cat /proc/cmdline.
</syntaxhighlight>
</syntaxhighlight>
== Notices ==
When you update the kernel in Ubuntu, it's possible that some of the kernel boot parameters may need to be reset. This is because certain kernel boot parameters are specific to the version of the kernel you are using, and when you update the kernel to a new version, these parameters may no longer be valid or may need to be updated.
== Reference ==

Revision as of 10:14, 3 April 2023

Ubuntu team introducted a good guide for Kernel boot param and Linux kernel team keep update the latest available kernel boot param information

Here are simple steps how to add boot parameter temporarily and permanent.

Temporarily Add a Kernel Boot Parameter for Testing

  1. Start your system and wait for the GRUB menu to show (if you don't see a GRUB menu, press and hold the left Shift key right after starting the system).
  2. Now highlight the kernel you want to use, and press the e key. You should be able to see and edit the commands associated with the highlighted kernel.
  3. Go down to the line starting with linux and add your parameter foo=bar to its end.
  4. Now press Ctrl + x to boot.

Permanently Add a Kernel Boot Parameter

Edit /etc/default/grub by adding or removing kernel boot parameter on the line of GRUB_CMDLINE_LINUX_DEFAULT

  1. in terminal (or after pressing Alt + F2) run:
  2. sudo vi /etc/default/grub    #and enter your password.
  3. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and append foo=bar to its end. For example:
  4. GRUB_CMDLINE_LINUX_DEFAULT="quiet splash foo=bar"
  5. Save the file and close the editor.
  6. sudo update-grub # to update GRUB's configuration file (you probably need to enter your password).
  7. On the next reboot, the kernel should be started with the boot parameter.

To permanently remove it, simply remove the parameter from GRUB_CMDLINE_LINUX_DEFAULT and run sudo update-grub again.

Verify Your changes

To verify your changes, you can see exactly what parameters your kernel booted with by executing

$cat /proc/cmdline.

Notices

When you update the kernel in Ubuntu, it's possible that some of the kernel boot parameters may need to be reset. This is because certain kernel boot parameters are specific to the version of the kernel you are using, and when you update the kernel to a new version, these parameters may no longer be valid or may need to be updated.

Reference