Jump to content
wmarsh

[How to] Boot OS X from grub using PC_efi

37 posts in this topic

Recommended Posts

Now that boot_v9 supports sleep, I have revived this method.

Get boot_v9 from here:

http://www.mediafire.com/?rdonkiqyzlz

 

Rename it from boot to boot_v9

 

Follow the PC_EFI method below, except say boot_v9 everwhere it says boot_v8

 

[important Edit regarding depreciation -- While the PC_EFI method works, and was necessary for those of us who used grub at one time, with the advent of Chameleon I consider it depreciated.]

 

CHAMELEON METHOD

To use Chameleon with Grub, do the following:

1) Download Chameleon (current version) from chameleon.osx86.hu

2) dd boot1h to the partition you have OS X installed onto.

3) copy boot to the root directory of your OS X partion

4) ignore the boot0 file -- it overwrites grub in your MBR and you don't need it with grub.

5) edit your grub menu.lst file to chainload in the usual manner, I.E.-- my OS X entry now reads:

 

title Mac OSX Leopard

rootnoverify (hd?,?) (replace ? with the values Grub uses for OSX partition -- differs from pc_efi method)

chainloader (hd?,?)+1 (same values)

 

This is much easier and more standardized, hence I consider the following pc_efi method depreciated.

 

PC_EFI METHOD

 

[EDIT -- this is intended for MBR partitioning. If you used GUID, see keso7's post below also

http://forum.insanelymac.com/index.php?s=&...st&p=859014

Linux lives nicely in the extended partition of an MBR system. FreeBSD will put its own slices in an MBR primary partition.]

 

Get boot_v8 (The pc_efi bootloader)

(Google "pc_efi v8.0 download")

 

Copy it to /boot inside linux [EDIT -- or FreeBSD]

 

Then edit /boot/grub/menu.lst

 

title Mac OSX Leopard

root (hd?,?) (replace with same values grub uses for Linux partition, not ones for OSX partition)

kernel /boot/boot_v8

boot

 

[EDIT -- Repetition because so many people miss this point -- use root(hd?,?) to match your LINUX entry. DO NOT point to your OS X partition. If you screw this up you will get grub error 17.]

 

[EDIT -- a few people report kernel /boot_v8 works for them rather than above. Possibly a difference between SUSE (which I use) and Ubuntu on the reports. In any event, if you put boot_v8 into the same location as the Linux kernel (for me /boot) the the path should be the same as the path to the Linux kernel in the Linux entry.]

 

[EDIT -- for FreeBSD, the root line would be root(hd?,?,a) -- the a refers to the first (boot) slice in the FreeBSD partition]

 

If OS X resides on a different HDD than Linux, you will have to enter a hex code for the appropriate drive during the boot process. [For simplicity, I advise you have Linux and OS X share a hard disk.]

80 -- 1st HDD

81 -- 2nd HDD

82 -- 3rd HDD

 

Alternately, so you don't have to enter code during boot process, make a tiny ext3 partition on the OS X HDD

copy boot_v8 there in a directory /boot

and replace (hd?,?) with the values of that partition

 

[EDIT -- At least theoretically, you should be able to do the same approach with Grub hosted on a Solaris system. However Solaris does not support my disk controller (ICH8R) so I cannot test this myself.]

Share this post


Link to post
Share on other sites
Advertisement

Thank you wmarsh

 

I was looking for a "howto boot" my new Kalyway 10.5.1 with my already installed grub and after searching on this site several ways I found yours the simplest.

I try and it works!

Good, Thks

Now I can chose at boot XP, Ubuntu or Leopard with my favorite bootloader : grub

 

However may I suggest that the last command : " boot " in the menu.lst is not needed since grub will anyway boot it after you select it and press enter.

And the two previous line can be made in one line only: here is the entry for OSX in my menu.lst ( it works too, tested )

 

title Mac OSx86 Leopard

kernel (hd0,5)/boot/boot_v8

 

This line is suggested too in the pc_efi bootloader readme.txt.

 

