Jump to content

Multiboot with Grub


doortokaos
 Share

20 posts in this topic

Recommended Posts

Hi there.

So I got the JaS 10.4.7 ISO image and managed (after some difficulties) to install it to a free partition (more details -> see below). When I try to boot the OS X, Grub gives the following error:

"Error 13: Invalid or unsupported executable format"

 

My partition table (fdsik in Linux is my friend :P):

Disk /dev/hda: 80.0 GB, 80026361856 bytes

255 heads, 63 sectors/track, 9729 cylinders

 

Device ..... Boot .. Start ...... End .......... Blocks ...... Id ... System

/dev/hda1 .. * .......... 1 ..... 1275 ..... 10241406 ....... 7 ... HPFS/NTFS

/dev/hda2 ........... 1276 .... 7075 ...... 46588500 ....... f ... W95 Ext'd (LBA)

/dev/hda3 ........... 7076 .... 8350 ...... 10241437+ ... af ... Unknown

/dev/hda4 ........... 8351 .... 9729 ...... 11076817+ ... 83 ... Linux

/dev/hda5 ........... 1276 .... 7012 ...... 46082421 ....... 7 ... HPFS/NTFS

/dev/hda6 ........... 7013 .... 7075 ......... 506016 ...... 82 ... Linux swap / Solaris

 

As you can see hda1 is my Windoze system partition, hda2 is an extended partition, hda3 is my OS X partition, hda4 is my ext3 Linux partition, hda5 is my Windoze data partition and hda 6 is my Linux swap partition (Ubuntu created it in the extended partition...).

So I can't alter these partitions because Windoze and Linux work and are needed as they are (I have no chance to rebuild the entire system).

 

My Grub configuration (tried some different things, but a friend told me it worked for him with a config like this), menu.lst:

# some Linux boot options

# don't really matter I think

 

# Windoze

title Windows

root (hd0,0)

makeactive

chainloader +1

 

# OS X

title OS X

rootnoverify (hd0,2)

chainloader +1

 

 

Well I don't really know much about OS X, but during the install I had no chance to choose whre to install the bootfiles for OS X. On reboot after the installation my old grub menu appeared so I altered it (after ours of reading how to configure it to boot OS X), as you can see above...

 

I have only two ideas what could be the problem, but I don't know how to verify them:

1. The OS X installation didn't copy any bootfiles or wrote a bootsector on the OS X partition and

2. my entry in my menu.lst for OS X is wrong (hd0,2 is correct, see the fdisk table above, so the problem could be the chainloader entry...)

 

 

So if anyone has an idea how to fix this problem, please let me know it. If you need more information, say what you need and I'll try to provide them.

 

Greetings

Doortokaos

Link to comment
Share on other sites

Try:

# OS X

title OS X

root (hd0,2)

makeactive

chainloader +1

 

or

 

# OS X

title OS X

root (hd0,2)

makeactive

chainloader --force +1

 

If you want to be sure of the (hdx,y) labeling, go in grub edit mode and use tab to show you options with correct labels.

 

Another possible problem is that you put osx primary partition after the extended (hda2 contains hda5 & hda6); some have encountered problem with this.

Link to comment
Share on other sites

Try:

# OS X

title OS X

root (hd0,2)

makeactive

chainloader +1

 

or

 

# OS X

title OS X

root (hd0,2)

makeactive

chainloader --force +1

 

I tried them both. The first doesn't change anything (I get the old error 13) and the second gives a new Grub error:

"Starting up...

Loading stage2..

 

 

GRUB loading, please wait...

Error 18"

 

