Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to modify boot kernel? 1

Status
Not open for further replies.

nerbonne

Technical User
Dec 11, 2006
99
US
Ok, I have a dedicated server, and every time I reboot it, the kernel panicks. The thing is that I didn't do any kernel updates, but thats not the point, the point is I need to make it so it boots with the older kernels by default. Can anyone give me a quick run down on how to do that?
 
Your system uses a "boot loader" to control which kernel is loaded.

Most likely your boot loader is 'grub', but could also be 'lilo' and (less likely) a few others.

Read up on grub, hunt for the config files (if it's your boot loaded) and direct the configuration to launch your desired kernel.

D.E.R. Management - IT Project Management Consulting
 
If it is grub you can hit "e" to edit the grub conf. You just need to point it to the old kernel.

An alt method is to just boot a live disk and then mount /boot and do a manual edit to the conf.

Gb0mb

........99.9% User Error........
 
Ok, my bad. I wasn't very descriptive. I have a dedicated server and I have root ssh access. My boot loader is grub. I cannot modify it during boot because I don't have a console connection, and I can't use any GUI procedures (obviously).

How it has been getting fixed before is the support personnel at he NOC hook up a console and tell it to use an older kernel to boot. Unfortunately, they don't make it permanent. Why? I don't know.

Here is what support wrote to me:

-----

Dear Customer,

I placed a console to investigate and found that kernel 2.6.9-55.0.12 ELsmp was creating a kernel panic. I rebooted the server using an older kernel 2.6, 9-55. ELsmp. It is now online and responding to network requests.

Thank you,
Support

-----

I know there is a file somewhere you can edit to specify the kernel. I'm just not sure how you pick what kernel.

Thanks for the help.
 
It should be in /boot/grub/grub.conf. This is the file it looks to when booting.

Gb0mb

........99.9% User Error........
 
If this is a RedHat-system,the config-file for Grub is /boot/grub/grub.conf
So what you have to do is:
1. Become root on the system. su
2. Make a backup of the original file. cp /boot/grub/grub.conf /boot/grub/grub.conf.backup
3. Open the file for editing.
4. Find the section that look something like:
title Red Hat Linux (2.6.9-55.0.12.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-55.0.12.ELsmp ro root=/dev/sda1
initrd /initrd-2.6.9-55.0.12ELsmp
and replace the 2.6.9-55.0.12 ELsmp
with the right kernel 2.6.9-55.ELsmp
5. Save the file.
6. Try a reboot when you can afford some downtime,
just in case...
 
Thanks.

I changed it to:

#boot=/dev/sda
default=9
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu


Default used to be 1. I'm assuming that 1 is the first entry, and that there is no default=0, otherwise my kernel will be off one.
 
at geirendre, do you think I should change the default=9 back to 1 and use your method, or will I be ok with what I have?

Thanks
 
To have multiple options and use default to choose
one of the options I think is the best solution.
That way you can test each one first and then set
that as the default option.
Default starts counting at 0, but 0 might be a header-line
in your grub menu.
grep ^title /boot/grub/grub.conf
should show you each option, starting with 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top