7374756666

Making Ubuntu the default boot option on a dual boot Mac

I have a late 2015 Mac book pro with Ubuntu 16.04 Mate as the default OS and Mac High Sierra as the secondary OS.

When upgrading to High Sierra (or the Mac recovery partition gets updated) Mac makes itself the default boot system.

This is a bit awkward to fix inside MacOS, to fix it create a live Ubuntu 16.04 Mate USB stick, boot into the live environment (hold the option key at boot and select EFI boot).

Note my system uses a luks encrypted disk with LVM paritions, odds are if you're reading this you've done the same.

In the live environment run the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -ex
#unlock the drive
cryptsetup luksOpen /dev/disk/by-uuid/fc1952a7-6dbd-4f0d-87b4-94f2067cfbed crypt_root
#activate the lvm volumes
vgscan
vgchange -ay 
sleep 2
#mount the lvm parititions
mount /dev/mapper/root-root /mnt
#this is your unencrypted ubuntu /boot paritition possibly /dev/sda3
mount /dev/disk/by-uuid/6dca495f-15e5-483a-92c6-228bb23b60ea /mnt/boot
#this is your Mac EFI parition /dev/sda1 unless you've done something weird
mount /dev/disk/by-uuid/67E3-17ED /mnt/boot/efi
#bind mount dev/proc/sys
mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
#chroot into the os
chroot /mnt

Once inside the chroot run the following:

1
2
3
4
5
6
7
8
9
#!/bin/sh
set -ex
#update the device map, probably not required but better safe than sorry
grub-mkdevicemap
#find out the device which the EFI partition is part of, you if you know it's /dev/sda1 
#then you can run grub-install /dev/sda1 instead
grub-install $(blkid | grep 67E3-17ED | awk '{ print $1 }' |  sed 's/://')
#update grub!
update-grub

Now reboot and you should be in luck!