Fedora Linux Support Community & Resources Center
  #1  
Old 30th January 2008, 02:41 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Question GRUB: "Error 13: Invalid or unsupported executable format" on standard kernel

We have a new PC, with 2G RAM, Intel Core duo E4500 (64-bit) and
ST325041 0AS SCSI Disk, running Vista. My last Linux install was
RedHat 5.3, a decade ago :-).

We first freed 20G of disk to make room for Linux. No issue.

Then we tried installing to disk from Fedora-8-x86_64-DVD, but
this failed for unknown reasons (the last messages seem to
indicate problems with /dev/sda -- it also made Vista slow to
start until we zapped the two partitions Fedora had created in
the freed space). So we decide to try and install to a 4G flash
drive instead, and from a live CD.

We booted from Fedora-8-Live-x86_64, no problem, then ran the
"Install do disk". This ran to completion with no apparent
problem. I hadn't yet understood much about GRUB, so I don't
know exactly what I answered, but I avoided the HDD's MBR.

This created two partitions on the flash drive: ~200M (/boot)
and 3.7G (LVM -- with no swap). The resulting /boot can be
mounted from the live CD (as /dev/sdb1).

Then, in Vista, we added the /boot partition using EasyBCD.
Given what happens next, this must be where GRUB was installed
(and not the MBR of the flash drive).

On rebooting, Vista's boot environment presents us with both
choices. If I select Linux, I end up with the "grub>" prompt
after an error message about not being able to boot.

But there I can't get the kernel loaded.

grub> root (hd0,0)
grub> kernel (hd0,0)/vmlinuz-2.6.23.1-42.fc8

This last command gives:

Error 13: Invalid or unsupported executable format

So obviously I am finding the kernel in the /boot partition.
Other names give "File not found".

I rebooted from the live CD, and ran cksum on the kernel in my
flash drive, and on the live CD, and it gives the same result.

# file vmlinuz-2.6.23.1-42.fc8

gives

Linux kernel x86 boot executable RO-rootfs, swap_dev 0x1,
normal VGA

I tried adding --type=linux and other variants, to no avail.

Any thoughts? Does the fact that this is a 64-bit OS play a role
here (altho the kernel starts running in 32 bit?). On the web,
the explanations I found seem to relate to incorrectly rebuilt
kernels (not the case here).

Tia,
Grounder
Reply With Quote
  #2  
Old 30th January 2008, 11:47 PM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,550
If this is true...
Quote:
Originally Posted by grounder
The resulting /boot can be
mounted from the live CD (as /dev/sdb1).
Then this has to be wrong...(EDIT: actually, it could be right. My mistake. Brain freeze. See apology farther below.)
Quote:
Originally Posted by grounder
But there I can't get the kernel loaded.

grub> root (hd0,0)
grub> kernel (hd0,0)/vmlinuz-2.6.23.1-42.fc8
And as I think you know, if Vista is to boot Fedora as you say here...
Quote:
Originally Posted by grounder
Then, in Vista, we added the /boot partition using EasyBCD.
...then GRUB should have been installed in the first sector of the Fedora boot partition.

Hello grounder,

Take a moment to clear it all up by using the find command at that grub> prompt to locate the boot partition and see what GRUB is naming it. Example...
Code:
grub> find /grub/stage1
The result will be the drive and partition of your boot partition as GRUB names it. When you get that information, use your Fedora DVD and linux rescue to edit your grub.conf file accordingly. If GRUB was installed in the first sector of the Fedora boot partition, then the Vista boot loader should launch Fedora.

P.S.: If you didn't locate the stage files with find from that grub> prompt that is appearing after your aborted boot attempts, then do it again in linux rescue with your Fedora DVD.

P.P.S.: I sort of wandered off the reservation for a few minutes earlier. It certainly IS possible for hd0 to be mapped to /dev/sdb. That is common and not a big deal. To be totally honest, I was distracted by the partition, not the drive. Everybody learns in their first week that the operating system doesn't use a zero for the first partition. But the truth is, I forgot for a minute. I apologize for messing with your mind.

Last edited by stoat; 1st February 2008 at 06:02 PM.
Reply With Quote
  #3  
