2

I have a Macbook pro (late 2015) with two partitions: one with Mac OS and the other one with an Ubuntu 16.04 LTS operating system. It was always booting to Ubuntu by default and I used the Alt-key on startup to boot into Mac OS when I needed to.

A few days ago there was a hardware issue on my macbook, so I brought it to the nearest Apple Store and they fixed the problem. After I received it back from the store, I noticed that it is now booting to Mac OS by default.

I checked the partitions to see, whether the Ubuntu system was removed by the store or if they wiped the HD but everything seems to be in place.

How can I restore the old behavior so my Macbook boots into Ubuntu by default again?

Thanks in advance.

1 Answer 1

2

It sounds like you're suffering from what I call a boot coup. See that page for details, but you can try this:

  1. Boot to Ubuntu. Given your current situation, you may need to use an Ubuntu installation disk in its "try before installing" mode or use my rEFInd boot manager on a USB flash drive or CD-R to boot into your regular Ubuntu on a one-time basis.
  2. In a Terminal window, type sudo efibootmgr -v. This will show your current EFI boot options. My suspicion is that one of these will be called ubuntu, but that the BootOrder will show a macOS entry as being first. (If efibootmgr complains that it can't find EFI boot variables, then you've booted in BIOS/CSM/legacy mode. Try again, but pick a different boot option for Ubuntu.)
  3. At this point there are two possibilities:
    • If I'm right in my suspicion that you have an existing ubuntu entry, you can set it first by typing sudo efibootmgr -o ####[,####,####,....], where the first #### is the number of the ubuntu entry and subsequent numbers are the remaining entries in the current boot order. Alternatively, you could use the refind-mkdefault script described on my boot coup page, and that comes with rEFInd. You can download it directly here. Type sudo ./refind-mkdefault --label ubuntu to set the Ubuntu entry as first.
    • If efibootmgr does not show an ubuntu entry, then you need to create a new one. The command to do so is sudo efibootmgr -c -d /dev/sda -p 1 -l \\EFI\\ubuntu\\grubx64.efi -L ubuntu. You can omit -d /dev/sda if that's the hard disk where GRUB is installed and -p 1 if your ESP is partition #1; and if your disk and/or partition are not those values, you must adjust the efibootmgr command appropriately. If you were using a UEFI-based PC, it would be safer to specify shimx64.efi rather than grubx64.efi. On a Mac, either should work; but on the off chance that shimx64.efi isn't installed, grubx64.efi will work and is more direct. As an alternative to this, you could run Boot Repair. This is less intimidating if you're not comfortable with text-mode command-line tools, but Boot Repair is overkill and runs a small risk of making matters worse, so I prefer to stick with efibootmgr as a first attempt.

If neither of these approaches work, it could be that your Ubuntu was installed in BIOS/CSM/legacy mode. In this case, there are several possibilities for how to recover it to boot in that mode again, depending on what's wrong; but it's likely to be easier to recover it to boot in EFI mode by using Boot Repair in EFI mode or by installing rEFInd from OS X. The latter will change how you boot, though; instead of holding down Alt to select your OS, the rEFInd menu will appear automatically on every boot and enable you to pick your OS.

You must log in to answer this question.

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