2

I removed everything on my MacBook Pro, partitioned it into several small partitions, and installed Ubuntu, Windows and OS X. Grub2 sees my Windows and Ubuntu installs, but OS X doesn't show up in the Grub2 menu.

I tried os-prober and it doesn't find anything. I tried the various edits to 40_custom I've seen here and here and elsewhere, but I keep getting "hd0,[blank]" does not exist.

How can I make OS X show up on the Grub2 menu at boot?

1
  • As a temporary work-around, I'm Option-booting into OS X when I need to. Sep 28, 2015 at 4:30

2 Answers 2

5

An EFI-mode GRUB should be able to chainload the OS X boot loader, but the GRUB prober might not know where to find it. It's traditionally stored as /System/Library/CoreServices/boot.efi on the OS X root partition; but since Yosemite, it's typically stored on the emergency-boot disk instead, since the root filesystem now uses an LVM setup by default, which the firmware can't read. In any event, you may need to write a custom GRUB entry to get this to boot. See here for some basic information, although that doesn't give complete instructions for what you want.

If your Ubuntu installation is in BIOS/CSM/legacy mode, it may be harder, since GRUB can't redirect to an EFI-mode boot. GRUB has the ability to boot the OS X kernel directly, but that can be tricky to set up and may lose you some features in OS X. This is definitely fringe/bleeding-edge stuff, so I don't recommend you try it. If you care to do so, you can probably find instructions somewhere on the Internet, but I don't have any URLs handy.

Many Mac users prefer to use something other than GRUB as the default boot loader, relegating GRUB to secondary status or not using it at all. The traditional tool for doing this is rEFIt, but it's been abandoned for five years now. It still works, but if you use Yosemite or some other relatively recent options, you may have to jump through some extra hoops. I created a fork of rEFIt called rEFInd. It's actively maintained and will boot any of your OSes. You can try it out on a CD-R or USB flash drive before installing it to your hard disk, if you like. (The downloads page includes links to images for both types of media. rEFInd can boot Linux kernels directly, thus bypassing GRUB; or it can chainload to either an EFI-mode or a BIOS-mode GRUB. It can also chainload to the OS X boot loader and to both EFI-mode and BIOS-mode Windows boot loaders.

7
  • Any update on this since 2013?
    – Jonathan
    Aug 23, 2017 at 20:01
  • 2
    Apple is now using a dedicated boot partition for at least some installations. (An iMac I bought a few weeks ago is so configured, for instance.) Beyond that, I haven't looked into configuring GRUB to chainload to the macOS boot loader in ages. It should still be possible, but if the Ubuntu OS-prober isn't finding it, you'll have to go digging. rEFInd should detect it automatically. I'm still maintaining that program; the most recent release was ten days ago.
    – Rod Smith
    Aug 23, 2017 at 20:48
  • I tried installing your amazing rEFind tool using your PPA & apt, and it installed fine and I was able to get into rEFind but it only showed Ubuntu (I have like 5 OS's on this machine. So I went back to Grub. Grub's OS-Prober finds it fine, but it says some error about a table missing when I try it, or it just has a blank screen and seems to hang. So I tried to use grub-customizer and set up chainloaders on each partition, but those also died with the same table error. Then I used my MSI bios just to straight boot into the drive, and somehow that worked. From there I put Chameleon on a USB pen
    – Jonathan
    Aug 24, 2017 at 0:46
  • 1
    @JonathanLeaders, based on your description, I suspect you've got a mix of EFI-mode and BIOS-mode OSes. If so, rEFInd would work if you uncomment the scanfor line in refind.conf and ensure that hdbios is among the options. A better solution is to install EFI-mode boot loaders for all your OSes, but that's not possible for some older OSes, like OS/2 and DOS.
    – Rod Smith
    Aug 24, 2017 at 13:19
  • 1
    rEFInd detects OSes at run-time, not via GRUB's OS prober. Thus, rEFInd running pre-boot cannot use OS prober; and an install script would have a hard time figuring out what rEFInd would detect to do a comparison then. rEFInd is configured to not detect BIOS-mode OSes by default on UEFI PCs because the detection method relies on the firmware, which produces one entry per hard disk, whether or not those entries work, and so would result in useless BIOS-mode entries in many cases. Also, mixed-mode (BIOS plus EFI) booting is uncommon on UEFI PCs.
    – Rod Smith
    Aug 25, 2017 at 14:49
3

I have installed Debian without rEFInd. I had difficulty booting OSX from GRUB. I had to press the Alt button to boot into MacOs.

I tried several entries into the 40_custom file but no avail. I accidentally stumbled on this solution: I just created a menu entry in GRUB2 by including the following code in the 40_custom file located in the /etc/grub.d/ folder;

menu entry 'Os X' {
exit
multiboot /boot
}

Then I ran sudo update-grub

1
  • The first two words must be glued together got make this work menuentry 'Apple macOS' { …; otherwise this works well.
    – olebole
    Nov 24, 2023 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .