0

I have Ubuntu 17.04 installed alongside Mac OS X 10.5 on my MacBook 2,1. I used to have Ubuntu 16.04 installed, following these directions.

When I upgraded to 17.04, I did a fresh install for various reasons, one of which was to convert to UEFI. During the installation, I selected the original EFI System Partition as such, made a reserved BIOS area, a / partition and a /home partition.

At first, it worked fine, then, after I selected Mac on startup, it didn't boot into Ubuntu. When I press the Option key on startup, it still gives me the usual option to boot into what it calls "Windows" (which is really Ubuntu), but it doesn't get anywhere at all. I reinstalled, without changing the EFI partition and removing the BIOS area. The same issue persists, and though I can use rEFIt to boot into Ubuntu, I'd rather not. I've tried with a separate /home partition and without. What did I do wrong?

If I must, I'm willing to clear everything, including the Mac partition, and start completely over. I'd like to avoid that if possible though.

Here's the output of efibootmgr

BootCurrent: 0080 Timeout: 5 seconds BootOrder: 0080,0000 Boot0000* ubuntu Boot0080* Mac OS X BootFFFF*

Here is the boot info: http://paste.ubuntu.com/24556379/

4
  • Please run the Boot Repair utility and select the "Create BootInfo Summary" option. (DO NOT click "Recommended Repair," at least not yet!) When asked whether to upload the report, click "Yes," and then post the URL provided here. This will give us more details about your configuration, which is required to base an answer on more than guesswork.
    – Rod Smith
    May 9, 2017 at 18:35
  • Thanks! I'm having trouble with the report. After it runs the tests, and I select upload to pastebin, it gives me only: "Please write on a paper the following URL: paste2.org If you are experiencing boot issues, indicate this URL to people who help you. For example on forums or via email." May 10, 2017 at 2:24
  • It should give you more than simply "paste2.org" as a URL; there should be something after that. If not, then maybe you're seeing a network error of some type. If there's an option to save the report to a file, you can try that, then upload the file to a pastebin site and post the URL to your document on that site.
    – Rod Smith
    May 10, 2017 at 13:22
  • Got it, finally! Edited my question. May 11, 2017 at 19:59

2 Answers 2

1

That happened to me as well, so I can give you a little hint.

Install Refind Again

This looks silly but installing refind on Mac can really heal the efi partition that Refind is installed and may change the boot order to the EFI partition so you can switch between them.

If you can: Change bootorder from Ubuntu. In Ubuntu there is a tool called efibootmgr that you can use it as changing boot order.

Writing efibootmgr will give you an output like this:

BootCurrent: 0080
Timeout: 5 seconds
BootOrder: 0080,0001
Boot0000* EFI partition
Boot0001* Mac OS X
Boot0080* Mac OS X
Boot0081* 
Boot0082* 
BootFFFF* 

Applying this command will set bootorder to the efi boot so it will boot directly to Refind:

sudo efibootmgr -o 0000
3
  • So you're saying that I should install rEFInd and then keep it for booting purposes? I'd rather go back to what I had before, namely just having to push option on startup. Have I now corrupted the EFI partition to where that won't work without complete wiping and re-install? Thanks for the help! May 9, 2017 at 15:02
  • There's no evidence that your EFI System Partition (ESP) is corrupted, CharlieBravo; the causes of your boot problems relate to Mac-specific weirdness in handling the boot order. I've just posted a longer answer that provides additional options, but Egrimo's suggestion is likely to be the easiest fix, for reasons that I tried to explain in my answer.
    – Rod Smith
    May 13, 2017 at 14:20
  • @CherlieBravo Sorry for late seing. rEFInd is a boot-menu(not a bootloader). So deleting refind will not break your bootloader, it will directly boot from macos. Installing refind again will heal the first partition that refind created before. The command in Ubuntu will change your boot order that your machine follows and it will directly go to refind, where you can choose easily between macos or ubuntu
    – Ege Sucu
    May 13, 2017 at 21:23
1

Here are some key observations:

  • You have an EFI-mode GRUB installation on your EFI System Partition (ESP).
  • You have a BIOS-mode version of GRUB on your Master Boot Record (MBR), but it points to code that no longer exists, so it's useless at best and could cause a boot failure if it were accidentally launched.
  • You have a hybrid MBR, which activates the Mac's Compatibility Support Module (CSM). In other words, your computer is configured in such a way that it might boot in BIOS/CSM/legacy mode, although that's far from certain to happen.
  • Your grub.cfg file has entries that should launch OS X; however, I can't promise that those entries will actually work.
  • Your EFI is configured to boot GRUB by default. (This is clear from the efibootmgr output on lines 642-648 of your Boot Repair output.) Your description makes it sound like this isn't happening, though.

