Can’t resize APFS Container: Not enough free space in Container due to APFS limits or tidemarks

apfsdisk-utilitypartition

When I try to resize my APFS container, I get the following error:

Error: -69531: There is not enough free space in the APFS Container for this
operation due to APFS limits or APFS tidemarks (perhaps caused by APFS Snapshot
usage by Time Machine)

I followed this guide:

How to Resize Your APFS Container on macOS High Sierra

Is there any way to resize my APFS container without backing up to Time Machine, wiping the disk, then recreating the partitions?

More details below:

Here is the output from the diskutil apfs utility when I attempt to resize:

$ sudo diskutil apfs resizeContainer disk0s2 750g jhfs+ Extra 250g

Started APFS operation
[ - 0%................................................... ]

Aligning shrink delta to 250,240,966,656 bytes and targeting a new physical
store size of 749,999,996,928 bytes

Determined the minimum size for the targeted physical store of this APFS
Container to be 997,029,183,488 bytes

Error: -69531: There is not enough free space in the APFS Container for this
operation due to APFS limits or APFS tidemarks (perhaps caused by APFS Snapshot
usage by Time Machine)

Here is my diskutil configuration:

$ diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         1.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         1.0 TB     disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.0 TB     disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            380.3 GB   disk1s1
   2:                APFS Volume Preboot                 21.8 MB    disk1s2
   3:                APFS Volume Recovery                517.8 MB   disk1s3
   4:                APFS Volume VM                      2.1 GB     disk1s4

Here is the total of those volumes (calculated manually by me):

   #:                       TYPE NAME                    SIZE       IDENTIFIER
/dev/disk1 (synthesized):
                     TOTAL                             922.0 GB 

And when I go to Disk Utility, press the "Partition" button in the toolbar, and manually enter a size for my main disk partition, it won't let me set it under 997 GB, leaving only 3 GB for new partitions:

Disk Utility

Best Answer

This is the key part of the error message:

(perhaps caused by APFS Snapshot usage by Time Machine)

You must remove the local snapshots. First, list them:

$ tmutil listlocalsnapshots /

You may wish / need to delete local snapshots one by one from taking the date from the listing above:

$ tmutil deletelocalsnapshots 2018-07-14-211120

You can also thin them based on the amount of space you wish to reclaim by asking for a lot of space back:

$ tmutil thinlocalsnapshots / 9999999999999

Then, you can resize your APFS partition:

$ sudo diskutil apfs resizeContainer disk0s2 750g