One question:

Now when I select "Mac OSx86 Leopard " in the grub menu it launchs pc_efi bootloader ( /boot/boot_v8 ) this one prompt me if I want to change disk it says I have 2 seconds, in fact I have 5 seconds, I don't press any key, since OSx is in the same disk.

then pc_efi bootloader launchs the Darwin OSX bootloader this program again give me 5 seconds to press a key

I have to press a key to choose OSX because if I don't the defaul boot is Windows.

Before I reinstall grub on the mbr I had the OSX bootloader (from the kalyway install) on the mbr and the default was OSX.

This is not a big issue, but I like when everything is perfect and I perefer to choose once only in the grub menu and then boot to OSX without choosing a second time.

Do you know how to do that?

Do you know if can turn this time to 1 or 0 seconds?

 

Yes I didn't search before asking (shame on me)!

But you seems to be a OSX boot specialist ;-)

 

Thanks in advance

--

Jmp0

Share this post


Link to post
Share on other sites

Hello,

 

I found some information in the forum:

I edited my /Library/Preferences/SystemConfiguration/com.apple.Boot.plist

and changed the timeout, it works, it's OK.

 

To change the Darwin boot loader default boot from XP to OSX, I found in the forum that I can change the startup disk in the system preferences, however I don't see any disk in this window...

 

On my system: OSX is on a logical partition.

Grub is on the mbr.

pc_efi bootloader v8 is on the linux partition

 

 

Is there any way to change the Darwin boot loader default boot from WinXP to OsX?

Is there any possibility to reduce the 5 second timeout of pc_efi bootloader v8?

 

 

Thanks

 

--

Jmp0

Share this post


Link to post
Share on other sites
Is there any way to change the Darwin boot loader default boot from WinXP to OsX?

Is there any possibility to reduce the 5 second timeout of pc_efi bootloader v8?

I know of no way to change the delay in pc_efi bootloader. I have found it useful as I will use a 2nd install on another disk when trying out software upgrades, so I don't mess up my main install.

 

Its funny your Darwin does XP by default. Mine does not, and it also shares the drive, possibly as mine occupies a primary partition.

Share this post


Link to post
Share on other sites

Hello!

Continuing:

 

I found in the forum that it's possible to set the default boot disk in Library/Preferences/SystemConfiguration/com.apple.Boot.plist with the kernel flags

<key>Kernel Flags</key>

<string>rd=diskXsY</string>

setting X & Y to the OSX disk & partition

However it didn't work for me (many other people reported on the forum it didn't work)

Even with this change the default boot on my system is XP...

 

I found also on the forum that I can try the bless command.

However after reviewing the manual pages of that command , I found it seems to work only to real mac. Changes are made in the NVRAM. The bless --info command report no NVRAM on my system.

Does anybody knows if bless works on our hackintoshes?

 

Anyway I found a way of making OSX the default! Success !!! ;-)

Darwin boot loader make the first active partition the default boot.

On my system XP is before OSX. I didn't want to reinstall everything (like in Windows world)

So I change XP partition to NOT active and to my big surprise XP was booting and working...

