Prevent kernel Panic on kernel compilation
This is how you can insure that after compiling a kernel on a remote system you can still have a running system without much bother about kernel panic
This is what the original grub.conf looks like
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-prep)
root (hd0,0)
kernel /vmlinuz-2.6.9-prep ro root=LABEL=/
initrd /initrd-2.6.9-prep.img
Ok so now we have compiled a new kernel (for example 2.6.18-prep) and the grub looks like I’ve added the command of panic=5 (can have panic=* where * is the number of seconds it waits on a panic) at the end this is to reboot the computer in 5 seconds if kernel panics and will boot with default=1 kernel.
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-prep)
root (hd0,0)
kernel /vmlinuz-2.6.18-prep ro root=LABEL=/ panic=5
initrd /initrd-2.6.18-prep.img
title CentOS (2.6.9-prep)
root (hd0,0)
kernel /vmlinuz-2.6.9-prep ro root=LABEL=/ panic=5
initrd /initrd-2.6.9-prep.img
or run
perl -pi -e's/LABEL\=\//LABEL\=\/ panic\=5/g' /etc/grub.conf
But we need to test the default=0 kernel to do this before reboot type
echo "savedefault --default=0 --once" | grub --batch
And then reboot. It will boot once with new kernel. you can check it by uname -r
If the m/c successfully boots with the new kernel go ahead and change the grub to defaults to 0 and reboot once more.
-
Recent
- Linux disk cache
- redhat/centos build kernel rpm
- KVM on centos5
- File Password Protection
- Building modules for rhel5 kernel
- Open SSL help
- Extracting certificates from java keystore to use in apache.conf
- What is bonding?
- Xen rescue paravirtualization
- flash player on firefox 64 bite
- Samba4 HOWTO + Fedora
- MRTG HowTo
-
Links
-
Archives
- July 2010 (3)
- March 2010 (1)
- January 2010 (5)
- December 2009 (1)
- April 2009 (1)
- January 2009 (1)
- November 2008 (12)
-
Categories
-
RSS
Entries RSS
Comments RSS