grub.conf file - Correct way to remove the Debug Kernel from booting

heusdens

Active Member
Oct 1, 2013
25
0
1
cPanel Access Level
Root Administrator
Hi

My grub.conf file looks like this:

Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg0-root
#          initrd /initrd-[generic-]version.img
#boot=/dev/vda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.3.1.el6.x86_64.debug)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-431.3.1.el6.x86_64.debug ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-431.3.1.el6.x86_64.debug.img
title CentOS (2.6.32-431.3.1.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-431.3.1.el6.x86_64.img
title CentOS (2.6.32-358.23.2.el6.x86_64.debug)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-358.23.2.el6.x86_64.debug ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-358.23.2.el6.x86_64.debug.img
title CentOS (2.6.32-358.23.2.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-358.23.2.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-358.23.2.el6.x86_64.img
title CentOS (2.6.32-358.18.1.el6.x86_64.debug)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-358.18.1.el6.x86_64.debug ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-358.18.1.el6.x86_64.debug.img
title CentOS (2.6.32-220.4.2.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-220.4.2.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-220.4.2.el6.x86_64.img
title CentOS (2.6.32-220.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-220.el6.x86_64.img
As you can see I have debug kernel versions in there, can I simply remove every section that mentions the debug version and save the conf file to avoid the debug version loading on reboot? Like this?

Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg0-root
#          initrd /initrd-[generic-]version.img
#boot=/dev/vda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.3.1.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-431.3.1.el6.x86_64.img
title CentOS (2.6.32-358.23.2.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-358.23.2.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-358.23.2.el6.x86_64.img
title CentOS (2.6.32-220.4.2.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-220.4.2.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-220.4.2.el6.x86_64.img
title CentOS (2.6.32-220.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/vg0-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg0/swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg0/root
	initrd /initramfs-2.6.32-220.el6.x86_64.img
 

Phincy

Member
Feb 11, 2012
16
0
51
cPanel Access Level
Root Administrator
Basically, the grub will be loading the kernel to which the "default" parameter points to. In your case, it will be title "CentOS (2.6.32-431.3.1.el6.x86_64)". The grub counts from 0. So, as you can see, your second configuration will be loading the kernel "CentOS (2.6.32-358.23.2.el6.x86_64)".
The second configuration is fine, just with a modification of "default=1" to "default=0", if you want the kernel title CentOS (2.6.32-431.3.1.el6.x86_64) load.

Hope this helps.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

I am happy to see you were able to find a solution. I am marking this thread as [Resolved].

Thank you.