CentOS / RHEL 6 : How to change the verbosity of debug logs during booting

Removing the rhgb and the quiet kernel command-line parameters, either by editing the /boot/grub/grub.conf file or by using the grub editing mode during boot. Replace these parameters with loglevel parameter. This change is generally sufficient to provide as much data as is needed to debug a boot failure.

The option rhgb is used for graphical boot-up and the quiet option eliminates most of the boot messages.

what loglevels are available

Removing rhgb quiet attributes, increases the verbosity of the boot messages. But if you want to fine-tune the level of verbosity you have to use the below loglevels.

loglevel = All Kernel Messages with a loglevel smaller than the console loglevel will be printed to the console. It can also be changed with klogd or other programs. The loglevels are defined as follows:

0 (KERN_EMERG) system is unusable
1 (KERN_ALERT) action must be taken immediately
2 (KERN_CRIT) critical conditions
3 (KERN_ERR) error conditions
4 (KERN_WARNING) warning conditions
5 (KERN_NOTICE) normal but significant condition
6 (KERN_INFO) informational
7 (KERN_DEBUG) debug-level messages
NOTE : By removing the rhgb quiet attributes increase the verbosity of the boot logs but with the help of loglevel= attribute you can have complete control over what exact level of logs you want to see during boot.

Change verbosity of booting logs from GRUB command line

We can change the GRUB parameters during the boot from the GRUB command line. Note that this is not permanent and usually the preferred way to do.

1. To do this, restart the system and when the GRUB splash screen comes. Select/highlight the kernel you wish to boot using the up/down arrow keys. In my case, I have only one kernel to select :)

2. Press the e key to edit the entry. Select/highlight the line starting with the word kernel.

3. Press the e key to edit the line. Remove the arguments rhgb quiet and add the argument loglevel=7 instead to change the verbosity to highest level. Press ENTER to accept the changes.

Increase verbosity of boot messages persistently across reboots

Edit the file /boot/grub/grub.conf and remove the rhgb and quiet arguments from the kernel lines and and the loglevel=7 parameter instead.

Before:

title Red Hat Enterprise Linux (2.6.32-431.el6.x86_64)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_geeklab-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_geeklab/lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_geeklab/lv_root rhgb quiet console=ttyS0
    initrd /initramfs-2.6.32-431.el6.x86_64.img

After:

title Red Hat Enterprise Linux (2.6.32-431.el6.x86_64)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_geeklab-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_geeklab/lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_geeklab/lv_root console=ttyS0 loglevel=7
    initrd /initramfs-2.6.32-431.el6.x86_64.img

Once these options have been removed from the grub.conf, during future restarts the rhgb progress screen will be disabled, and the verbose boot messages will be displayed.

Related Post