[SOLVED] grubby fatal error unable to find a suitable template

Support for the other architectures (X86_64, IA-64, and PowerPC)
spookie2005
Posts: 35
Joined: 2009/06/19 18:35:27

[SOLVED] grubby fatal error unable to find a suitable template

Post by spookie2005 » 2010/10/09 15:11:53

Hello,

When trying to update Centos I get the "grubby fatal error unable to find a suitable template" when trying to install a new kernel

This is my menu.lst
[code]
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,6)
# kernel /boot/vmlinuz-version ro root=/dev/hda7
# initrd /boot/initrd-version.img
#boot=/dev/hda
timeout=5
splashimage=(hd0,6)/boot/grub/splash.xpm.gz
hiddenmenu
title Other
rootnoverify (hd0,0)
chainloader +1
title Kubuntu
rootnoverify (hd0,5)
chainloader +1
[/code]
This is my grub.conf[code]
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,6)
# kernel /boot/vmlinuz-version ro root=/dev/hda7
# initrd /boot/initrd-version.img
#boot=/dev/hda
timeout=5
splashimage=(hd0,6)/boot/grub/splash.xpm.gz
hiddenmenu
title Other
rootnoverify (hd0,0)
chainloader +1
title Kubuntu
rootnoverify (hd0,5)
chainloader +1[/code]
Looks just the same doesn't it?:-) It might explain why I get this error but what I want to do is when there is a new kernel the centos-grub.conf is automatically updated so I can copy & paste the new kernel-entry into my Fedora-menu.lst which I use to boot my computer without having to watch if there is a new kernel available in the updates-list and having to write it down to change the previous centos entry in my Fedora grub to this kernel,it ALSO works but it can a lot easier,I think!

Any ideas?
[Moderator edit: Added [i]code[/i] tags to preserve formatting.]

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: grubby fatal error unable to find a suitable template

Post by AlanBartlett » 2010/10/09 16:46:38

[quote]
Any ideas?
[/quote]
Sure. First, the basics --

[code]
[ajb@stxsl ~]$ ll /etc/grub.conf
lrwxrwxrwx 1 root root 22 Oct 24 2007 /etc/grub.conf -> ../boot/grub/grub.conf
[ajb@stxsl ~]$ ll /boot/grub/menu.lst
lrwxrwxrwx 1 root root 11 Oct 24 2007 /boot/grub/menu.lst -> ./grub.conf
[ajb@stxsl ~]$ ll /boot/grub/grub.conf
-rw-r--r-- 1 root root 1421 Oct 7 16:29 /boot/grub/grub.conf
[ajb@stxsl ~]$
[/code]
That explains why your [i]menu.lst[/i] and [i]grub.conf[/i] look the same -- they are just symbolic links to the same file. The physical file to which those symlinks point is [i]/boot/grub/grub.conf[/i]. ;-)

[quote]
"grubby fatal error unable to find a suitable template"
[/quote]
The error is telling you that [i]grubby[/i] can not find a suitable stanza within your [i]/boot/grub/grub.conf[/i] file to use as a template, when attempting to write a new stanza for the new kernel which is currently in the process of being installed. Basically, it is looking for lines such as --

[code]
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 quiet
initrd /initrd-2.6.18-194.el5.img
[/code]
-- for example. And your [i]/etc/grub.conf[/i] file does not contain anything like that.

spookie2005
Posts: 35
Joined: 2009/06/19 18:35:27

Re: grubby fatal error unable to find a suitable template

Post by spookie2005 » 2010/10/09 18:00:24

OK, thank you Alan! And how can I "help grubby to find a suitable stanza"?

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: grubby fatal error unable to find a suitable template

Post by AlanBartlett » 2010/10/09 22:20:17

With a spot of lateral thinking, I was hoping you might decide to copy / paste the example that I have shown (at the end of my previous post) into your [b]/etc/grub.conf[/b] file.

Another way, might be to take a copy of the commented out lines, found towards the top of your [b]/etc/grub.conf[/b] file and past something like the following at the bottom --

[code]
title CentOS Template Stanza
root hd(0,6)
kernel /boot/vmlinuz-version ro root=/dev/hda7
initrd /boot/initrd-version.img
[/code]

spookie2005
Posts: 35
Joined: 2009/06/19 18:35:27

Re: grubby fatal error unable to find a suitable template

Post by spookie2005 » 2010/10/10 05:46:35

[quote]
AlanBartlett wrote:
With a spot of lateral thinking, I was hoping you might decide to copy / paste the example that I have shown (at the end of my previous post) into your [b]/etc/grub.conf[/b] file.

Another way, might be to take a copy of the commented out lines, found towards the top of your [b]/etc/grub.conf[/b] file and past something like the following at the bottom --

