Understanding Linux Kernel Parameters

A guide to essential kernel parameters and their usage

Introduction to Kernel Parameters

Kernel parameters, also known as kernel boot parameters or kernel command line parameters, are options passed to the Linux kernel at boot time. These parameters can modify kernel behavior, enable or disable features, and provide configuration information.

Pro Tip: Kernel parameters can be temporary (set at boot time) or permanent (set in the bootloader configuration).

Where to Set Kernel Parameters

  1. GRUB2 Configuration: Edit /etc/default/grub and update the GRUB_CMDLINE_LINUX line.
  2. GRUB Menu: Press 'e' at the GRUB menu to edit parameters for a single boot.
  3. sysctl: Use sysctl to modify kernel parameters at runtime (some parameters only).
  4. /proc/cmdline: View current kernel parameters.

Common Kernel Parameters

Parameter Description Example
root= Specifies the root filesystem root=/dev/sda1
init= Specifies the init process init=/bin/bash
quiet Reduces verbosity of kernel messages quiet
splash Enables the boot splash screen splash
mem= Sets the amount of memory the kernel can use mem=4G
nomodeset Disables kernel mode setting nomodeset

Advanced Kernel Parameters

Kernel Parameters for Troubleshooting

Modifying Kernel Parameters

Temporary Changes

  1. Reboot your system and access the GRUB menu (usually by pressing Shift or Esc during boot)
  2. Select the kernel you want to boot and press 'e' to edit
  3. Find the line starting with 'linux' and add your parameters at the end
  4. Press Ctrl+X or F10 to boot with these parameters

Permanent Changes

  1. Edit the GRUB configuration file: sudo nano /etc/default/grub
  2. Modify the GRUB_CMDLINE_LINUX line to add your parameters
  3. Save the file and exit the editor
  4. Update GRUB: sudo update-grub (Ubuntu/Debian) or sudo grub2-mkconfig -o /boot/grub2/grub.cfg (CentOS/RHEL)
  5. Reboot your system for changes to take effect

Best Practices






Scroll to Top