Booting CentOS v5.2 fails with GRUB error 13: Invalid executable format

General support questions including new installations
Locked
nilie
Posts: 3
Joined: 2009/05/05 04:02:11

Booting CentOS v5.2 fails with GRUB error 13: Invalid executable format

Post by nilie » 2009/05/05 04:36:10

Hello everybody,

I'm trying to install a dual booting machine with OpenSUSE v11.1 32bit and CentOS v5.2 64bit. I installed OpenSUSE first and allowed it to install and configure grub in the MBR and after that I wanted to proceed with CentOS v5.2. The installation went fine with two notable exceptions:
- when I had to configure grub installation parameters, CentOS offered me only 2 solutions: either install it on the MBR of the first hard disk or not installing it at all. Other distributions are more flexible allowing you to install it in the boot sector of the root partition for example. Because I didn't want to ruin the existent grub configuration, I reluctantly accepted not to install it for CentOS assuming that I could manually configure the entry later in grub's menu.lst file.
- when I was presented with the options for software components installation, I've clicked on virtualization category/function because I intend to use the machine as a VMware host. There was no guidance on screen at that point and I blindly assumed that by choosing the virtualization function I would get necessary tools and drivers that will help me further on. It seems that this was a wrong move as you can see it below.

After completing the installation, I tried to search for a template or guiding on how the menu entry in menu.lst should look like but the grub directory was empty, not surprisingly because I've told CentOS earlier not to install it. Using the files in the /boot directory from the CentOS installation I tried to improvise a menu entry but it's not working. The boot stops with famous Error 13: Invalid or unsupported executable format. Using the file command to check what kind of files I'm trying to load as kernels I'm getting :

marte:~ # file /mnt/vmlinuz-2.6.18-92.el5xen
/mnt/vmlinuz-2.6.18-92.el5xen: gzip compressed data, from Unix, last modified: Tue Jun 10 19:20:51 2008, max compression
marte:~ # file /boot/vmlinuz-2.6.27.21-0.1-pae
/boot/vmlinuz-2.6.27.21-0.1-pae: Linux/x86 Kernel, Setup Version 0x209, bzImage, Version2.6.27.21, RO-rootFS, root_dev 0x809, swap_dev 0x2, Normal VGA

Obviously, the CentOS kernel file is not in the right format and the xen word gave me a bad feeling. Doing a little research, I found that the xen kernel contains a Linux kernel that runs on the Xen hypervisor and that the linux kernel used by Xen is in a different format than Grub expects.
That's why I said that choosing virtualization without knowing the consequences was a mistake.

My question is should I try to fiddle with grub an menu.lst to make the current installation work or It would be better to reinstall CentOS without the virtualization component. A secondary question would be can anyone post here an example of a menu entry in menu.lst for xen kernel ?

Thanks

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

Booting CentOS v5.2 fails with GRUB error 13: Invalid execut

Post by pschaff » 2009/05/05 12:45:58

[quote]
nilie wrote:
Hello everybody,

I'm trying to install a dual booting machine with OpenSUSE v11.1 32bit and CentOS v5.2 64bit.
[/quote]
The current CentOS version is 5.3. You are likely to encounter issues that are already fixed by using an obsolete version.

[quote]
- when I had to configure grub installation parameters, CentOS offered me only 2 solutions: either install it on the MBR of the first hard disk or not installing it at all. Other distributions are more flexible allowing you to install it in the boot sector of the root partition for example.
[/quote]
Not true. The "advanced" options for GRUB definitely allow installation on the boot partition as an option.

[quote]
- when I was presented with the options for software components installation, I've clicked on virtualization category/function because I intend to use the machine as a VMware host.
[/quote]
Wrong option for VMware. Those options are related to RHEL virtualization options, not VMware - as you later discovered.

At this point re-installing may be the easiest option - particularly as you started with an old version. Choose to put grub on the CentOS / or /boot partition.

If you want to try to recover, use the GRUB command-line completion capabilities to construct the GRUB kernel and initrd lines. This assumes that the OpenSUSE bootloader can handle a 64-bit kernel. Not necessarily true. A valid boot stanza from /boot/grub/grub.conf (menu.lst is a symbolic link) for a system without a /boot partition looks like this:
[code]
title CentOS (2.6.18-128.1.6.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-128.1.6.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-128.1.6.el5.img
[/code]

A system with a /boot using LVM looks like:
[code]
title CentOS (2.6.18-128.1.6.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-128.1.6.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-128.1.6.el5.img
[/code]
You would of course need kernel-xen.
Another option would be to boot from the installation media in rescue mode, chroot to the installed system, and use grub-install to write a boot record on the boot partition. Not sure how well that will work since you chose not to install GRUB originally, but if it does you could chainload that from OpenSUSE GRUB.

If you get it up and running, can then use
[code]
yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum install kernel kernel-devel
yum update
[/code]
That should get you the standard kernel and all updates.

nilie
Posts: 3
Joined: 2009/05/05 04:02:11

Re: Booting CentOS v5.2 fails with GRUB error 13: Invalid executable format

Post by nilie » 2009/05/07 04:24:39

Thank you very much for your suggestions, Phil.

Let's take it from the beginning.
The version is really 5.3, my installation DVD was wrongly labeled. Sorry for this!
I've formatted all CentOS partitions and did a clean install this time without checking the box for virtualization. When installing grub I looked for advanced options but again, I did not see anything that would allow me to install grub somewhere else. However I still take your word and promise to be more careful for the installations to come. I put a minimal entry in the menu.lst file for CentOS and this time everything went ok, I'm able to boot 32bit or 64bit with no problem. At first I was a little bit worried when grub displayed that it can see only 3GB of RAM knowing that I have 8GB installed and I thought grub might give me troubles with the 64bit kernel but no, my 64it CentOS shows it can use all the available memory.
Also thanks for the samples of menu.lst you posted.

Nicu

xtdz32
Posts: 18
Joined: 2016/03/18 12:49:10

Re: Booting CentOS v5.2 fails with GRUB error 13: Invalid executable format

Post by xtdz32 » 2018/04/12 11:47:23

Greetings,
i am having the same similar challenge, stuck somewhere.
kernel /vmlinuz-2.6.32xxxxx root=<???????> Please what is the root label there ? i tried sda, it didnt go, i tried sdb and it didnt work too. that is the only place am stuck

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Booting CentOS v5.2 fails with GRUB error 13: Invalid executable format

Post by TrevorH » 2018/04/12 12:12:57

Please don't hijack ancient threads. Make your own post in the relevant forum section with a good, descriptive subject line that tells people about your problem. Post enough details so that people can help you without needing to ask for more info. Since you're apparently using a 2.6.32 kernel you are not using CentOS 5 - which is lucky because it's been End Of Life for more than a year now - but most likely it's CentOS 6 so you should use one of the C6 forums.

This topic is now closed and locked.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Locked