I also remove the makeactive line in the XP entry of my /boot/grub/menu.lst (because if I don't grub will mark it active on each XP boot)

So now my first and only active partition is the OSX one. Result: it's the default boot for Darwin bootloader.

I reduced the timeout in Library/Preferences/SystemConfiguration/com.apple.Boot.plist

And it's fine now I just select OSX in grub menu during boot and without hiting any other key I boot OSX directly!

Goooooood

 

But not perfect

I nearly have a quick OSX boot, however I don't like the 5 seconds wait of pc_efi bootloader v8 :-(

But since it seems to be hard coded in the program, it must be hard to change.

 

But what are 5 seconds in a life ...

 

 

Anyway I keep searching and trying...

 

--

Jmp0

Share this post


Link to post
Share on other sites

Sorry to bump a some what old thread. When I select the Mac OS X option when I am booting it says" ERROR 17: CANNOT MOUNT PARTITION SELECTED". I know I selected the right hdd and partition. However, Mac OS X is on a different hdd than my linux partition. I would enter the hex code, but I never get that far in the boot process. I have tried every other type of way, that I can find, to configure grub, so that I can boot OS X and none of them have worked so far. I am running Mac OS X 10.4.8 (Tiger) on my first hdd and Ubuntu on my second hdd.

Share this post


Link to post
Share on other sites
Sorry to bump a some what old thread. When I select the Mac OS X option when I am booting it says" ERROR 17: CANNOT MOUNT PARTITION SELECTED". I know I selected the right hdd and partition. However, Mac OS X is on a different hdd than my linux partition. I would enter the hex code, but I never get that far in the boot process. I have tried every other type of way, that I can find, to configure grub, so that I can boot OS X and none of them have worked so far. I am running Mac OS X 10.4.8 (Tiger) on my first hdd and Ubuntu on my second hdd.

Error 17 means grub can't read the partition you told it to read. It can't read hfsplus or NTFS.

Did you enter the same values for hd(?,?) for boot_v8 as you do for Linux? Do not enter the values for your OS X partition. As grub can read your Linux partition and not your OS X partition, I suspect you entered hd(0,0) for OS X and not hd(1,0) for boot_v8 on your Linux partition.

 

The disadvantage of separate disks is you will have to enter 80 so pc_efi looks for OS X on the 1st disk every time you boot.

Share this post


Link to post
Share on other sites
Error 17 means grub can't read the partition you told it to read. It can't read hfsplus or NTFS.

Did you enter the same values for hd(?,?) for boot_v8 as you do for Linux? Do not enter the values for your OS X partition. As grub can read your Linux partition and not your OS X partition, I suspect you entered hd(0,0) for OS X and not hd(1,0) for boot_v8 on your Linux partition.

 

The disadvantage of separate disks is you will have to enter 80 so pc_efi looks for OS X on the 1st disk every time you boot.

 

Thanks so much. That worked, and now it brings me to the darwin bootloader. Unfortunately, I installed Kalway Leopard, but it says "b0 error" when I start the computer up, I am using super grub to boot into the grub bootloader. I think I will just install the Jas Tiger dvd. Thanks again.

Share this post


Link to post
Share on other sites

I have the same problem. Error 17. Sorry, I don't understand where should i write the hex code? Into Grub's menu.lst? Can you be more specific. Thanks.

 

Otherwise i will create a small ext3 partition on Mac OS HD.

 

Thanks.

EDIT: Never mind, it works now. Thanks again!

Share this post


Link to post
Share on other sites

I'm coming back to the original topic, namely the discussion between wmarsh and JumpZero, in the Posts #1 to #5. More precisely, it's about how to "convince" the Darwin bootloader to boot by default on the OSX (Kalyway) partition rather than on the Windows (XP, say) partition.

 

Some rather trivial remarks first:

 

1) I confirm that one can modify succesfully (= it is taken into account = it works) the time one has to wait before Darwin boots. One opens a terminal window (in the OSX system) and, under the "sudo" (administrator rights), one edits (e.g. with nano) the file

/Library/Preferences/SystemConfiguration/com.apple.Boot.plist

at the second line of

 

<key>Timeout</key>

<string>5</string>

 

by putting instead of 5 (seconds) any number we want. I tried with 0 (= zero seconds) but the effect is bad: Darwin goes straight into the mode in wich one has to choose between osx and windows. So the better is to put 1 instead of 5. But this can be done solely AFTER one solves the original problem.

 

2) I confirm that, in the same file,

 

<key>Kernel Flags</key>

<string>rd=disk0s2</string>

 

changing in the second line disk0s2 into disk0s3 has no effect.

