50GB of disk space missing
On a 120GB SSD hard drive in a MacBook only 70GB are available. The missing 50GB are not even shown as free space.
Here is what the output of Disk Utility looks like:
As you can see on the first screenshot the disk has 120GB. However, the partition chart on the same screenshot only shows 70GB. Also the other two screenshots show that only 70GB out of 120GB seem to be available.
The command diskutil list
shows that the physical disk0
is 120GB big, but the synthesized disk1
only 70GB:
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 70.0 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +70.0 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD 60.2 GB disk1s1
2: APFS Volume Preboot 21.7 MB disk1s2
3: APFS Volume Recovery 509.9 MB disk1s3
4: APFS Volume VM 2.1 GB disk1s4
Solution 1:
You previously installed Windows (or another OS) and deleted it afterwards - except an orphaned Apple_BOOT or 2nd EFI partition (disk0s3 - 134.2 MB).
The 50 GB are simply unallocated disk space.
To expand your APFS container you have to remove the third partition and resize the container:
First convert the third partition to free space:
sudo diskutil eraseVolume "Free Space" %noformat% /dev/disk0s3
Then expand your APFS container to the max (0 is a magic size here):
diskutil apfs resizeContainer disk0s2 0
Solution 2:
The solution
The amazing klanomath, who posted the first reply guided me through the debugging process and we were able to solve the problem. At this point I would like to thank him for all the time he took to help me.
The problem seemed to be that in the past I installed a different OS using Bootcamp, and after I deleted it Bootcamp failed to return the space that was allocated for it, so that 50GB of space got orphaned.
One hint to this is is the volume disk0s3
that one can see on the first screenshot. This was probably the bootloader for the other OS.
Here are the steps that led to the solution:
Probably it is a good idea to make a Time Machine backup before messing with the hard drive.
-
Delete
disk0s3
by runningsudo diskutil eraseVolume "Free Space" %noformat% /dev/disk0s3
Boot into the Internet Recovery Mode by restarting your computer and holding Alt+Cmd+R while booting. Then open the Terminal via Menu Bar → Utilities
The architecture of the hard drive is the following:
disk0
is the physical storage, on top of it is the containerdisk0s2
. This container accommodates the synthesizeddisk1
, which, in turn, contains the volumedisk1s1
. For some reason, when I booted into the Recovery mode mydisk1
becamedisk2
anddisk1s1
becamedisk2s1
. Make sure you insert the correct labels. The commandsdiskutil list
anddiskutil ap list
are helpful to single out the right ones.-
Unlock
disk1s1
by runningdiskutil ap list
and copy its UUID, in our case it's9AFD4588-AA1A-3413-9335-6C8DA8EA3973
. Then rundiskutil ap unlockVolume 9AFD4588-AA1A-3413-9335-6C8DA8EA3973
and enter your password. You don't need to lock it afterwards.
-
Run some checks on the disks, containers, and volumes that we are going to modify:
diskutil verifyDisk disk0 diskutil verifyVolume disk0s2 diskutil verifyVolume disk1s1
and make sure there are no errors.
-
Grow the
disk0s2
container:diskutil ap resizeContainer disk0s2 0
The zero at the end is a magic number that makes sure the container is grown to the maximum.
Verify the result with
diskutil list
anddiskutil ap list
.
Here is my end result:
diskutil list
:
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 121.1 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +121.1 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD 60.1 GB disk1s1
2: APFS Volume Preboot 22.4 MB disk1s2
3: APFS Volume Recovery 509.9 MB disk1s3
4: APFS Volume VM 1.1 GB disk1s4
diskutil ap list
:
APFS Container (1 found)
|
+-- Container disk1 E18387BD-AC00-4EC1-9446-C865C525F706
====================================================
APFS Container Reference: disk1
Capacity Ceiling (Size): 121123069952 B (121.1 GB)
Capacity In Use By Volumes: 61859213312 B (61.9 GB) (51.1% used)
Capacity Available: 59263856640 B (59.3 GB) (48.9% free)
|
+-< Physical Store disk0s2 727CB82C-B58F-4B11-BB65-7177A5951E29
| -----------------------------------------------------------
| APFS Physical Store Disk: disk0s2
| Size: 121123069952 B (121.1 GB)
|
+-> Volume disk1s1 9AFD4588-AA1A-3413-9335-6C8DA8EA3973
| ---------------------------------------------------
| APFS Volume Disk (Role): disk1s1 (No specific role)
| Name: Macintosh HD (Case-insensitive)
| Mount Point: /
| Capacity Consumed: 60126756864 B (60.1 GB)
| FileVault: Yes (Unlocked)
|
+-> Volume disk1s2 6F75B394-3A04-419B-A2AF-62270D0DB902
| ---------------------------------------------------
| APFS Volume Disk (Role): disk1s2 (Preboot)
| Name: Preboot (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 22441984 B (22.4 MB)
| FileVault: No
|
+-> Volume disk1s3 AACD802A-DC54-4D3E-8556-BE56B7D229B7
| ---------------------------------------------------
| APFS Volume Disk (Role): disk1s3 (Recovery)
| Name: Recovery (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 509853696 B (509.9 MB)
| FileVault: No
|
+-> Volume disk1s4 13865AE2-BA44-4DD2-8A37-80169D319CC4
---------------------------------------------------
APFS Volume Disk (Role): disk1s4 (VM)
Name: VM (Case-insensitive)
Mount Point: /private/var/vm
Capacity Consumed: 1073786880 B (1.1 GB)
FileVault: No
P.S.: At first I tried to grow the container from the operating system, and not from the recovery mode, and run diskutil ap resizeContainer disk0s2 0
in the terminal without any unlocking. This did not work and my computer froze except for the mouse, so that a reset via the power button was necessary. This was quite a scary moment!
Solution 3:
Same issue for me with macOS Catalina. But after using these commands it works perfectly. First, I run:
diskutil list
to see what is going on. Then I erase EFI no name (got two of them):
sudo diskutil eraseVolume "Free Space" %noformat% /dev/disk0s4
Then I use:
diskutil apfs resizeContainer disk0s2 0
And everything went back to normal without needing recovery mode :)