Mac OS X won't boot from grub menu in Ubuntu Precise on Apple MBA(5,2)
Solution 1
Something like the following GRUB 2 configuration might work:
menuentry "OS X" {
insmod hfsplus
set root='(hd0,gpt3)'
chainloader /System/Library/CoreServices/boot.efi
}
Note that you may need to change the partition number from "gpt3" to something else, such as "gpt2" or "gpt4". You want to identify the partition on which OS X is installed and use its partition number. To use this example, copy it to your /etc/grub.d/40_custom file in Linux and then type sudo grub-mkconfig -o /boot/grub/grub.cfg
. I make no promises that this will work, though; I've not tested it.
Another option is to replace rEFIt with rEFInd and forego GRUB 2 in favor of a Linux 3.3.0 or later kernel with EFI stub loader support. Unfortunately, Ubuntu 12.04 shipped with a 3.2.0 kernel, so you'll need to replace your kernel (or wait for Ubuntu 12.10) to do this. The rEFInd documentation details how to do it (see the "Options for Booting Linux" page).
Solution 2
Edit your grub.cfg.
menuentry 'Mac OS X (on /dev/sda3)' --class osx --class darwin --class os $menuentry_id_option 'osprober-xnu-64-6834a4ed4dccef17' {
insmod part_msdos
insmod hfsplus
set root='hd0,msdos3'
multiboot /boot
}
Works fine in Ubuntu 14.04 and Mac OS X 10.9.4.
Related videos on Youtube
orthodoc
Updated on September 18, 2022Comments
-
orthodoc over 1 year
I have set up Ubuntu Precise on the new 2012 edition of the Apple MBA(5,2) following the excellent guide over here. Now I want to uninstall rEFIt, in order to avoid going over the boot options twice. The boot options are displayed via rEFIt and GRUB in that order. However to do so, I must be able to boot into Mac OS X via grub. At the moment this is not happening. I read somewhere that this requires chainloading. Could someone direct me to get this right?
Thanks in advance!
-
Nikolai about 11 yearsThis worked perfectly for me, thanks very much.
-
David Foerster over 8 yearsWelcome to Ask Ubuntu! I recommend editing this answer to be more structured. It's quite difficult to discern the individual instructions from this wall of text. (See also How do I write a good answer? for general advice about what sorts of answers are considered most valuable on Ask Ubuntu.)
-
Irvin Lim over 7 yearsFor people who want to find the partition number, check out this answer.
-
pietrodn over 7 yearsIf you don't want to hardcode the root partition, you can replace the "set root" line with:
search --set=root --file /System/Library/CoreServices/boot.efi
. This command will automatically find a root device containing that file. The boot is slightly slower, though.