(I explain: disk0s2 corresponds to MY real OSX partition so first I put it so, but there was no effect: Windows was booting first. Then I put disk0s3 which corresponds to my Linux (Ubuntu) "/ " (= rootfile) partition, since according to the instructions of the implementation of boot_v8 (The pc_efi bootloader) in the /boot/grub/menu.lst (of Linux) imposed for the osx the reference to the partition where /boot was mounted, i.e. to disk0s3; so I tried with this one too. No effect: the win XP was still prioritary for Darwin bootloader)

--------------

for the syntax of the Darwin configuration file, see the link:

http://www.neonkoala.co.uk/index.php?optio...ng&Itemid=3

--------------

 

3) Since modifying the (OSX system) file

/Library/Preferences/SystemConfiguration/com.apple.Boot.plist

could not have effect in the order of the boot for Darwin, I decided to modify the (Linux = grub) file /boot/grub/menu.lst

As suggested by JumpZero (see his Post #5) I have put a # in front of makeactive for the Windows partition (when is mounted by Grub !!!). There was no better effect. But JumpZero said (I quote):

 

>>So I change XP partition to NOT active and to my big surprise XP was booting and working...

I also remove the makeactive line in the XP entry of my /boot/grub/menu.lst <<

 

OK. So he did 2 actions. As I said, I did myself the second one, but I still don't know to what he referes when he sais that he did the first action, i.e. he "changed XP partition to NOT active". Don't know what it means. I've searched... But nothing. Its too vague.

'By the way, there is a very good tutorial by JumpZero at

http://www.insanelymac.com/lofiversion/index.php/t97469.html

but he isn't more explicit there about this un-activation of XP, to do)

 

Thus, since I was not able to understand what to do, I had to find another solution.

First:

 

A) Do not undo the makeactive line for the windows partition in /boot/grub/menu.lst (don't put a # in front of it), beacause is useless.

 

B) Do not write a makeactive line in /boot/grub/menu.lst , under the lines of the efi bootloader lines indicated by wmarsh at Post #1. It's useless, but at a certain moment I thought that in this way I could indicate to Darwin that the OSX partition is prioritary. Actually, not.

 

In fact...

 

C) ONE JUST HAS TO CHANGE THE LINE CONCERNING THE MOUNT OF xp PARTITION:

 

chainloader +1

 

INTO

 

chainloader +2

 

(or, maybe, +3, if you have several Windows partitions, like an XP but also a Vista, etc...). The point is that it hasn't to be 1 (i.e. "number one" nor for Grub, nor for Darwin, that follows Grub)

 

In conclusion, the ending part of my file /boot/grub/menu.lst looks like this now:

 

#***************************************************************

..................................

### END DEBIAN AUTOMAGIC KERNELS LIST

 

# This is a divider, added to separate the menu items below from the Debian ones.

title Other operating systems:

root

 

# Entry for Windows XP:

 

title Microsoft Windows XP Professionnel

root (hd0,0)

savedefault

makeactive #Comment: do not de-activate; it's useless

chainloader +2 # Comment: it's +2 instead of +1

 

# Entry for Mac Leopard:

 

title Mac OSX 10.5.1 - Leopard # Comment: actually Kalyway

root (hd0,2)

kernel /boot/boot_v8

#makeactive # Comment: this line is useless

 

#********************************************************************

Another useful link: a manual about the structure of configuration file for Grub

 

http://www.commentcamarche.net/faq/sujet-3...e-configuration

 

Well. It worked for me, but it doesn't mean that it will work for you. That's life. ;)

Now that I'm done with this, I can erase everything and come back to my mathematics.

Thanks to all people contribuing to this forum.

Share this post


Link to post
Share on other sites

i've a problem. i've follow the instructions of this howto, but when i select the entry for os x there is this error: "Error 15: file not found"

the boot_v8 is in the /boot dir and i've also chosen the same partition like for my linux system.

 

Can someone help me plz.

 

greetz

Share this post


Link to post
Share on other sites
i've a problem. i've follow the instructions of this howto, but when i select the entry for os x there is this error: "Error 15: file not found"

the boot_v8 is in the /boot dir and i've also chosen the same partition like for my linux system.

 

