rEFInd – Fix Menu Not Showing on Dual Boot Mac/Ubuntu Machine

dual-bootgrub2macrefind

I'm having a little of a problem with rEFInd and couldn't find something
specific about it.

I succesfully installed Ubuntu 14.04 for dual boot with OS X Yosemite on
my MacBook Pro 3.1 using rEFInd but now after booting into Ubuntu the
rEFInd menu doesn't show after a reboot. It just goes straight into
grub. After booting again into OS X (using the option key on startup) sometimes rEFInd comes up, sometimes not, couldn't figure out how it is triggered.

Is there way to ensure rEFInd is coming up first, no matter which OS i
booted previously?


Edit

Using efibootmgr -v gives me:

BootCurrent: 0001
Timeout: 5 seconds
BootOrder: 0001,0080,0000
Boot0000* opensuse-secureboot   HD(4,1962b000,4e800,11f33185-0ff8-493d-86bd-b9fee568adb8)File(\EFI\opensuse\shim.efi)
Boot0001* ubuntu    HD(1,28,64000,7e798e0a-82c3-4719-95ed-d79675efd190)File(\EFI\ubuntu\shimx64.efi)
Boot0080* Mac OS X  HD(1,28,64000,7e798e0a-82c3-4719-95ed-d79675efd190)File(\EFI\refind\refind_x64.efi)
Boot0081* Mac OS X ACPI(a0341d0,0)PCI(1f,2)03120a00000000000000HD(2,64028,1d02ba00,0b1ce04a-50b7-40b5-94f0-1a255d748d15)
Boot0082* ACPI(a0341d0,0)PCI(1f,2)03120a00000000000000HD(2,64028,19490d60,20cc89c9-1320-4d70-b8bb-fffdf9900374)
BootFFFF* ACPI(a0341d0,0)PCI(1f,2)03120a00000000000000HD(2,64028,19490d60,20cc89c9-1320-4d70-b8bb-fffdf9900374)File(\System\Library\CoreServices\boot.efi)

If I set the NextBoot with the -n-option to 0080, after reboot, rEFInd comes up. FFFF brings me directly into OSX. 0081 seems to fail.

Thanks for the help!

Best Answer

OSes sometimes reset the default boot program, particularly if they upgrade their standard boot loaders. There's really no way to prevent this from happening, so you must simply know how to correct the problem when it occurs. In Linux, this is done by using the efibootmgr program. In OS X, it's done via bless. See here for more on efibootmgr.

If this juggling is happening every time you reboot, then something is seriously wrong. If Ubuntu is resetting GRUB as the default on every reboot, then personally, I'd remove it -- but I'm not a fan of GRUB (enough so that I forked rEFIt to make rEFInd rather than deal with GRUB). I suppose you could also put a call to efibootmgr in a shutdown script, but that runs the risk of becoming disconnected from reality and causing problems, so I'd be reluctant to do that.


EDIT:

Yes, changing the BootOrder variable (via the -o option to efibootmgr) as you suggest is appropriate. You can delete the OpenSUSE entry with:

sudo efibootmgr -b 0 -B

There may be OpenSUSE files installed that you can delete using rm -- probably sudo rm -r /boot/efi/EFI/opensuse from Ubuntu. (These files shouldn't do any harm per se, but they could be confusing or be accidentally re-activated in the future.) You can remove the Ubuntu GRUB in a similar way, although it might be re-installed if/when Ubuntu updates it in the future. Also, keeping it around as a backup method of booting may make sense.

If you leave Ubuntu's GRUB installed but don't want to see it in rEFInd's menu, you can use dont_scan_dirs or dont_scan_files in refind.conf (probably /boot/efi/EFI/refind/refind.conf from Ubuntu) to hide the GRUB entry.

Related Question