6

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!

3 Answers3

4

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).

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • This worked perfectly for me, thanks very much. – user62664 Feb 11 '13 at 08:24
  • 1
    If you are installing ubuntu on an Apple macbook air do visit Rod Smith's page for all the details. Thanks a lot for all your help with efi. – orthodoc Apr 11 '13 at 17:42
  • 1
    For people who want to find the partition number, check out this answer. – Irvin Lim Sep 10 '16 at 16:43
  • If 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. – pietrodn Sep 20 '16 at 10:24
1

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.

Sparhawk
  • 6,929
0

I have a macbook Pro 8.2, Late 2011 on which I have installed OSX and Linux Mint.

This are the steps I did:

  1. In OSX I repartitioned my 500gb hard drive in half. For some reason I cannot boot with a USB unless I edit the startup screen with nomodeset but then I get the warning that I am in a safe mode type and no video drivers were loaded.

  2. So booting from a CD, holding down the option key when the mac chimes, I had three options, OSX, Windows, EFI. I tab over and selected the Windows option.

  3. After Ubuntu boots and you click to install to hard drive, when the option comes up either install to hard drive or something else, choose something else.

  4. Then make three partitions: Swap, /(root), and Home, then click to install.

    You will get a warning that you need to make a boot partition or it might have trouble booting, ignore this and continue.

  5. After install and a reboot it will automatically boot into OSX, which I let it boot into just to make sure I still had OSX, but all you have to do is hold the option key down when you hear the chime and you then have two options OSX, Windows. choose Windows and it will boot to Linux.

I have not tried this with Ubuntu although I did with Fedora and Debian and both of them did not work very well with OSX.

Dave
  • 1
  • 2
    Welcome to Ask Ubuntu! I recommend [edit]ing 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.) – David Foerster Jan 07 '16 at 12:03