How do you view and change kernel command-line parameters?
IntermediateConceptBoot Process & Kernel
Answer
In one line: Kernel parameters are settings passed to the kernel when it starts. You can see the current ones in /proc/cmdline and change them permanently through the GRUB configuration.
See the current parameters:
cat /proc/cmdline
# BOOT_IMAGE=/vmlinuz-6.8.0 root=/dev/sda1 ro quiet splash
Change them permanently:
# RHEL/CentOS/Rocky — easiest way
sudo grubby --update-kernel=ALL --args="transparent_hugepage=never"
sudo grubby --update-kernel=ALL --remove-args="quiet"
# Ubuntu/Debian — edit the GRUB file, then regenerate
sudo vi /etc/default/grub # add to GRUB_CMDLINE_LINUX="..."
sudo update-grub
Then reboot and check /proc/cmdline again.
Change them for one boot only: at the GRUB menu, press e, add the parameter to the line starting with linux, and press Ctrl+X. This is how you boot into rescue mode when a server is broken.
Real DevOps example: database servers often need transparent_hugepage=never for better performance, and cloud VMs often need console=ttyS0 so you can see boot logs in the cloud console.
More on Boot Process & Kernel
Walk through the Linux boot process from power-on to login prompt.BeginnerWhat is the difference between BIOS and UEFI booting?IntermediateWhat does GRUB2 do and where is its configuration?BeginnerWhat is the initramfs and why is it needed?AdvancedWhat is systemd and why did it replace SysV init?BeginnerWhat are systemd targets, and how do they map to old runlevels?Beginner