www.linux-noob.com: grub single boot and kernel panic reboot - www.linux-noob.com

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

grub single boot and kernel panic reboot

#1 User is offline   FluKex

  • Linux-Noob Member
  • PipPip
  • Group: Members
  • Posts: 57
  • Joined: 11-December 03

Posted 16 April 2007 - 08:34 PM

So, over the past while i have been working on getting a new kernel working on my system. The problem i was having is that the newer kernels i use are not loading the sata modules properly from the initrd images.

When trying to fix this i would run into the scnenario whereas, i reboot using the new kernel and if it kernel panics, i then have to file a ticket with my hosting provider to reboot the system and select the old kernel.

I have now found 2 ways around this that might be useful for anyone who does a lot of kernel testing.

1.) Booting once-only - (same as lilo -R)

In reference to http://www.gnu.org/s...g-once_002donly

in grub.conf, add the following line to the beginning.

default saved

If for example your grub.conf looks like the one i have below. This boots into the 2.6.20-1.2944 by default.
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.20-1.2944.fc6)
        root (hd0,0)
        kernel /vmlinuz-2.6.20-1.2944.fc6 ro root=LABEL=/ acpi=off 
        initrd /initrd-2.6.20-1.2944.fc6.img
title Fedora Core (2.6.20-FluKex.com)
        root (hd0,0)
        kernel /vmlinuz-2.6.20-FluKex.com ro root=LABEL=/ acpi=off 
        initrd /initrd-2.6.20-FluKex.com.img


If you want to have it so that 2.6.20-FluKex.com boots on next boot, run the following command from the console before rebooting.
echo "savedefault --default=1 --once" | grub --batch
then
reboot

Now, if you have a kernel that panics and need it to reboot if it panics. change your config and add the panic=# (# being seconds before auto reboot) to the kernel line. Example file below
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.20-1.2944.fc6)
        root (hd0,0)
        kernel /vmlinuz-2.6.20-1.2944.fc6 ro root=LABEL=/ acpi=off panic=5
        initrd /initrd-2.6.20-1.2944.fc6.img
title Fedora Core (2.6.20-FluKex.com)
        root (hd0,0)
        kernel /vmlinuz-2.6.20-FluKex.com ro root=LABEL=/ acpi=off panic=5
        initrd /initrd-2.6.20-FluKex.com.img




so the order of operations on this are as follows.

1.) Add new kernel to grub.conf
2.) set default=# in grub.conf to the failsafe kernel (the one you want it to try if the other fails)
3.) run the following:
echo "savedefault --default=1 --once" | grub --batch
4.) reboot

This will try the flukex.com kernel, and if it panics, it will reboot and use the normal default kernel.

BLAM works for me.
sig removed due to indecency
0

#2 User is offline   FluKex

  • Linux-Noob Member
  • PipPip
  • Group: Members
  • Posts: 57
  • Joined: 11-December 03

Posted 16 April 2007 - 08:35 PM

btw, it looks as though fedora core 6 has removed the "grub-set-default" option and does not use the /boot/grub/default file. There are a few different methods on how to do a "once only" boot with grub, but unforuntately fedora can only do the 1 i posted above.
sig removed due to indecency
0

#3 User is offline   Randall

  • Hates Microsoft
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 12-August 04

Posted 16 April 2007 - 08:51 PM

Nice work.
0

#4 User is offline   anyweb

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 3,266
  • Joined: 11-December 03

Post icon  Posted 16 April 2007 - 09:51 PM

agreed, thanks flukex for posting this

cheers
anyweb
My linkedin profile at > linkedin.com
My personal website is > niallbrady.com
0

#5 User is offline   znx

  • Linux-Noob GURU
  • PipPipPipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 1,236
  • Joined: 21-March 05

Posted 17 April 2007 - 01:32 PM

Nice ;)
0

#6 User is offline   xDamox

  • Linux-Noob Frequent Member
  • PipPipPip
  • Group: Members
  • Posts: 390
  • Joined: 13-December 04

Posted 17 April 2007 - 04:51 PM

Yea Nice post :)
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users





The G2-style Tux and the header images using them are licensed under Creative Commons BY-NC-SA. The G2-style Tux images are all from http://crystalxp.net.
Thanks to users kami23, lilitux, iva, overlord59, whidou, brightknight, emulienfou on the Crystal XP Tux Factory site.