Free Space in Physical Disk unable to be merged back to the main disk.
Introduction
Hello there. I use a MacBook Air (13-inch, 2017) with macOS High Sierra currently running on Version 10.13.4 . CPU is an i5 and 8GB of RAM. The SSD I use contains about 251 GB of storage space, but only 197GB of that is allocated to the main Disk (Macintosh HD), with the remaining 53GB becoming "Free Space". When I run diskutil list I get the following output:
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 197.0 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +197.0 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD 110.0 GB disk1s1
2: APFS Volume Preboot 22.2 MB disk1s2
3: APFS Volume Recovery 519.1 MB disk1s3
4: APFS Volume VM 2.1 GB disk1s4
5: APFS Volume Youtube Volumes 556.9 MB disk1s5
/dev/disk2 (disk image):
#: TYPE NAME SIZE IDENTIFIER
0: CCCOMA_X64FRE_EN-US... +5.8 GB disk2
As you can see, there's some notable storage space locked behind "Free Space". The main speculation behind that is that when Uninstalling Bootcamp through BCA, it crashed and could not reallocate the space back into the main drive, causing it to become free space.
Failure of Disk Utility
At first, I thought that maybe resizing the partition through Disk Utility would be possible. So I opened up DU in Both the Normal working environment and recovery mode. I ran a first aid but there was nothing wrong with the disk. So I tried to resize the partitions on the disk. The first problem I encountered is that when I tried to drag the circular slider to resize the Partition, DU Immediately crashes. Like the application just quits. In Recovery Mode, it just jumps back to the Utility page. No idea why.
I then tried to select the Free Space and clicked the "-" Button to remove it. There are 2 situations that I've encountered: One is that the new Macintosh HD Partition now becomes about 350GB of storage With the original Free Space multiplied by 3 times. When I clicked Apply, it told me that The allocated space to the Macintosh HD was larger than the allowed partition space (250 GB). So that failed obviously.
Another situation was that The free space was fully removed and Macintosh HD showed 251 GB of space. This was the correct situation so I clicked Apply. However, no matter how many times I've tried this method, It told me something like this:
Running operation 1 of 1: Remove “--”…
An internal error has occurred and the disk for one of the specified operations could not be found. This may be a temporary issue, try again.
Operation failed…
I've browsed the web for errors like these and all said that using BCA or Terminal was the correct way to solve the error. So I proceeded with BCA.
Failure using Bootcamp Assistant
Bootcamp Assistant did not recognize that I had previously had a copy of windows installed on the laptop before, so I could not recover the lost free space with its Uninstallation mechanism. So I decided to Install Bootcamp Windows again, to try to force that free space into BC Windows and Uninstall it to get all the disk space back.
At first, BCA told me that there was not enough space to be partitioned (40 GB). There was a bug with time machine local snapshots so I removed them and thoroughly backed up my laptop once again. After providing it with the ISO file, It told me this:
Your disk could not be partitioned
An error occurred while partitioning the disk. Please run Disk Utility to check and fix the error.
So apparently, both BCA and DU failed to solve the problem.
I'm a bit trash on console commands, so I did not try that at first. I was afraid that I would accidentally kill the drive if I deleted the wrong partitions as I have no clue on how to analyze them. Please give me some advice below so I can solve this problem that has been annoying me since earlier this year. I have also made a backup on a portable hard disk with Timemachine, so if the entire disk has to be wiped and reinstalled, I can just restore the Entire system back into the hard drive. However, will this cause the Original Partition to be restored as well, or will the free space just disappear? Thanks!
MacBook Air