Odd Grub issue with Ubuntu 8.10

Hi,

I have been dual booting with XP/Ubuntu for a year or two with no issues at all. I have the OS's on two different physical drives and, today, decided I wanted to do a fresh install to upgrade to Ubuntu 8.10. All seemed to go well until I came to restarting the system - when the grub menu appears, if I select to boot into XP I get an error message:
"Error 13: Invalid or unsupported executable format"

If I select Ubuntu from grub, it boots fine.

I went into BIOS and changed the boot order to boot from the XP disk first and XP boots fine, so I am guessing it is just an issue with grub pointing to the wrong place for the XP boot??

For info, I have been asking on a Linux forum for help and was asked to give various bits of info, as follows:

Windows entry in menu.lst (grub):
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
chainloader +1

output of fdisk -l:
Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xcab10bee

Device Boot Start End Blocks Id System
/dev/sda1 * 1 23574 189358123+ 7 HPFS/NTFS
/dev/sda2 23576 24321 5992245 c W95 FAT32 (LBA)

Disk /dev/sdb: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0009763e

Device Boot Start End Blocks Id System
/dev/sdb1 1 249 2000061 82 Linux swap / Solaris
/dev/sdb2 * 250 5354 41005912+ 83 Linux
/dev/sdb4 5355 9964 37029825 b W95 FAT32

(for info... sda1 is XP, sda2 is XP Restore partition, and sdb4 is a shared FAT32 partition I use for stuff I want available in Linux & XP)

These are the outputs from the grub prompt:

grub> geometry (hd0)
drive 0x80: C/H/S = 24321/255/63, The number of sectors = 390721968, /dev/sda
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 1, Filesystem type is fat, partition type 0xc

grub> geometry (hd1)
drive 0x81: C/H/S = 9964/255/63, The number of sectors = 160086528, /dev/sdb
Partition num: 0, Filesystem type unknown, partition type 0x82
Partition num: 1, Filesystem type is ext2fs, partition type 0x83
Partition num: 3, Filesystem type is fat, partition type 0xb

I also noticed that, when I boot into Ubuntu, just after I have selected it in the grub menu a brief message flashes by saying:
"boot from (hd0,1) ext3 ...." didn't catch the rest of it, but it seems odd that it says hd0??

Anyway, as I said at beginning I CAN boot into both OS using BIOS boot priority, but I would prefer to get grub working and use that.

Anyone able to help???

Thanks, in advance

SV :)

P.S. If it makes any difference - sda is a sata drive, sdb is a ide drive.

Comments

  • kryystkryyst Ontario, Canada
    edited December 2008
    if you have disk 1 with windows on it and disk 2 with linux on it and you install grub. Grub will be in the master boot record of disk 1.

    So if you mess with the boot orders in bios it's changing which disk is 1 and which is 2. Linux will call physical disk 1 hd0 so hd0,1 would be partition 2 on physical disk 1, hd0, 3 would actually be the 4th partition on physical disk 1. Physical disk in this case being determined by what your doing in messing around with your bios boot order.

    So if you let your bios behave normally and physical disk 1 is xp and disk 2 is linux then in grub for it to boot to xp it should be pointing to hd0,0 if the only thing installed on physical disk 1 is xp and it's not on a second partition for example.

    Linux on the other had is probably going to point to hd1,1 because hd1,0 will typically be the swap partition.
  • edited December 2008
    Hi, thanks for the reply

    I understand all that, but my point was that I dont know what part of it is wrong - I had the same setup with a previous install of Ubuntu and all I did was delete the partitions and redo them with 8.10 (wanted a clean install). I have only touched the BIOS boot order SINCE the reinstall, because it is the only way I can get into Windoze.

    Can you see, from the info posted, where the issue is? And, therefore, tell me how I can fix the issue so I can choose the OS from Grub, instead of using the BIOS everytime I want to change from the default?

    SV :)
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited December 2008
    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sda1
    title Microsoft Windows XP Home Edition
    rootnoverify (hd0,0)
    makeactive
    savedefault
    chainloader +1
    

    try using an editor to edit your grub.conf file to look like this for the xp entry.
  • QCHQCH Ancient Guru Chicago Area - USA Icrontian
    edited December 2008
    oh, and hi SillyViking... :D
  • edited December 2008
    Thank you, will give that a try (but will probably be after Xmas now.. busy time)

    And HI!! DaddyQ - long time, no see. Hope things are going great for you & yours and that you all have a great Xmas!! :rockon:

    SV :)

    (Can you pass on my seasonal wishes to TB, and anyone else you see, please? I seem to have found myself with virtually no time to get on here :( )
  • kryystkryyst Ontario, Canada
    edited December 2008
    Have you tried re-installing GRUB since you moved things around?
  • edited April 2009
    kryyst wrote:
    Have you tried re-installing GRUB since you moved things around?

    Hi kryyst (and folks), I guess I am having the selfsame issue here (dualboot, XP installed first, Linux Mint works fine, XP fail saying Error 13: invalid or unsupported executable format¨. I tried changing the menu.lst as advised but with no avail.

    As to provide some additional info: The XP were okay this morning, I let them on and went out. Upon mu return I found text mode GRUB menu and XP inaccessible. From linux I see the C: partition is having unkown format (no NTFS, nothing at all) and I cannot see it under My Computer. As for the D:, I can see it but cannot mount it.

    Any advice for a noob, please...?
  • kryystkryyst Ontario, Canada
    edited April 2009
    Sounds like your partition table may have gotten messed up, could be a harddrive crash.

    What happens when you reboot the computer? Is GRUB loading, can you boot into any of your OS's?
  • edited April 2009
    kryyst wrote:
    Sounds like your partition table may have gotten messed up, could be a harddrive crash.

    What happens when you reboot the computer? Is GRUB loading, can you boot into any of your OS's?

    Hi!

    Well, if I reboot, I get te usual startup look ending up with the correct (linux-style) OS boot menu.

    Selecting linux (dev/sda7) works fine (it is a life-saver) so physicaly te HDD does not look broken, selecting XP (where C: is located on dev/sda1) only leads me to the black screen wth white error message as decribed in the original query. As for the D: (dev/sda5), it cannot be neither mounted (linux reports an unclean shutdown), nor unmounterd (linux reports it to be still in use).

    Tried to check the men.lst and alter it - did not help.

    I have been checking, taking andvices in the past days and there is either a virus (which I doubt, my XP are well protected and a virus damaging a single partition with no warning sounds to me rather unlikely) OR indeed there has been a short circuit (happenned like two times in the past 14 days that my roommate brought in her 0,5 TB external drive, plugged it into electricity and when trying to plug the USB, the PC shut down).

    Since I will not be able to get into the Win recovery console (for some reason it is not ccepring my admin password), I will most likely end up with reformatting / deleting the sda1 (C:) and clean reinstall of the XP.

    Perhaps, could someone kindly confirm whether such reinstall on C: will give me access to all my data on dev/sda5 (D:)?
Sign In or Register to comment.