Cannot resize APFS partition - “The new size must be different than the existing size”

This helped me:

  1. repair (internal, disk0 - in your case)

    diskutil repairdisk disk0

  2. resize (synthesized, disk1 - in your case with HS)

    diskutil apfs resizeContainer disk1 0

After repairdisk resizeContainer works with no errors. You can see a similar issue over here for more context: Cannot resize APFS partition - "The new size must be different than the existing size"


This error message occurs when there is little or no free space directly below the APFS container you are trying to enlarge. For example, below is the diskutil list disk2 output of a disk image where virtually all the free space has been allocated to partitions.

/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +1.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS tbd                     749.9 GB   disk2s2
   3:                 Apple_APFS Container disk3         249.8 GB   disk2s3

One can see 209.7 MB + 749.9 GB + 249.8 GB = 1.000 TB. If the following commands are entered, then disk2s1 and disk2s2 will be converted to free space.

diskutil erasevolume free none disk2s1
diskutil erasevolume free none disk2s2

The resulting output from diskutil list disk2, after entering the above commands, is shown below.

/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +1.0 TB     disk2
   1:                 Apple_APFS Container disk3         249.8 GB   disk2s3

The command given below can be used to return free space directly below a apfs partition to the enclosed apfs container.

diskutil apfs resizeContainer disk2s3 0 

However, since all significant free space is above the partition, the following error message is generated.

Started APFS operation
Error: -69743: The new size must be different than the existing size

The exact position and size of the disk2s3 partition can be determined by entering the following command.

diskutil info disk2s3 | grep -e Offset -e Size

In this case, the command produces the following output.

   Partition Offset:         750209736704 Bytes (1465253392 512-Byte-Device-Blocks)
   Disk Size:                249.8 GB (249790263296 Bytes) (exactly 487871608 512-Byte-Units)
   Device Block Size:        512 Bytes

The following sum results in the ending position of the disk2s3 partition.

750,209,736,704 bytes 249,790,263,296 bytes  = 1,000,000,000,000 bytes = 1.000 TB

One can see the there is no appreciable free space after the disk2s3 partition, which is why the error message appeared.

The exact size of the disk image can be determined by entering the following command

diskutil info disk2 | grep Size

In this case, the output is shown below.

   Disk Size:                1.0 TB (1000000020480 Bytes) (exactly 1953125040 512-Byte-Units)
   Device Block Size:        512 Bytes

This shows 20480 bytes of space exists after the end of the disk2s3 partition. However, not all of this is free space. Part of this space is occupied by the backup copy of the GUID partition table (GPT).

Since this is a disk image, the following command can be entered without having to disable System Integrity Protection (SIP).

gpt -r show /dev/disk2

In this case, the command produces the following output.

       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  1465253358         
  1465253392   487871608      1  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
  1953125000           7         
  1953125007          32         Sec GPT table
  1953125039           1         Sec GPT header

This output shows there are actually 7 sectors of free space after the disk2s3 partition. Since the sector size (device block size) is 512 bytes, the free space computes to 3,584 bytes. This is smaller than the 4096 byte allocation block size required for the diskutil apfs resizeContainer disk2s3 0 command to proceed.

Presently, the allocation block size for APFS is fixed at 4096 bytes. In this case, the allocation block size can be confirmed by entering the command given below.

diskutil info disk3s1 | grep Allocation

The output from this command is shown below.

   Allocation Block Size:    4096 Bytes