95

In the grub.conf configuration file I can specify command line parameters that the kernel will use, i.e.:

kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791

After booting a given kernel, is there a way to display the command line parameters that were passed to the kernel in the first place? I've found sysctl,

sysctl --all

but sysctl shows up all possible kernel parameters.

Ciro Santilli OurBigBook.com
  • 18,092
  • 4
  • 117
  • 102
colemik
  • 1,371

2 Answers2

150
$ cat /proc/cmdline
root=/dev/xvda xencons=tty console=tty1 console=hvc0 nosep nodevfs ramdisk_size=32768 ip_conntrack.hashsize=8192 nf_conntrack.hashsize=8192 ro  devtmpfs.mount=1 
$
mrb
  • 10,288
14

The kernel also printks them at the beginning of boot, see:

dmesg | grep "Command line"

Sample output:

[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.4.0-112-generic root=/dev/mapper/vg00-root ro

This can be useful information on the serial if you are hacking stuff and the kernel panics instead of booting :-)

Related: How do I find the boot parameters used by the running kernel? | Ask Ubuntu

Ciro Santilli OurBigBook.com
  • 18,092
  • 4
  • 117
  • 102