I'd like to remove the rhgb and quiet kernel parameters which are used by default when the kernel is booted in CentOS 6, but I want this to apply to all currently installed kernels as well as any kernels installed in the future. I need to do this from a script, so manually editing files isn't an option and any file changes should be done as cleanly as possible.

In Debian/Ubuntu I would change GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub and then run update-grub. I can't find such a setting in /etc/sysconfig/grub or /etc/sysconfig/kernel however, nor is there an update-grub script.

2 Answers 2


In Debian/Ubuntu, grub.cfg is fully generated by scripts and any manual changes made to it will be clobbered. In RHEL/CentOS however, grub.cfg is modified by scripts but manual changes are persisted, and is actually the canonical location for certain settings.

The tool which manages grub.cfg is grubby, which is called by /sbin/new-kernel-pkg when kernels are installed or removed. The --copy-default parameter is passed to grubby when a new kernel is installed, which causes it to copy the kernel parameters from the current default kernel. Setting the default kernel parameters for future-installed kernels is therefore done by editing the entry for the default kernel in grub.cfg.

If you weren't automating this you could simply edit grub.cfg manually and change all the current kernel entries. However, you can use grubby to modify grub.cfg in order to avoid parsing it or writing regular expressions. For example, this will remove the rhgb and quiet parameters from the specified kernel version.

# grubby --update-kernel=/boot/vmlinuz-2.6.32-220.13.1.el6.x86_64 --remove-args="rhgb quiet"

There doesn't seem to be an option to list the currently configured kernels however, so you'll have to discover these another way. One option is to just look for vmlinuz files in /boot/:

for KERNEL in /boot/vmlinuz-*; do
    grubby --update-kernel="$KERNEL" --remove-args="rhgb quiet"
  • 5
    You can have it apply to all current and any future kernels by using ALL. grubby --update-kernel=ALL --remove-args="rhgb quiet"
    – benjarrell
    Jul 2, 2013 at 18:04
  • In case someone else is having troubles deciphering this, what it's saying is that any changes you make to the kernel parameters in grub.conf will automatically be added to any kernel updates Oct 30, 2014 at 5:53

We found a solution for CentOS! yum uses grubby itself! (strace, thank you!) grubby has the option "--copy-default" and I think yum runs grubby with it. So only thing you should do is to add in grub.conf all kernel options you need to current default kernel and reboot. After reboot you can install new kernel!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .