Skip to content

Instantly share code, notes, and snippets.

@usmcfiredog
Last active July 4, 2021 21:57
Show Gist options
  • Save usmcfiredog/977f8f35b333817d964d90cfc8afee23 to your computer and use it in GitHub Desktop.
Save usmcfiredog/977f8f35b333817d964d90cfc8afee23 to your computer and use it in GitHub Desktop.

Triple Boot 2014 MacBook Pro - macOS Windows Linux

Steps to create a triple boot Mac without extra software

macOS Partition

Start with a MacBook Pro with only macOS installed

Windows Partition

  1. Open Boot Camp Assistant
  2. Follow the instructions
  3. Set the size of the Windows partition
  4. Finish the whole installation of Windows
  5. Boot back into macOS

Linux Partion

Note: this is for APFS only

  1. Start in macOS
  2. Open terminal
  3. Enter the following command to create the dummy partitions

use the following if you want a swap partition

sudo diskutil apfs resizeContainer disk0s2 400G exfat DUMMY1 200M exfat DUMMY2 200M DUMMY3 200M

use the following if you do not want a swap partition

sudo diskutil apfs resizeContainer disk0s2 400G exfat DUMMY1 200M exfat DUMMY2 200M
  1. Launch the Linux installer
  2. Open a terminal Note: Might need a live disk if the installer doesn't have a way of getting to a shell
  3. Enter the following commands to save the current EFI files to a different folder
sudo -i
mkdir efi
mount /dev/sda1 efi
mv efi/EFI efi/EFI.win
umount efi
rmdir efi
exit
  1. Start the installation of Linux

  2. When you get to the partition screen select manual

  3. Delete the DUMMY partitions created in Step 3

  4. Create a new partition with a size of 210MB and make the partition type EFI System Partition

  5. Create the root partition at the size you prefer based on Step 3

  6. Create a swap partition if wanted

    Note: Use either the rest of the partition size or set a specific size

  7. Finish the installation

  8. When the system reboots it should go directly into Linux

  9. Open a terminal and enter the following commands to move the Linux EFI files to the new EFI Partion

sudo -i
mkdir efi
mount /dev/sda3 efi
mv /boot/efi/EFI efi
mv /efi/EFI/{linux_distro} /efi/EFI/Boot
mv /efi/EFI/Boot/grubx64.efi /efi/EFI/Boot/bootx64.efi
mv /boot/efi/EFI.win /boot/efi/EFI
umount efi
rmdir efi

Note: if the folder under /efi/EFI is named boot already enter the following.

sudo -i
mkdir efi
mount /dev/sda3 efi
mv /boot/efi/EFI efi
mv /boot/efi/EFI.win /boot/efi/EFI
umount efi
rmdir efi
  1. Set a label for the new EFI partition with the following
fatlabel /dev/sda3 EFI2
  1. Get the UUID for sda1 and sda3 with the following command
blkid /dev/sda1 /dev/sda3 | awk 'NR==1{print $1,$2} NR==2{print $1,$2}'
  1. Edit the /etc/fstab file and replace the UUID from /dev/sda1 with the UUID from /dev/sda3
  2. Make sure the drive is not using hybrid partitioning. This can be accomplished by entering the command given below.
gdisk /dev/sda

This command is interactive. The interactive commands you will need to enter when prompted by gdisk are given below.

x
n
w
y
  1. Exit out of the terminal and restart the Mac and boot into the Mac partition. This can be done by holding the ⌥/Option/Alt key down and selecting macOS partition
  2. Download a collection of icons from the sourceforge web site Mac Icons and open the mac-icns.dmg file.
  3. Open terminal and enter the following command to mount the EFI partition /dev/disk0s3 containing the Linux boot files.
sudo diskutil mount disk0s3
  1. Enter the following command to copy your Linux Distro Icon to the Linux Boot Partition
cp /Volumes/mac-icns/OSX10.11.6/os_{linux_distro}.icns /Volumes/EFI2/.VolumeIcon.icns
  1. Enter the command to change the label that will be shown below the Linux Distro icon on the Startup Manager menu.
bless --folder /Volumes/EFI2/EFI/Boot --label "{linux_distro}"

Note: you can change the icon for the Windows partition by repeating Steps 22 and 23 for disk0s1 and the folder would be /Volumes/EFI/ in Step 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment