# Windows wont load, grub error?



## blue4paper (Aug 11, 2007)

My windows has this error when i try and load it "Error 13 Invalid or unsupported executable format" i've googled around and found lots of people had this problem and it all resulted from grub issues. Unfortunately i couldn't find any good solutions seeing as people had different scenarios. Anyways here's a copy of my grub.



> # menu.lst - See: grub(8), info grub, update-grub(8)
> # grub-install(8), grub-floppy(8),
> # grub-md5-crypt, /usr/share/doc/grub
> # and /usr/share/doc/grub-doc/.
> ...


----------



## jrbuergel (Jan 17, 2004)

Most likely the grub issue is with that entry titled; "root", which is just above your Windows XP boot information. If you just have Ubuntu and XP installed and dual booting, then just edit the menu.lst file which is located in; /boot/grub/, and you need to be logged in as root. I did this with this typed in a command prompt terminal window; sudo gedit /boot/grub/menu.lst , and this will open your grug file to edit as root, and do a save, then close it. Also here is a good and helpful Linux forum site; http://www.linuxquestions.org/questions/


----------



## saikee (Jun 11, 2004)

The OP has already posted the menu.lst in Post #1.

As usual the OP has done most other posters have done, just reported the error and showed insufficient detail to enable others to fix it.

The error "Error 13 Invalid or unsupported executable format" actually means Grub cannot execute the "chainloader +1" command. To put it bluntly the partition (hd0,0) Grub has been asked to chainload is not chainloadable. In chainloading Grub is asked to surrend its control to another boot loader which in this case should be XP's NTLDR. Grub is ready to pass over the control but no one is available to receive it.

It is likely the 1st partition of the 1st disk or (hd0,0) in Grub's convention, is a recovery partition of one that stored computer's hardware drivers. Thus if the correct partition is specified Xp will boot because by default it "always" has NTLDR installed in its boot sector.

To cure it one needs to know which partition has XP. The easiest is to post the partition details by commands in Ubuntu terminal

```
sudo su
fdisk -l
```
The partition that has type 7, indicating it is a ntfs partition, and shown "active", attached by a *, will be the bootable Xp partition.


----------



## blue4paper (Aug 11, 2007)

heres my fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc55dc55d

Device Boot Start End Blocks Id System
/dev/sda1 * 8551 19457 87610446 7 HPFS/NTFS
/dev/sda2 2 8550 68669842+ f W95 Ext'd (LBA)
/dev/sda5 2 263 2104483+ 82 Linux swap / Solaris
/dev/sda6 264 8550 66565296 83 Linux


----------



## dick471 (Oct 27, 2004)

I would do a search for "Super Grub" and put on a CD(bootable). This will boot to anything (O/S) you have in the computer. Works great!


----------



## blue4paper (Aug 11, 2007)

thanks for suggestions, unfortunately didn't work. I fiddled around with just about every option in Super Grub and windows still didn't boot.


----------



## saikee (Jun 11, 2004)

Your menu.lst actually proves I was wrong because your (hd0,0) is indeed Type 7 and has a *.

```
/dev/sda1 [COLOR="Red"]*[/COLOR] 8551 19457 87610446 [COLOR="Purple"]7[/COLOR] HPFS/NTFS
```
In that case can I ask you to boot the XP up manually?

As you can post the Ubunu's menu.lst this make me think your Grub is displaying the menu.lst and you can boot to Ubuntu. It is just the XP that is not working, right?

To boot operating systems manually you press "c" key and get a Grub prompt. No matter how hard I try I cannot find a working PC system that cannot be booted by a Grub prompt! You can boot any system manually using the commands in menu.lst by omitting the "title" statement and finish lastly with an extra "boot" statement. Any line in menu.lst with a "#" in front is not acted by Grub.

You first ask Grub to verify the partition details by command

```
geometry (hd0)
```
This command produces the same output as "fdisk -l" in Linux except the partition numbering system is in Grub's convention. You then try to fire up XP by these command, one line at a time

```
root (hd0,0)
chainloader +1
boot
```
The above is virtually identical to the command in menu.lst. I did not use "savedefault" because there is no need. I omitted "makeactive" because (hd0,0) is already active, as confirmed by the *.

Grub will respond to each line. It will confirm Type 7 partition is found after the "root (hd0,0)" command. No message is acceptable. A problem is always responded with a message.

If it doesn't object to the 2nd line of "chainloader +1" then Xp should fire up by the 3rd line "boot".

If the same error 13 as before is reported after the 2nd line then your NTLDR has been accidentally damaged and you need to restore it by "fixboot" and/or "fixmbr" command using the XP installation CD.

If Xp can be booted manually but not automatically by menu.lst then you need to restore Grub. Instruction to do this will be provided if you need it.

Let's us know how you get on.

"Super Grub" is to let a middleman in between you and Grub. You can get everything you want from a Grub prompt because you are talking to Grub directly equivalent to pointing a gun to its head! Why people want to do it through a middleman I never know.


----------



## webstarcool (Aug 4, 2008)

Hi there,

Thanks for your advice. I had the same problem with the 'Error 13' during boot. It initially happened when I tried to alter the bootloader with a program kalled QGrub (or something like that). I wanted to change the default boot as it was starting the memtest as default instead of Windows XP. After changing the boot default to XP I restarted and it would fail with the 'error 13'.

Now I just tried your advice with the manual boot and it seems to work (I'm typing this from Windows XP).

But hwo can I restore the original menu.lst, so I don't have to manually start my windows XP?

Thanks,

P


----------



## saikee (Jun 11, 2004)

If you know to boot a system manually with Grub you can also ask it to display the menu.lst.

Say your Linux is in the 2nd partition of the 1st disk known to Grub as (hd0,1) as it counts from zero. Grub will display the menu.lst on the screen if you issue this command

```
cat (hd0,1)/boot/grub/menu.lst
```
You can then type the booting instructions manually, word for word and line by line, and the system will fire up when you give the green light to boot by adding this coomand last

```
boot
```
You can modify menu.lst anyway you want using an editor.


----------

