Below is the offsets and sizes of the two partitions on the drive.
The offset of disk0s1
is 409,600
bytes.
The size of disk0s1
is 209,715,200
bytes.
The offset of disk0s2
is 51,351,912,448
bytes.
The size of disk0s2
is 68,682,190,848
bytes.
Using the above data, the space between the partitions can be computed, as shown below.
(size of disk0s2) - (size of disk0s1) - (offset of disk0s1)
= 51,351,912,448 bytes - 209,715,200 bytes - 409,600 bytes
= 51,141,787,648 bytes (approximately 51.1 GB)
The command given below adds free space found immediately after disk0s2
back to the APFS container inside the partition.
diskutil apfs resizeContainer disk0s2 0
Since the 51.1 GB
of free space occurs immediately before disk0s2
, the command given above will not be able to return this free space back to the APFS container.
The easiest course for action would be to backup, erase the drive and reload. While it may be possible to use macOS to fix the drive without using a backup, this would require creating two APFS containers on the same drive. Apple did not design macOS to handle multiple APFS containers on the same drive and should only be attempted by advanced users.
Another possible solution would be to use third party software to move the APFS container partition (disk0s2
). One possible pay utility is offered by Paragon. The free GNOME Partition Editor (GParted) utility reports being able to move APFS partitions.
How to Create a GParted Bootable Flash Drive
Note: The operating system was macOS High Sierra Version 10.13.6
- Download the gparted-live-0.33.0-2-amd64.zip file. I assume this file will download to your
Downloads
folder. After the download completes, the zip file will be automatically convert to a folder named gparted-live-0
.
Use the Disk Utility application to erase a 500 MB
or larger flash drive. Select the options shown below.

Using the Finder application, open the folder named gparted-live-0
. The contents are shown below. Use the Finder application to copy the contents to the flash drive.

How to Boot from a GParted Flash Drive
Note: This was tested using an iMac (21.5 inch, Late 2013) with the latest firmware updates installed.
- Insert the flash drive in a USB port on the Mac.
- Restart the Mac and immediately hold down the option key.
- When the Startup Manager icons appears, choose the external drive icon labeled
EFI Boot
.
When prompted, I choose the default startup option.
diskutil info disk0s1 | grep -e "Offset" -e "Disk Size"
anddiskutil info disk0s2 | grep -e "Offset" -e "Disk Size"
– David Anderson Mar 25 '19 at 16:23