Can someone help me plz.

 

greetz

I noted your observation in top post.

Maybe this is a difference between SUSE and Ubuntu.

Glad you got it to work.

Share this post


Link to post
Share on other sites
i've a problem. i've follow the instructions of this howto, but when i select the entry for os x there is this error: "Error 15: file not found"

the boot_v8 is in the /boot dir and i've also chosen the same partition like for my linux system.

 

Can someone help me plz.

 

greetz

 

 

I have the same problem here, yet I have uBuntu and specified the same hdx,x from Linux. Any Ideas??

 

 

 

EDIT: I think I solved this. I simply put this on the menu.lst

 

title MacOSX

root (hdx,x)

makeactive

chainloader --force +1

 

 

The only problem is I still get a Darwin bootloader after I select OSX in Grub.

 

But to think of it, Darwin is necessary to execute some commands :)

 

I just need to remove the other OS available in selections.

Share this post


Link to post
Share on other sites
I have the same problem here, yet I have uBuntu and specified the same hdx,x from Linux. Any Ideas??

EDIT: I think I solved this. I simply put this on the menu.lst

 

title MacOSX

root (hdx,x)

makeactive

chainloader --force +1

The only problem is I still get a Darwin bootloader after I select OSX in Grub.

 

But to think of it, Darwin is necessary to execute some commands ;)

 

I just need to remove the other OS available in selections.

You can edit com.apple.boot.plist so you don't see Darwin, you see the apple graphic instead.

 

chainloader method does not work for everyone. It does not work for me.

 

Error 15 means grub cannot find the boot_v8 file. Make sure you entered the same hd(?,?) as grub uses for Linux, and make sure the path to boot_v8 is correct. Thats why I put it into the /boot directory, same as Linux kernels. The path should then be the same as the path to the Linux kernel in your Linux entry.

Share this post


Link to post
Share on other sites

Hi.

 

I'm having some issues here.

 

My hdd is like:

 

disk0s1 = Vista (which boots)

disk0s2 = Data disk (NTFS, using with vista)

disk0s3 = HTF (partitioned and ToH installed)

disk0s4 = Ubuntu (for grub)

+ a swap for ubuntu

 

With the boot_v8, i come to the point where i am supposed do wait 2(eg 5) seconds, and when i do not press anything, or press something and select 80, it autmatically boots VIsta. i have no way of controlling it.

 

My menu.lst (relevant part) has

 

title Leopard

kernel (hd0,4)/boot/boot_v8

 

i've tried to use chainloader +2 on the Vista boot part, or the --force command, but to no avail :(

 

have any other thoughts?

 

 

**********************************

EDIT

 

nvm, i just had to set the Boot flag to the OS X partition, and now Darin boots ok.

