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 (
ein GRUB). To keep a change, edit the bootloader's settings.
cat /proc/cmdline
On your machine
$ 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
- With GRUB, editing
GRUB_CMDLINE_LINUXin/etc/default/grubdoes nothing until you regenerate its config:sudo update-grubon Debian and Ubuntu,sudo grub-mkconfig -o /boot/grub/grub.cfgon Arch. - A typo in
root=makes the system unbootable: try an option once from the menu before making it permanent. quiethides the boot messages: remove it to see where a boot hangs.systemd.unit=rescue.targetboots into a rescue shell, for one boot.
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.