[code]
title CentOS Template Stanza
root hd(0,6)
kernel /boot/vmlinuz-version ro root=/dev/hda7
initrd /boot/initrd-version.img
[/code][/quote]

Auwch,that hurts :lol: I just had a really bad day yesterday,I'll give it a try!

Thanks again....

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[SOLVED] grubby fatal error unable to find a suitable templa

Post by pschaff » 2010/10/10 13:25:00

This thread seems to beg the question (perhaps a moot point by now):

What happened to remove the CentOS kernel/initrd stanza from /boot/grub/grub.conf in the first place? The system should not have booted without it.

Is there perhaps a backup copy (manual or from the editor) hanging around from which it could be restored?

Using the chainload technique in the Fedora grub.conf to boot to CentOS grub will avoid having to put the CentOS kernels there explicitly, and if you are using Fedora as the "master" GRUB there is no need to have the chainload stanzas in the CentOS /boot/grub/grub.conf.

spookie2005
Posts: 35
Joined: 2009/06/19 18:35:27

Re: grubby fatal error unable to find a suitable template

Post by spookie2005 » 2010/10/10 16:41:36

[quote]
pschaff wrote:
This thread seems to beg the question (perhaps a moot point by now):

What happened to remove the CentOS kernel/initrd stanza from /boot/grub/grub.conf in the first place? The system should not have booted without it.

Is there perhaps a backup copy (manual or from the editor) hanging around from which it could be restored?

Using the chainload technique in the Fedora grub.conf to boot to CentOS grub will avoid having to put the CentOS kernels there explicitly, and if you are using Fedora as the "master" GRUB there is no need to have the chainload stanzas in the CentOS /boot/grub/grub.conf.[/quote]

To be honest?I haven't got a clue what happened...Maybe there is somewhere a backup-copy....The only thing I know is:I always watch the updates-list...When I see a new kernel in this list,I write it down...When everything is updated I reboot and I only have to change the kernels version in my "master' grub:Fedora...I start my system again,and it works(?)
When I do uname -r,the kernel version I just installed is displayed,so I guess I'm working with the correct kernel version....(?)I have 6 linux systems on my computer.When,i.e. Ubuntu is updated with a new kernel,I only have to copy paste this into my "master' Grub and this works also!I used to do the same with Centos,it should be possible to do it again....So i'm trying to find out what is happening,and now I will start looking for this "possible-backup-copy".....If someone has an idea where to look,please tell me :-)

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: grubby fatal error unable to find a suitable template

Post by pschaff » 2010/10/10 22:12:38

If there is a backup it would most likely be in /boot/grub/. Your method is a lot more labor-intensive and error-prone than just writing each "slave" GRUB boot record (I think this works with LILO as well) to the boot partition for the distro and letting the master GRUB chainload it. Each distro updates its own kernels "automagically". I have one system with 4 Linux distros and Ubuntu as the master GRUB. The relevant stanzas are:[code]
title chainload CentOS GRUB
root (hd0,0)
chainloader +1

title chainload Fedora 13
root (hd0,2)
chainloader +1

title chainload RHEL6 Beta 2
root (hd1,0)
chainloader +1
[/code]

spookie2005
Posts: 35
Joined: 2009/06/19 18:35:27

Re: grubby fatal error unable to find a suitable template

Post by spookie2005 » 2010/10/20 05:05:47

I'm waiting now for a new kernel to see what will happen....

spookie2005
Posts: 35
Joined: 2009/06/19 18:35:27

Re: grubby fatal error unable to find a suitable template

Post by spookie2005 » 2010/11/23 07:16:29

Hi,This isn't really relevant anymore,now I have another problem,I installed the new linux mint and this is my new master grub.When I trie to boot CentOS it gives an error telling to give a valid root option...Here are my entries:

[code]
menuentry "CentOS release 5.5 (Final) (on /dev/sda7)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 7d3e7bc2-2563-4090-b3e5-eecc92ca8dbd
linux /boot/vmlinuz-2.6.18-194.11.3.el5 root=/dev/sda7
}
menuentry "CentOS release 5.5 (Final) (on /dev/sda7)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 7d3e7bc2-2563-4090-b3e5-eecc92ca8dbd
linux /boot/vmlinuz-2.6.18-194.17.1.el5 root=/dev/sda7
}
menuentry "CentOS release 5.5 (Final) (on /dev/sda7)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 7d3e7bc2-2563-4090-b3e5-eecc92ca8dbd
linux /boot/vmlinuz-2.6.18-194.17.4.el5 root=/dev/sda7
[/code]
Someone who can tell me how to change it so I can boot CentOS again?

Post Reply

Return to “CentOS 5 - X86_64,s390(x) and PowerPC Support”