BLOG08a: Linux GRUB Parameters

BLOG18: Linux GRUB Parameters (Initialization), Runtime Behavior (sysctl Tunables), Dynamic Modules (modprobe)

What are the differences between GRUB kernel boot parameters, sysctl parameters, and modprobe kernel modules?

This document explains the differences between three types of kernel configuration:

  • Kernel boot parameters in GRUB (cmdline parameters)

  • sysctl parameters

  • modprobe kernel modules

The following sections provide a clear explanation of the differences between all three.


1. Kernel Parameters in GRUB (Boot-time Kernel Arguments)

These are kernel command-line parameters passed at boot via GRUB.

They modify how the kernel initializes itself before modules load and before sysctl is applied.

Examples:

cgroup_enable=memory
systemd.unified_cgroup_hierarchy=1
iptables=legacy
swapaccount=1
ipv6.disable=1

Where they live?

/etc/default/grub

When applied?

  • At boot time

  • Before the kernel starts

  • Changes require reboot

Purpose:

  • Enable/disable kernel subsystems

  • Change cgroup modes

  • Disable swap, IPv6

  • Configure low-level memory handling

  • Control security features (AppArmor/SELinux startup mode)

These settings cannot be changed at runtime.


2. sysctl Parameters (Runtime Kernel Tunables)

These modify kernel behavior while the system is running.

Location:

/proc/sys/* /etc/sysctl.conf /etc/sysctl.d/*

When applied?

  • At runtime (immediate effect)

  • Can be persistent with sysctl.d

  • Does not require reboot (unless certain networking options)

Purpose:

Adjust runtime networking, memory limits, routing, etc.

Examples:


3. modprobe (Kernel Modules)

Loads or unloads kernel modules (.ko files) — similar to drivers.

Examples:

Purpose:

  • Add features to the kernel dynamically

  • Allow Kubernetes networking or storage drivers

  • Implement packet filtering modules

When applied?

  • At runtime

  • No reboot required

  • Must persist using /etc/modules-load.d/*.conf


How All Three Interact

GRUB Parameters

  • Affect kernel core behavior

  • Set things that cannot be changed later

  • Example: cgroup v1 vs v2 mode

modprobe Kernel Modules

  • Add extra "plugin" features

  • Loadable anytime after boot

sysctl Runtime Parameters

  • Configure behavior of already-loaded kernel components

  • Change limits instantly


Example to Understand the Difference

The following example uses cgroup memory accounting (important for Kubernetes):

1. GRUB parameter (boot-time)

  • Enables memory cgroups/full accounting

  • Must be set before boot

  • Required by kubelet or containerd runtime features

  • Cannot be changed with sysctl

2. modprobe (module load)

  • Loads the module to inspect packets on Linux bridges

3. sysctl parameter (runtime behavior)

  • Enables routing (only works if networking modules exist)


Simple Analogy

Category
Analogy

GRUB kernel arguments

BIOS settings — set before the system starts

modprobe modules

Plugging in new hardware/driver while PC is running

sysctl

Changing Windows registry/network tuning at runtime


Kubernetes Example

To run Kubernetes properly, you may need all three:

Layer
Example
Why

GRUB

cgroup_enable=memory, swapaccount=1

Allow kubelet/containerd to manage memory

modprobe

br_netfilter, overlay

Allow bridge filtering + overlay fs

sysctl

net.ipv4.ip_forward=1, bridge-nf-call-iptables=1

Enable pod networking


Summary Table

Feature
GRUB Kernel Args
modprobe
sysctl

When applied

At boot

Runtime

Runtime

Requires reboot

Yes

No

No

Controls

Kernel core behavior

Kernel modules (drivers)

Kernel behavior tuning

Examples

cgroup_enable, swapaccount

overlay, br_netfilter

ip_forward, swappiness

Who needs it?

kubelet runtime, memory cgroups

CNI, container runtime

kube-proxy, routing

Can change dynamically?

No

Yes

Yes


The following sections provide a complete, practical, production-grade list of commands to show:

  • Loaded kernel modules

  • Available (but NOT loaded) modules

  • All GRUB kernel parameters

  • All sysctl tunables (current + default + available)

Everything works on Ubuntu, Debian, RHEL/CentOS, Rocky, Amazon Linux, etc.


1. List All LOADED Kernel Modules

These are modules currently active in the running kernel:

Command

Better readable output:

Check if a specific module is loaded:

Example:


2. List All AVAILABLE Kernel Modules (Installed but NOT loaded)

These are modules present under /lib/modules/$kernel/ but not loaded.

Command

To see only module names (clean list):

To compare:

Loaded vs Not loaded


3. List All GRUB Kernel Parameters

These are parameters passed to the kernel at boot.

See parameters used by the currently running kernel

See configured GRUB file (what will apply after reboot)

See all menu entries (grub.cfg)

To get ONLY kernel parameters from grub.cfg


4. List ALL sysctl tunables

A. Show all CURRENT sysctl kernel settings

B. Show only network sysctl values

C. Show only modified (active) sysctl values

Or:

D. Show sysctl configurations applied from files

(Defaults + overrides)

1. Global config:

2. Drop-in configs:

Example:


5. List All sysctl Parameters Available in the Kernel

These are every kernel parameter that exists under /proc/sys/.

Directory listing:

Clean list:


SUMMARY (For Quick Use)

Category
Command

Loaded modules

lsmod

Available modules

find /lib/modules/$(uname -r)/kernel -name "*.ko*"

GRUB parameters (running)

cat /proc/cmdline

GRUB parameters (configured)

cat /etc/default/grub

All sysctl tunables (active)

sysctl -a

Sysctl configs

/etc/sysctl.conf, /etc/sysctl.d/*.conf

All sysctl available

find /proc/sys


Last updated