// learn Β· linux Β· rhcsa Β· 9 min

Kernel parameters & tuned.

'Kernel parameter' means two different things: boot-time arguments GRUB hands the kernel, and runtime sysctl knobs you can twist while it's running. Learn both, how to make each persist, and how tuned bundles dozens of them into one named profile.

Kernel parameters and tuned animated tutorial. Boot-time kernel command line via GRUB and grubby, runtime sysctl tunables, persistent sysctl in /etc/sysctl.d, and tuned profiles with tuned-adm. RHCSA EX200 ready.
// kernel parameters & tuned

Two things wear the name "kernel parameter": boot-time arguments from GRUB, and runtime sysctl knobs. Tell them apart, make each persist, and let tuned bundle the lot.

// before you start
you should know
  • Β·The boot-process lesson (where GRUB and the kernel cmdline fit)
  • Β·Comfortable editing files and running commands as root
  • Β·Helpful: NAT-and-routing (ip_forward is the running example)
by the end you'll

Distinguish boot-time cmdline from runtime sysctl, persist each correctly, and switch tuned profiles for the machine's role.

pace: 9 minutes

kernel tuning β€” step 1 / 6 Β· two kinds
β‘  boot-time β€” kernel cmdline
set by: GRUB
read: once, as kernel starts
see: cat /proc/cmdline
one boot: GRUB 'e' edit
persist: grubby --args
e.g. quiet rd.break selinux=0
β‘‘ runtime β€” sysctl
set by: sysctl / /proc/sys
read: any time, live
see: sysctl -a
now: sysctl -w (runtime only)
persist: /etc/sysctl.d/*.conf
e.g. net.ipv4.ip_forward=1

Two different things called 'kernel parameter'

The phrase is overloaded. (1) BOOT-TIME parameters are arguments GRUB passes to the kernel on the command line β€” set once, read as the kernel starts (e.g. quiet, rd.break, selinux=0). (2) RUNTIME parameters are sysctl tunables you can read and change while the system runs (e.g. net.ipv4.ip_forward). Different mechanisms, different persistence β€” don't confuse them.

// key insight

Persistence is the recurring trap. A GRUB 'e' edit lasts one boot; grubby makes it permanent. A sysctl -w lasts until reboot; a file in /etc/sysctl.d makes it permanent. tuned, by contrast, IS persistent β€” its daemon re-applies the chosen profile every boot.

// exam-ready Β· cmdline, sysctl, tuned
$cat /proc/cmdline
$grubby --info=ALL
$grubby --update-kernel=ALL --args="X"
$grubby --update-kernel=ALL --remove-args="X"
$/etc/default/grub
$grub2-mkconfig -o /boot/grub2/grub.cfg
$sysctl -a
$sysctl NAME
$sysctl -w NAME=VAL
$/etc/sysctl.d/99-x.conf
$sysctl --system
$tuned-adm active
$tuned-adm list
$tuned-adm profile NAME
$tuned-adm recommend
$systemctl enable --now tuned
// check yourself
4 quick questions
Q1

You ran `sysctl -w net.ipv4.ip_forward=1` and routing started working. After a reboot it stopped. How do you make it permanent?

Q2

You need to add a kernel boot argument permanently across all installed kernels. Best command?

Q3

What's the relationship between a sysctl name like net.ipv4.ip_forward and the filesystem?

Q4

What does a tuned profile like 'throughput-performance' actually do?

These aren't graded β€” they're just for active recall, which is what actually makes the lesson stick.

⚑
// where the cmdline comes from

Linux boot process

GRUB is where the kernel command line is assembled and where the 'e' one-boot edit (rd.break, init=/bin/bash) lives. See the full chain from firmware to systemd.

open β†’

Read this lesson as text6 chapters Β· quiz answers

  1. 01Two different things called 'kernel parameter'

    The phrase is overloaded. (1) BOOT-TIME parameters are arguments GRUB passes to the kernel on the command line β€” set once, read as the kernel starts (e.g. quiet, rd.break, selinux=0). (2) RUNTIME parameters are sysctl tunables you can read and change while the system runs (e.g. net.ipv4.ip_forward). Different mechanisms, different persistence β€” don't confuse them.

  2. 02Boot-time β€” the kernel command line

    What GRUB handed the kernel lives in /proc/cmdline. You can edit it for ONE boot by pressing 'e' in the GRUB menu (great for rescue: add rd.break or init=/bin/bash). To make a change permanent, don't hand-edit grub.cfg β€” use grubby --update-kernel=ALL --args="..." (or edit GRUB_CMDLINE_LINUX in /etc/default/grub then regenerate). Common args: quiet, rhgb, selinux=0, systemd.unit=, console=.

    • $ cat /proc/cmdline β€” what THIS boot used
    • $ grubby --info=ALL β€” args per kernel entry
    • $ grubby --update-kernel=ALL --args="quiet" β€” add an arg permanently
    • $ grubby --update-kernel=ALL --remove-args="quiet" β€” remove one
  3. 03Runtime β€” sysctl tunables

    Hundreds of kernel knobs live under /proc/sys and are exposed by sysctl. sysctl -a lists them; sysctl net.ipv4.ip_forward reads one; sysctl -w net.ipv4.ip_forward=1 sets it RIGHT NOW. But -w changes are runtime-only β€” they vanish on reboot (same trap as setsebool without -P). The dotted name maps to a path: net.ipv4.ip_forward = /proc/sys/net/ipv4/ip_forward.

    • $ sysctl -a β€” every tunable (lots)
    • $ sysctl net.ipv4.ip_forward β€” read one
    • $ sysctl -w net.ipv4.ip_forward=1 β€” set now (runtime only)
    • $ cat /proc/sys/net/ipv4/ip_forward β€” same value via the file
  4. 04Make sysctl persist

    To survive reboots, write the setting to a file in /etc/sysctl.d/ (e.g. /etc/sysctl.d/99-forward.conf containing net.ipv4.ip_forward = 1). Apply all config files with sysctl --system, or one file with sysctl -p <file>. /etc/sysctl.conf still works but a drop-in file in sysctl.d is the modern, package-friendly way.

    • $ echo 'net.ipv4.ip_forward = 1' > /etc/sysctl.d/99-forward.conf β€” persist it
    • $ sysctl --system β€” reload all sysctl.d files
    • $ sysctl -p /etc/sysctl.d/99-forward.conf β€” load one file
  5. 05tuned β€” profiles bundle the knobs

    Rather than hand-tune dozens of sysctls and power settings, tuned ships named PROFILES that apply a whole coherent set at once: throughput-performance (servers), virtual-guest (VMs), powersave (laptops), balanced (default). tuned-adm active shows the current one; tuned-adm list shows all; tuned-adm profile <name> switches. The tuned daemon must be running.

    • $ tuned-adm active β€” current profile
    • $ tuned-adm list β€” available profiles
    • $ tuned-adm profile throughput-performance β€” switch profile
  6. 06tuned recommend β€” let it pick

    Not sure which profile? tuned-adm recommend inspects the hardware/role and suggests one (e.g. virtual-guest on a VM). For the exam and real life: pick the profile that matches the machine's job, verify with tuned-adm active, and remember tuned changes are themselves persistent β€” it re-applies the chosen profile on every boot via the tuned.service.

    • $ tuned-adm recommend β€” suggested profile for this box
    • $ tuned-adm verify β€” are settings still applied?
    • $ systemctl enable --now tuned β€” ensure the daemon runs

Quiz β€” answers

You ran sysctl -w net.ipv4.ip_forward=1 and routing started working. After a reboot it stopped. How do you make it permanent?
β†’Write net.ipv4.ip_forward = 1 to a file in /etc/sysctl.d/ and apply with sysctl --system.-w is runtime-only. A drop-in file under /etc/sysctl.d/ (e.g. 99-forward.conf) makes it persist; sysctl --system reloads all such files. Editing /proc directly is also runtime-only.
You need to add a kernel boot argument permanently across all installed kernels. Best command?
β†’grubby --update-kernel=ALL --args="..."grubby is the supported tool to manage kernel args across entries. /proc/cmdline is read-only (it just reports the current boot). Hand-editing grub.cfg is fragile β€” it gets regenerated.
What's the relationship between a sysctl name like net.ipv4.ip_forward and the filesystem?
β†’The dotted name maps to a path under /proc/sys: net.ipv4.ip_forward = /proc/sys/net/ipv4/ip_forward. Reading/writing the file is the same as sysctl.sysctl is just a friendly front-end to /proc/sys. Dots become slashes. sysctl -w x.y=1 and echo 1 > /proc/sys/x/y do the same thing (both runtime-only).
What does a tuned profile like 'throughput-performance' actually do?
β†’Applies a coherent bundle of pre-set sysctl values, CPU governor, disk, and power settings appropriate for that role β€” so you don't hand-tune each knob.tuned profiles are curated bundles. throughput-performance favors servers; virtual-guest suits VMs; powersave suits laptops. tuned-adm recommend suggests one; the tuned daemon re-applies it each boot.
// more in linux

keep going β€” these pair well with what you just learned.

see all linux β†’

See also

the boot processall lessons