Some additional key background information:

  • All OSes require boot loaders to boot. These are programs that load a kernel into memory and begin executing it. GRUB is the default boot loader for Ubuntu, but others exist. (See my page on the subject for information on EFI-mode boot loaders for Linux.)
  • In addition to boot loaders, boot managers can be critical. A boot manager presents a menu or some other type of user interface to enable users to select a boot loader to launch (or sometimes other pre-boot tools). Most EFIs, including Apple's, include simple boot managers. GRUB, in addition to being a boot loader, provides boot manager functions. rEFIt, rEFInd, and gummiboot/systemd-boot, are examples of third-party boot managers that are not boot loaders. (The Linux kernel, though, includes its own boot loader, so these programs can act like boot loaders for Linux kernels.)
  • The Mac's built-in boot manager is a bit weird. On most EFI-based computers, the efibootmgr utility in Linux shows the built-in boot manager options. On Macs, though, the built-in boot manager seems to pull its information from some other source, and I'm not sure what that source is. Thus, configuring it to do what you want can be tricky, or at least requires knowledge and procedures that I lack. Macs usually (but not always) honor the first entry in the boot order (BootOrder as reported by efibootmgr), but the menu you get when you hit Alt/Option upon booting is another matter entirely; and in your case even the first entry is being ignored.
  • Macs can boot using either EFI-mode or BIOS-mode boot loaders. EFI-mode is native and, generally speaking, preferable; but BIOS-mode is more-or-less required to boot Windows 7 and earlier on most Macs. BIOS-mode booting requires that the disk use a hybrid MBR. Personally, I recommend EFI-mode booting of Linux on Macs, although there can be exceptions to this rule.

Thus, where you are now is that you should be configured for dual-booting using GRUB as the boot manager; however, it sounds as if the Mac may not be honoring the boot order set in the EFI's boot manager, as reported by efibootmgr.

There are a number of ways you can proceed:

  • Use rEFInd -- If you install my rEFInd boot manager from OS X, it should set things up such that it will take over and enable you to boot either OS X or Ubuntu, with boots to Ubuntu working either via GRUB or by launching the kernel with its EFI stub loader. (rEFInd is also likely to show a non-functional BIOS-mode boot option for Ubuntu. You'll probably want to remove this from the menu.)
  • Restore GRUB as the default boot loader/boot manager -- This could be tricky. As I said, it should be working now. There are two things you might try to get this working:
    • You can use the bless command in OS X to get the system to recognize a boot loader on the ESP as the default. Here's the procedure:
      1. Boot to OS X
      2. Open a Terminal window.
      3. Type mkdir /Volumes/ESP.
      4. Type sudo mount -t msdos /dev/disk0s1 /Volumes/ESP. This should mount your ESP (/dev/sda1 in Ubuntu, which should be /dev/disk0s1 in OS X) to /Volumes/ESP.
      5. Type sudo bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/efi/ubuntu/grubx64.efi --shortform. This "blesses" GRUB, making it the default boot loader.
    • There is a procedure, outlined here, for installing an arbitrary boot loader (such as GRUB) on an HFS+ volume, that seems to work better on Macs than the standard EFI procedure. You could try this method with Ubuntu's GRUB, but you're pretty much on your own for doing so.
  • Get the Mac's boot manager to show a GRUB option, leaving OS X as the default -- This option might require doing something similar to the procedure of moving GRUB to an HFS+ volume, but then using the boot picker in OS X to change the default. You should then be able to use the Mac's built-in boot manager to pick your OS.

In any of these cases, you'd be well-advised to swap out your hybrid MBR for a conventional protective MBR. The reasons are described on my hybrid MBR page, -- namely, hybrid MBRs are ugly and dangerous, and so should be used only when absolutely required, which they (probably) are not in your case. You'd only need a hybrid MBR if you needed to boot Ubuntu in BIOS mode. You can convert your hybrid MBR to a protective MBR using gdisk, as follows:

  1. Launch gdisk on the disk, as in sudo gdisk /dev/sda in Ubuntu.
  2. Type p to view the partition table to be sure you're working on the correct disk.
  3. Type x to enter the experts' menu.
  4. Type n to create a new protective MBR.
  5. Type p again to verify that you've not accidentally changed anything.
  6. Type w to save your changes. You'll be asked to verify this change. Provide it.

You can do this before or after you get everything booting the way you want it to.

In the past, most Ubuntu dual-booters on Intel-based Macs used rEFIt because it Just Worked with most common configurations. rEFIt is no longer maintained, but I forked it to rEFInd. rEFInd also tends to work pretty well, but with the caveat that things have changed enough (both in rEFInd vs. rEFIt and in what a "common configuration" is) that you might need to tweak some rEFInd configuration options. In your case, you might want to edit refind.conf to edit dont_scan_files, dont_scan_dirs, or dont_scan_volumes to hide unwanted or non-functional boot options; or uncomment scanfor and ensure that hdbios is not among the options to hide a non-functional BIOS-mode boot option.

As you can see from the options I presented above, cutting rEFInd out of the equation means adding GRUB into the equation, and getting that to work requires jumping through some extra hoops because Ubuntu isn't set up to jump through those hoops automatically. (In some ways, that's the advantage of rEFInd -- its setup scripts jump through the hoops that Ubuntu's setup tools don't.) You can certainly use GRUB instead of rEFInd and the EFI stub loader, but you must be prepared to go to the extra effort.

If the reason you don't want rEFIt or rEFInd is because you usually boot OS X, be aware that you can reduce the timeout value of rEFInd (perhaps to -1, which causes an immediate boot to the default OS) and set the default (via default_selection) to OS X.

0

You must log in to answer this question.

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