[one-liner]: What options were used to boot my Linux Kernel?

Background

In newer versions of Linux distros the GRUB2 configuration file is often times locked down so that you need sudo rights to see what options the Linux Kernel was booted with. Using the following tip you can see these options as just a regular “joe” user.

Solution

This tip is pretty straightforward, since now the options are reflected under the /proc filesystem so that anyone can see them. Here’s an example from my Fedora 19 laptop:

1
2
$ cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-3.13.6-100.fc19.x86_64 root=/dev/mapper/fedora_greeneggs-root ro rd.md=0 rd.dm=0 vconsole.keymap=us rd.lvm.lv=fedora_greeneggs/swap rd.lvm.lv=fedora_greeneggs/root rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8

You can also get them using the more convention method via sudo:

1
2
3
4
5
$ sudo grep -E "\s+linux" /boot/grub2/grub.cfg 
	linux	/vmlinuz-3.13.6-100.fc19.x86_64 root=/dev/mapper/fedora_greeneggs-root ro rd.md=0 rd.dm=0 vconsole.keymap=us rd.lvm.lv=fedora_greeneggs/swap  rd.lvm.lv=fedora_greeneggs/root rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8
	linux	/vmlinuz-3.13.5-103.fc19.x86_64 root=/dev/mapper/fedora_greeneggs-root ro rd.md=0 rd.dm=0 vconsole.keymap=us rd.lvm.lv=fedora_greeneggs/swap  rd.lvm.lv=fedora_greeneggs/root rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8
	linux	/vmlinuz-3.12.11-201.fc19.x86_64 root=/dev/mapper/fedora_greeneggs-root ro rd.md=0 rd.dm=0 vconsole.keymap=us rd.lvm.lv=fedora_greeneggs/swap  rd.lvm.lv=fedora_greeneggs/root rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8
	linux	/vmlinuz-0-rescue-0ee868f8b7da40f48013a281826b1b84 root=/dev/mapper/fedora_greeneggs-root ro rd.md=0 rd.dm=0 vconsole.keymap=us rd.lvm.lv=fedora_greeneggs/swap  rd.lvm.lv=fedora_greeneggs/root rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet

References

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

This entry was posted in kernel, linux, one-liner, Syndicated, tips & tricks. Bookmark the permalink.

Comments are closed.