Linux Partition on Mac – How to Create and Delete Later

deletingdual-bootpartitionunix

I've been trying to create some persistent USB Linux thumb drives loaded with Elementary OS and a few other Linux distros, but have had no such luck. I don't really like the idea of partitioning my Mac and installing other OS directly on it, as I like to keep my Mac drive purely macOS, but since I'm having no luck with the persistent thumb drives, I'm considering partitioning my Mac drive and installing the distros on their own partitions. This idea doesn't entirely bother me, but I've been reading of other user who have had issues deleting the partitions after they have been made. I don't want to be stuck with a Linux partition on my comp if I don't care to keep using it. Can anyone here verify if they can delete a Mac partition?

My setup is a 2015 MacBook Pro 15 inch Retina running macOS 10.12.6 (Sierra).

Thanks.

Best Answer

I can make some suggestions regarding creating and removing Linux related partitions on a Mac.

  • The disk tools provide by Apple are 100% unreliable with respect to Linux related partitions. I am not saying that occasionally a tool provided by Apple will not work as documented, but if it does, soon a update will occur causing a change in the behavior of the tool. Two of the most used Apple disk tools are the Disk Utility application and the diskutil command.
  • To install Linux, you usually have to shrink your Mac partitions to create free space. For this you can use the disk tools provided by Apple. However, if you need to create new partitions, then make sure the these partitions are of a type frequently encountered by Apple. Microsoft FAT32 partitions are a good choice. So for example, if you need a ext4 and swap partitions for Ubuntu, then use Apple's disk tools to shrink your macOS partitions and create two new FAT32 partitions. Later, when installing Ubuntu, you can use the Ubuntu partitioning tools to delete the FAT32 partitions and recreate the necessary ext4 and swap partitions.

  • Apple disk tools should not be used to remove Linux related partitions. Once the Linux partitions have be removed, Apple's disk tools should be used to reclaim the free space. Many of the tools, you can choose from to the remove Linux related partitions, will need to be run with System Integrity Protection (SIP) disabled or from Recovery mode. Another option would be to boot from an external drive and then remove the partitions from the internal drive. Some popular command line tools are gpt and gdisk.

  • Apple started eliminating the BIOS boot option in Mac models starting with the 2015 model year. Therefore, you probably should only choose Linux versions that can 64 bit EFI boot. This means the boot code, for which ever Linux you choose, will be installed in the EFI partition. So, to boot an installed Linux may require modifying the EFI partition or installing the rEFInd Startup Manager into this EFI partition.
  • If you do not have a lot of experience installing Linux, you may what to first install in a virtual machine. A free virtual machine software called VirtualBox is provide by Oracle. I often try different installation configurationss, using the same Linux iso file, before installing in a actual Mac computer.