Old 31st January 2008, 12:08 AM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Yes, this intrigued me too. If it was /dev/sdb1 from the live CD, why would it become (hd0) in GRUB? I concluded that GRUB saw things its own way and assigned 0 to the device it started from. Anyway, I will try the find command for sure! I did try that command, but with find /vmlinuz which didn't find anything. Does GRUB grok NTFS? Then I could also try to find some Vista file as extra confirmation.

But irrespective, I still think I found the correct partition, surely there is no vmlinuz on my Vista HDD? If I don't put the correct file name, I get a different error (file not found). In fact, I had to reboot into the live CD because I couldn't guess the kernel's name (I was expecting a simple name such as vmlinuz, not a name fully qualified with version). So I must be looking at a partition that really has a file with that name. Unless both FS on my USB have the kernel?

Another thing which I wondered about. Might the kernel's file permissions be incorrect? Ie. missing the x bit? I'll check from the live CD. Also, could a FS type (ext2 vs ext3) generate such an error? Maybe GRUB does not guess correctly? Shots in the dark.

The other two avenues I'll be considering: re-installing again (paying careful attention to the GRUB questions), and looking at the GRUB source code for hints as to how exactly it got to this message.

Thanks for your suggestions!
Reply With Quote
  #4  
Old 31st January 2008, 01:03 AM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,550
grounder,

Reading your posts again and thinking about it all, I now believe you likely were aiming at the correct partition as you believed all along. Booting to a grub> prompt like that usually means the stages ran but the grub.conf file is missing or badly misconfigured. Perhaps it all has to do with installing to that flash drive. In older HOWTOs, people would include steps to create a custom initial ramdisk with USB storage modules. Whereas HOWTOs involving later Fedora versions sometimes don't. I don't have any operating systems on USB drives, so I don't know everything that you need to know about all that. But before you reinstall the whole thing, it might be worth a few minutes to attempt to reinstall GRUB in linux rescue. Also examine the grub.conf while in linux rescue. It's worth a try. If it doesn't work, then you could just try it all again.

Last edited by stoat; 1st February 2008 at 06:03 PM.
Reply With Quote
  #5  
Old 31st January 2008, 01:37 AM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
All the manual has to say about this error is following:
13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD).

This doesn't tell me why a working kernel (it's the same as on the live CD) confuses GRUB (does the live CD use GRUB?). That being said, looking at the code might not help me without much patience.

I'm off to trying a few things.

Thanks again.
Reply With Quote
  #6  
Old 31st January 2008, 12:41 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
I didn't have much time, but I did a few experiments, with surprising results. I think your recommendation to do some serious reading is the right one.

From the grub prompt, I tried "find /grub/stage1". It found nothing!
Yet "find vmlinuz-2.6.23.1-42.fc8" does find something, it returns "(hd0,0)".
So what GRUB am I running that can't even find itself?

The other interesting thing I found. GRUB thinks my /boot partition is ext2, yet, from the live CD, it is reported (fdisk -l) as ext3.
So maybe I should try "grub> parttype (hd0,0) ??".

Anyway, I have some serious reading to do: first the GRUB manual, then the EasyBCD documentation. The GRUB I am running is perhaps stored on Vista, ie it's NeoGrub, and it is perhaps not a version that can deal with my setup. Perhaps I need to read a good discussion of Linux booting too.

When, from the Vista boot environment, I select Linux, the first thing I see is:

Bootpart 2.60 bootsector ... www.winimage.com/bootpart.htm
...
Cannot load from hard disk
Insert a system disk then hit any key (~)

At this point, I hit enter, and I get to stage 2 of GRUB.

If I look at the Vista boot environment settings, the 2nd entry for Linux points to a file, C:\NST\nst_grub.mbr, a 512-byte file that contains the messages listed above. I was expecting this second entry of Vista's boot environment would directly load the first sector of my /boot partition, in which case I might have been just fine. There is some magic going on here I don't understand yet.

Thanks for all the good discussion and hints! I'll be trying Linux Rescue or boot.iso.

Final comment. The GRUB config on the /boot partition seems plausible from what I understand so far.
Reply With Quote
  #7  
Old 31st January 2008, 01:30 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Quote:
Originally Posted by grounder
From the grub prompt, I tried "find /grub/stage1". It found nothing!
Yet "find /vmlinuz-2.6.23.1-42.fc8" does find something, it returns "(hd0,0)".
So what GRUB am I running that can't even find itself?
One more note. On the /boot partition itself, both files are there; also I missed the / before vmlinuz above when typing previous post.

If indeed it is NeoGrub that I am running, can one GRUB chain to another (this whole business of chaining is still not clear at all, I need to read)? But it's nice to have some problems, at least I'll learn a bit...
Reply With Quote
  #8  
Old 31st January 2008, 10:57 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Am I having fun :-(. After a fair bit of reading on GRUB, I played again.

I ran GRUB from the live CD where my drive now becomes (hd1,0). I did "setup (hd1,0)". I thought that would put a boot record at the beginning of this partition, but maybe it puts an MBR at the very beginning of the disk. Anyway, I ended up with a totally unbootable PC (it stopped on the vendors power-up image). Until I removed the USB drive. Ouff, I still have Vista (my son would have been very disappointed!). So I assume somehow the MBR on this USB drive has been set.

Then I reinstalled Fedora on it, paying attention to put GRUB in the boot partition, not at the top level. Still the PC wouldn't reboot. Perhaps the re-install didn't wipe out the MBR? Maybe I should first reformat the drive entirely?

In my BIOS, "removable" is the first entry, perhaps I should remove that, and then it wouldn't try to boot from the USB. Fdisk -l doesn't say anything (that I've seen so far) on whether there is an MBR.

Now I wonder how I can tell if indeed the whole drive is bootable, and how I can reset that to non-bootable. Anyway, a great learning exercise.

Btw, I found a GRUB on my Vista partition, surely installed as part of EasyBCD. I suspect that's what I was running yesterday.
Reply With Quote
  #9  
Old 1st February 2008, 12:29 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Quote:
Originally Posted by grounder
I ran GRUB from the live CD where my drive now becomes (hd1,0). I did "setup (hd1,0)". I thought that would put a boot record at the beginning of this partition, but maybe it puts an MBR at the very beginning of the disk. Anyway, I ended up with a totally unbootable PC (it stopped on the vendors power-up image). Until I removed the USB drive. Ouff, I still have Vista (my son would have been very disappointed!). So I assume somehow the MBR on this USB drive has been set.
I guess it works differently (after more reading). Something determines that there is a bootable partition on this drive and tries booting it. I don't what code there is in my USB drive's MBR, but I guess it doesn't play well with GRUB in the /boot partition. What is still unclear to me: who determines if there is a bootable partition on a drive? Code in the BIOS, or the small bit of code in the MBR?

Anyway, I'm looking for a way to mark a partition "inactive" (ie. to undo a grub> makeactive). Haven't found yet.

If I buy a new USB flash drive, pre-formatted, will it already have some code in the MBR? What would that code be for? I did look at an USB drive I have (head --bytes=512 /dev/sdc > foo; hexedit foo), and it's not empty as I thought. More to learn.
Reply With Quote
  #10  
Old 1st February 2008, 12:51 PM
PHPDUMMY Offline
Registered User
 
Join Date: Feb 2008
Posts: 24
personally , i dont find any use for windows as it's always been a money scam . as i've read into the differences between windows and linux , i've found that "The big name O.S." find it cheaper to just put up with the crashes but then that gets passed onto you the consumer , as the consumer tends to buy more flash drives , c.d.'s , & dvd's to make all kind of back ups.

If i were to use the windows o.s. on the same h.d. i believe that i would totally start over . first i'd
Create an I.S.O. Live C.D. ( not the DVD )
then,
low-level & D.O.D. Format my H.D.
then,
install Fedora ,
then,
(update Fedora)
then,
Create a new partition in Fedora to set windows in
then,
install windows into this partition.

Now when you start up your computer , Fedora will ask you which O.S. to boot into.

Maybe I'm wrong.......
Reply With Quote
  #11  
Old 1st February 2008, 01:01 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Found an interesting web page: http://www.geocities.com/thestarman3...r/Win2kmbr.htm .

It's the MBR on the drive that looks for an active partition. The MBR described above as Win2K MBR is what I find on my old USB flash drive that is used for data only (at least up to the searching part incl.). The MBR on the USB flash drive on which I installed Linux is different, but shows similarities with the boot record in /boot.
Reply With Quote
  #12  
Old 1st February 2008, 05:06 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Quote:
Originally Posted by PHPDUMMY
personally , i dont find any use for windows ...

Now when you start up your computer , Fedora will ask you which O.S. to boot into.

Maybe I'm wrong.......
I certainly wouldn't say you're wrong.

I could do it that way too. But that would mean re-installing Vista from scratch, that would be my last option (one of the reasons I hesitate is that the PC vendor requires a running Windows OS with their own software to provide support and warranty). Also, in my present situation, Fedora didn't want to install on a free partition on my HDD (possibly because it's unsupported h/w still? didn't investigate much yet).

If it wasn't for my son and his PC games (WoW, FS, others), I wouldn't be running Windows at all. I would either be running some form of Linux on a PC, or just simply a Mac (which is a Unix anyway).

But I haven't given up hope yet, I think I will get this to work (I'm patient and stubborn), altho perhaps USB flash is too much to ask for. It would be a great environment for my son and I to learn on (I use Linux at work, but not as a sysadmin).
Reply With Quote
  #13  
Old 3rd February 2008, 09:35 PM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
Not much progress. In fact, things are now worse, I no longer see the error 13. Now when I boot the PC with the Linux USB flash drive in the PC, nothing happens, it just hangs right after POST it seems. Even cuter, if I'm on a GRUB prompt (NeoGRUB) and insert the USB flash drive, the PC hangs completely (power cycling is the only option). And to add to the action, I accidently zapped my Vista HDD MBR (was getting too tired). Fortunately, that was easy to fix with the recovery CD.

Here's roughly what I was hoping to achieve:

PC always boots into Vista boot environment. From there I either
select Vista, or I select Linux which points to /dev/sdb1

/dev/sda -> /dev/sda1/vistaBootEnv (configured with EasyBCD)
menu:
- Vista --> boot Vista
- Linux --> /dev/sdb1/Grub --> Linux

The Fedora install (from live CD) went as follows:
- option: remove all from /dev/sdb (the USB drive)
- option: boot from USB drive
- review layout: removed swap (2G of RAM, 4G of flash, no point)
- advanced GRUB options: install GRUB to /dev/sdb1 (not sdb)

Ideally I would leave the USB key in the PC, and boot to it when
I want. Perhaps if I installed GRUB on /dev/sdb it would work
better. Haven't tried yet.
Reply With Quote
  #14  
Old 4th February 2008, 08:09 AM
PHPDUMMY Offline
Registered User
 
Join Date: Feb 2008
Posts: 24
I talked a friend of mine into installing Fedora , as he's always been into windows , he did the same thing youre doing and installed Fedora as the 2nd O.S. and all he did was run into problems . However , since I'm moving on with my life and steering clear of the Gates scandal , I've found life much less crashy in Linux and sorta feel like the Jefferson's ,,,,,, " cause i'm movin on up ! "

Any-hoot , my friend only ran into problems and i believe he's going to try another stab at it but with windows as the 2nd O.S. inside of Fedora .
Reply With Quote
  #15  
Old 5th February 2008, 02:11 AM
grounder Offline
Registered User
 
Join Date: Jan 2008
Location: Montreal
Posts: 12
I think I'm going to have to give up. Now, whatever I try, if the flash drive is in the PC when I boot, or if I insert it while GRUB is running, the PC completely freezes up, with no hint as to why; power cycling is the only option at this point. If I insert the USB with a system running, then I can access it, hack its MBR, &c, no obvious problem. Extremely frustrating, but I also have to move on... :-). I'll go back to the HDD approach, and try and figure that one out, it might be easier (when I first tried installing to HDD, Fedora installer complained, but I didn't note the details).
Reply With Quote
Reply

Tags
grub, kernel, standard

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"insmod: -1 Invalid module format "error! girish_rvd Using Fedora 1 2nd February 2009 03:29 PM
Grub Error 13: Invalid or unsupported executable format viklahan Installation, Upgrades and Live Media 2 14th August 2008 12:32 AM
Error 13: Invalid or unsupported executable format in compiling FC6 adrmateu EOL (End Of Life) Versions 3 22nd March 2007 04:36 AM
Can't install some modules because modprobe gives "Invalid module format" errors MarkE Using Fedora 3 9th July 2006 06:25 PM
Error 13: Invalid or unsupported excutable format harrisale Using Fedora 5 4th April 2006 12:14 AM


Current GMT-time: 15:49 (Wednesday, 23-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat