Well for anyone interested in a solution, it's now possible.
I've followed this guide and managed to reclaim all available space and resize my main partition back to full disk space.
Thanks everyone for help and suggestions.
The folks at Apple seem to be operating under a paradigm where no drive space is ever unallocated. Therefore, when System Integrity Protection (SIP) is enabled, the macOS operating system prevents execution of any utilities or commands which could report the location of lost space on system drives. Your Mac uses a single
physical system drive named /dev/disk0
.
System drives generally contains two types of partition tables. The first is the Master Boot Record (MBR) table and the second is the GUID Partition Table (GPT). The command fdisk
dumps the contents of the MBR table, while the command gpt
partially dumps the contents of the GPT. To used these command on a system drive, you need to either disable SIP or execute the commands while booted to macOS Recovery. The commands you need to enter are given below
fdisk /dev/disk0
gpt -r show /dev/disk0
The gpt
commands prints a table of the space occupied by each partition. The table also prints unallocated space. Generally, you need to know which partitions are located before the lost (unallocated) space you wish to recover. Usually, the diskutil
command can then used to recovery this space. Although, other commands such as fdisk
, gpt
and gdisk
can also be used.
Note: Generally the identifier produced by disktuil
output contains the index for a given partition. This is not alway true. You may need to consider other output from both the diskutil
and gpt
commands before matching a partition index with an identifier.
If you could post the output from the above commands, then someone (or I) could help with the correct commands to repair your Mac.
Update 1
You can erase the Apple_KernelCoreDump` partition by executing the command given below. The result will a block of free space the the end of your drive. The size of this block will be about 61 GB.
sudo diskutil erasevolume free n disk0s5
Beyond this change, I am not sure what to post. I need to know how you want the drive partitioned. So far, you have mentioned partitions for ExFat and Windows. Currently you have Apple_HFS
and Apple_Boot
partitions. You can not merge the free space back to the APFS container until these partitions are erased. Also, if you are going to reinstall Windows, you probably should state the model/year of your Mac and the version of Windows.
Update 2
The following command will return all free space back to the APFS partition.
sudo diskutil erasevolume free n disk0s3
sudo diskutil apfs resizecontainer disk0s2 0
If the above commands work, are you then going to attempt to install Windows 10 through the use of the Boot Camp Assistant? Other users have reported problems using the Boot Camp Assistant when the internal physical drive has an APFS partition.
Best Answer
Yes, it possible to have multiple macOS installations inside a single container with multiple virtual partitions, but some of the partitions will be shared.
I started with High Sierra installed to volume labeled
Macintosh HD
in a APFS container. I using the Disk Utility application to add a new APFS volume labeledMacintosh HD 2
. Next, I downloaded High Sierra from the App Store and installed to theMacintosh HD 2
volume. The result fromdiskutil list
is shown below.While both High Sierra installations use different root volumes (disk2s1 and disk2s5), the installations share
disk2s2
,disk2s3
anddisk2s4
.Next, I created another APFS volume labeled
Mojava 1
and then downloaded Mojava Beta from this Apple website. The result after installing is shown below.Mojava installed to
disk2s6
and shares sharedisk2s2
,disk2s3
anddisk2s4
with the other two High Sierra installations.So there is now three macOS Recoveries for both High Sierra and Mojava. In my case, both High Sierra macOS Recoveries are Version 1.0 (327) and the Mojava macOS Recovery is Version 1.0 (330).
I can boot to one of the three macOS Recoveries stored on
disk2s3
by holding down the ⌘+R key combination at startup. If the default startup disk is a APFS volume containing macOS, then the corresponding macOS recovery will startup. For example, if the startup disk is set to the APFS volumeMachintosh HD 2
, then holding down the ⌘+R key combination at startup will result in the Mac booting to High Sierra macOS Recovery on APFS VolumeMy Recovery
.BTW: Removing Mojave from the APFS container is covering in my answer to the question: Erase an APFS volume?