devutils/ATFQ/book ATFQ git

Part II · Your system

20.2 The kernel command line

alsocmdlinekernel command linekernel parameterskernel options/proc/cmdlinegrub_cmdline_linux

TL;DR

  • The kernel command line is the list of options the bootloader passes to the kernel: which disk is root, quiet or verbose boot, driver settings.
  • The current one is in /proc/cmdline.
  • For one boot, edit the entry in the bootloader menu (e in GRUB). To keep a change, edit the bootloader's settings.
cat /proc/cmdline

On your machine

alice@laptopexample
$ atfq 20.2
  Firmware  UEFI · Secure Boot on
  Kernel    6.12.48-amd64
  Cmdline   BOOT_IMAGE=/vmlinuz-6.12.48-amd64
            root=UUID=3f1c2a9e-8b7d-4e21-9c55-0a6b2d7e9f10 ro
            rootflags=subvol=@ quiet splash
  Init      systemd · default target graphical.target
  Loader    systemd-boot 256.4 · 1 unified kernel image(s)
  Up        3 days, 4 h

An example: Alice's laptop, one of the test machines. In your terminal, this block shows your own machine, read live.

Pitfalls

Deep dive 2 questions

Who reads these options?

The kernel takes the ones it knows, such as root= or mitigations=. Options with a module name and a dot go to that module: i915.enable_psr=0 is for the Intel graphics driver. The kernel hands the rest to init, and systemd reads the ones that start with systemd..

What do the common options do?

ro mounts root read-only at first, so it can be checked; init remounts it read-write afterwards. quiet keeps the boot silent, and splash shows a boot animation instead. nomodeset keeps the kernel's graphics drivers off, a common workaround when a new graphics card shows a black screen.

Commands
cat
Paths
/proc/cmdline /etc/default/grub
See also
20. Boot
20.1 From firmware to init