In edit mode root (hd0, <TAB> gives the following output:

Possible partitions are:

Partition num: 0, Filesystem type unknown, partition type 0x7

Partition num: 2, Filesystem type unknown, partition type 0xaf

Partition num: 3, Filesystem type is ext2fs, partition type 0x83

Partition num: 4, Filesystem type unknown, partition type 0x7

Partition num: 5, Filesystem type unknown, partition type 0x82

 

So hd0,2 should be the correct one.

I also tried a "rootnoverify (hd0,2)" with makeactive and chainloader [--force] +1, but it didn't change anything. With force I get error 18 and without it I get error 13. I'm kind of puzzled... :(

But I can't really imagine that the partition ordering is the problem... My linux partition can be booted but it is behind the extended, too.

Link to comment
Share on other sites

No it's not. I created it by shrinking my extended partition making a new primary in the free space.

And when I start the diskmanagement tool in Windoze I can see an unknown partition between my extended and my Linux partition (which is also a primary). That must be my OS X partition...

 

lord_muad_dib you have a quadrouple boot configuration on your machine? What bootloader do you use?

Link to comment
Share on other sites

doortokaos !

 

try

 

title OS X

rootnoverify (hd0,1)

chainloader +1

 

that's all

 

Nope doesn't work.... now it hangs with no errors. The last is see is:

"Starting up ..."

And nothing happens anymore...

 

But thanks for your all tips so far, I really appreciate every new idea.

Link to comment
Share on other sites

No it's not. I created it by shrinking my extended partition making a new primary in the free space.

And when I start the diskmanagement tool in Windoze I can see an unknown partition between my extended and my Linux partition (which is also a primary). That must be my OS X partition...

 

lord_muad_dib you have a quadrouple boot configuration on your machine? What bootloader do you use?

lord_muad_dib is right, your primary /dev/hda3 ist located after the extented /dev/hda2 witch contains the logical partitions.

You should delete all logical partitions, delete the extented so that you only have /dev/hda1 left. Create a primary /dev/dev2 with type AF and only after that you can create an extented with logical drives.

Link to comment
Share on other sites

Hello again.

 

Thanks to a friend I could repartition my hd. Now I have the following:

hda1 windoze primary

hda2 os x primary

hda3 linux primary

hda4 extended

hda5 linux swap

hda6 windows data

 

Now booting with Grub works as intended. But I really don't understand why there is such a big problem with Grub when osx is on a primary behin an extended partition... Until now I never read a logic eplanation for this problem, just that it exists an there is no solution or workaraound, without rearranging the whole partition setup.

Unfortunately I don't know much about Grub and osx, so I can't really investigate why this problem occurs.

 

But thanks for all your help, now I have a fully functional triple-boot-system. *yeehaa* :)

 

The topic can be closed...

Link to comment
Share on other sites

  • 4 months later...

i finally got the triple boot w/ grub btwn OS X/Ubuntu linux/XP

 

i had to organized hda

hda1 /boot

hda2 OSX

hda3 linux /

hda4 /swap

 

/hdc1 XP

 

i had to add to /boot/grub/menu.lst

# OS X

title OS X

root (hd0,1)

makeactive

chainloader +1

Link to comment
Share on other sites

I "just" ran into the same issue.

Formatted a 320 Gb sata with gparted:

1 primary /boot

2 extended /linux_swap (is 5)

/ (linux root is 6)

3 primary OsX

4 primary Linux data

I once wiped a windows partition with the partition tool on a 10.4.4 install of my laptop (which warns you that it will clean all existing partions), so I decided to try the 10.4.1 dd fashion: Installed MacOsX on a spare pata and dd the partition to disk0s3.

Installed linux, configured grub, and booted into OSX - no problem, but the partition size had changed to that of the pata source.

I tried diskutility, disktool,... no good. So I used ghost: same thing. Used diskimage and it worked: all 60 Gb but no boot loader.

 

Checked on the forum, found the clonetool post, but it's only ppc so far. But the recipe is there:

dd the 512 bytes of booth, startupfiletool the boot loader, bless to make the partition bootable, and booted from grub again.

(startupfiletool is on Darwin boot CD, lucky I got on from ages ago).

 

Granted, this story is full of mishaps and annoyances, but for those in similar troubles it might be useful:

You can boot from a primary partition located behind logical partition.

 

Specs: P4 Northwood (SSE2), Abit IS7, FX5900TX

Link to comment
Share on other sites

  • 1 month later...

For those with a primary OSX partition behind logical partitions in the partition table (physical data being in correct order), you can reorder your partition table without reformat or move the whole partitions. The Linux's fdisk "reorder" command can reorganize the partition table in the same order than the physical data.

1/ Ensure that your physical primary partition is before the logical partitions (with tools like Gparted, Partition Magic under Windows, or whatever you like)

2/ Open Linux's fdisk (don't forget to replace 'hda1' with the HD you wish to reorganize)

> sudo fdisk /dev/hda1

3/ Print the partitions from the partition table. Note how the primary OS X partition (hd3) is behind the logical partition (hd2) — we're going to fix this

> p
Device ..... Boot .. Start ...... End .......... Blocks ...... Id ... System
/dev/hda1 .. * ......... 1 ..... 1275 ........ 10241406 ....... 7 ... HPFS/NTFS
/dev/hda2 ........... 1276 ..... 7075 ........ 46588500 ....... f ... W95 Ext'd (LBA)
/dev/hda3 ........... 7076 ..... 8350 ....... 10241437+ ...... af ... Unknown
/dev/hda4 ........... 8351 ..... 9729 ....... 11076817+ ...... 83 ... Linux
/dev/hda5 ........... 1276 ..... 7012 ........ 46082421 ....... 7 ... HPFS/NTFS
/dev/hda6 ........... 7013 ..... 7075 .......... 506016 ...... 82 ... Linux swap / Solaris

4/ Enter in expert mode

> x

5/ Reorder the partition table

> r

6/ Write the partition table

> x

You can now follow the usual formatting procedure and reinstall OS X, then GRUB-booting should work like a charm (but note that the grub partition indexes, like hd0,1, will have changed — don't forget to edit your menu.lst !). This allowed me to get ride of "Error 12" or "Error 13" in GRUB.

Link to comment
Share on other sites

Very nice tip KemenAran. I had done that manually in acronis disk director, had to be careful to type the right stuff; didn't know about this option in fdisk.

 

I had tried that long ago though (see this post), and it didn't go well; since it works for you, I'm glad to see that after all it was something i missed.

 

/edit: slight correction

Link to comment
Share on other sites

 Share

×
×
  • Create New...