(it doesn't start OS X though, i get an error that tells me i need to restart my pc. oh well)

 

Question.

 

I have a Core 2 Duo (SSE3), do i need to deactivate one of the cores for OS X?

Share this post


Link to post
Share on other sites
I have a Core 2 Duo (SSE3), do i need to deactivate one of the cores for OS X?

Glad you got grub to work.

 

Although hd(0,4) would be 1st extended partition (which is where I have Linux) not 4th primary partition as you list above.

 

I use both cores on by core 2 duo, so I doubt if thats the problem.

 

boot with -v; that usually gives more info.

Share this post


Link to post
Share on other sites

Thank you thank you thank you very much wmarsh. So simple. Worked flawlessly for me. I have now Ubuntu Hardy, Vista and Kalyway Mac Os x 10.5.2.

 

And the path i entered in menu.lst was /boot/boot_v8

 

Thank you very much again :(

Share this post


Link to post
Share on other sites

Hi to all the Mac Geniuses here!

 

I want my computer to Dual boot with Leopard (Leo4all v3 is what my computer worked fine on)

had to remove it as the later Ubuntu install did not allow the Grub to be recognized.

 

Erased the whole harddrive and made 3 partitions.

Installed 8.04 on 17 gb, the other 2 partitions are blank.

 

Hardware Config

MoBo - Asus M2N sli Deluxe

Proc - AMD64bit 6000+

Sata2 HDD 250gb

1gb 800 mhz ram

Graphix card - nVidia 8600 gt (512mb dedicated ram)

Optical Drive - DL-RW.

 

How do I go about it ?

I don't mind starting from scratch (erasing the whole harddrive to start of with)

I would need the on-board ethernet port to be recognized if there is kext for it..

 

Thanx in Advance.

Share this post


Link to post
Share on other sites

all right, I am going to bring this post up from the "dead"

 

I inserted the file into my /boot and changed my grub menu, but when I boot I get the " ERROR 17: CANNOT MOUNT PARTITION SELECTED"

 

 

I do not have a second hard drive. All my Os's are all on one HDD.

 

Where do I go from here?

Share this post


Link to post
Share on other sites
all right, I am going to bring this post up from the "dead"

 

I inserted the file into my /boot and changed my grub menu, but when I boot I get the " ERROR 17: CANNOT MOUNT PARTITION SELECTED"

I do not have a second hard drive. All my Os's are all on one HDD.

 

Where do I go from here?

Error 17 means Grub cannot read the partition in the root command.

Grub cannot read hfs+ or ntfs.

 

the root(hd?,?) for OS X booted by this method needs to point to the partition where boot_v8 is stored (normally the Linux partition).

That means you just copy the root line from your Linux entry.

Do not point it to the OS X partition. Boot_v8 finds it automagically if its on the same drive.

If its on a different drive, you can enter the boot codes when you boot -- see above.

Share this post


Link to post
Share on other sites

I have my HD split into three partitions: Ubuntu, OSX, OSX_restore

Following this guide, I'm am able to boot into Ubuntu & OSX. What would I need to do to be able to boot into OSX_restore as well? the darwin boot loader doesn't give me an option aside from selecting the HD (80 or 81)

Share this post


Link to post
Share on other sites

I have 2 hds

1- XP + Ubuntu

2-Leopard (10.5.4) GUID

i tried the boot_v8 method but I dont know where i should type the hex code

can someone help me?

Share this post


Link to post
Share on other sites

Hello!

 

Here is my GRUB;

 

# Modified by YaST5. Last modification on Sat Aug  9 06:19:26 UTC 2008
default 0
timeout 8
gfxmenu (hd0,3)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - 2.6.25.5-1.1
root (hd0,3)
kernel /boot/vmlinuz-2.6.25.5-1.1-default root=/dev/disk/by-id/scsi-SATA_MAXTOR_STM35006_6QG121PF-part4 resume=/dev/sda5 splash=silent showopts vga=0x31a
initrd /boot/initrd-2.6.25.5-1.1-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.0 - 2.6.25.5-1.1
root (hd0,3)
kernel /boot/vmlinuz-2.6.25.5-1.1-default root=/dev/disk/by-id/scsi-SATA_MAXTOR_STM35006_6QG121PF-part4 showopts ide=nodma apm=off acpi=off noresume edd=off x11failsafe vga=0x31a
initrd /boot/initrd-2.6.25.5-1.1-default

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title windows 1
rootnoverify (hd0,3)
chainloader (hd1,0)+1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
rootnoverify (hd0,3)
chainloader (hd1,1)+1

###Don't change this comment - YaST2 identifier: Original name: windows 3###
title windows 3
rootnoverify (hd0,3)
chainloader (hd1,3)+1

###Don't change this comment - YaST2 identifier: Original name: windows 4###
title windows 4
rootnoverify (hd0,3)
chainloader (hd0,0)+1

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
rootnoverify (hd0,3)
chainloader (fd0)+1
~
~
~
~
~
~
																																														 1,19		  All

 

And here is my hard-drive layout;

Partitions.jpg

 

Please tell me how to add my mac partition (10.5.4) into GRUB!

 

Thanks in advance,

 

Panarchy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×