APFS Volume not claiming available APFS Container space

apfscore-storagedisk-utilityfusion-drivepartition

I'm at my wit's end with this, and I can't find anything about it in documentation or questions, so I thought I'd ask one.

I had an APFS Fusion Drive that included two drives: (120+500) GB. I cloned (dd) the 500 GB drive to another 1 TB drive and exchanged it. All good so far, except the 1 TB drive acts as a 500 GB, as expected.

I boot into recovery mode and after getting the proper disk identifier of the APFS Container Scheme (disk2, in this case) and unlocking the volume, I tried:

-bash-3.2# diskutil apfs resizeContainer disk2 0

It seemed to work, saying that it was "Growing APFS Physical Store…", but Disk Utility was still only showing the 500 GB, so I later decided to try 'gpt'. I first removed the partition (2) from the physical disk (disk0), and then re-added it in place with the size expanded to fill the drive (1952915488):

-bash-3.2# gpt remove -i 2 disk0
disk0s2 removed
-bash-3.2# gpt add -b 409640 -i 2 -s 1952915488 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0

This seems to have resized the partition size properly, but the size of the APFS Container Scheme and Volume remain at the original ~620 GB, even though the Physical Store references seem to be correct (disk0s2, disk1s2):

-bash-3.2# diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk2         1000.0 GB  disk1s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         119.8 GB   disk0s2

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +619.7 GB   disk2
                                 Physical Stores disk0s2, disk1s2
   1:                APFS Volume Macintosh HD            529.7 GB   disk2s1
   2:                APFS Volume Preboot                 23.4 MB    disk2s2
   3:                APFS Volume Recovery                514.0 MB   disk2s3
   4:                APFS Volume VM                      4.3 GB     disk2s4

-bash-3.2# gpt show disk0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34           6         
          40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      409640  1952415488      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
  1952825128      700007         
  1953525135          32         Sec GPT table
  1953525167           1         Sec GPT header
-bash-3.2# gpt show disk1
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  234031968      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
  234441608          7         
  234441615         32         Sec GPT table
  234441647          1         Sec GPT header

I've tried resizeContainer on disk2 again after seeing that the size didn't change to 1.12 TB, but I get the following, which makes sense since disk1s2 is already resized:

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

Disk Utility, however, recognizes the Fusion Drive as 1.12 TB, but the Container and Volume are still limited to 620 GB, and trying to partition the volume shows that there is a giant usable 1.12 TB partition:
Fusion Drive listed as 1.12 TB in size.
APFS Container only has 619.72 GB available for use.
APFS Volume only has 619.72 GB available for use.
Partitioning the device shows all 1.12 TB available.

So I must've not understood something or done something wrong, but I appreciate any help in getting to use that stubborn extra space on the drive!

Best Answer

It may be that one of the EFI partitions is getting in the way of the resize. Please see this thread Can't extend APFS after erasing old partition as free space.

Also check out the last comment to the article here. In this case, the person had an "Apple kernel dump" partition interfering.

So, in summary, it may just merely be the partition layouts thats causing the problem. Hopefully this points you in the right direction