Kernel boot param
Ubuntu team introducted a good guide for Kernel boot param and Linux kernel team keep update the latest available kernel boot param information
kernelconfig.io also provide comprehensive kernel parameter guide.
Perform temporary and permanent kernel parameter tuning
sysctl – command to configure kernel parameters at runtime
Purpose | Options | Description |
---|---|---|
a, -A | Display all values currently available | |
Temporary Change | -w | Use this option when you want to change a sysctl setting |
permanent Change | Change/Define parameter value /etc/sysctl.conf or crate your own file under /etc/modprobe.d
Run sysctl -p to update the file changes |
Add a Kernel Boot Parameter at boot time
- 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).
- 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.
- Go down to the line starting with linux and add your parameter foo=bar to its end.
- Now press Ctrl + x to boot.
Permanently Add a Kernel Boot Parameter to GRUB
Edit /etc/default/grub by adding or removing kernel boot parameter on the line of GRUB_CMDLINE_LINUX_DEFAULT
- in terminal (or after pressing Alt + F2) run:
- sudo vi /etc/default/grub #and enter your password.
- Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and append foo=bar to its end. For example:
- GRUB_CMDLINE_LINUX_DEFAULT="quiet splash foo=bar"
- Save the file and close the editor.
- sudo update-grub # to update GRUB's configuration file (you probably need to enter your password).
- 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.