1

This is on a Macbook Pro with a 250 GB disk that was originally split into two partitions, roughly 90 (Macintosh HD) and 160 GB (disk2). The machine is now on Catalina with the first partition being APFS and the second staying HFS. There is not enough space on the first partition and I am trying to add more space from the second to the first by following this guide: https://www.macobserver.com/tips/deep-dive/resize-your-apfs-container/

After splitting the second partition into 2 with Disk Utility, I have an empty partition of 20GB that I convert to empty space by doing

sudo diskutil eraseVolume "Free Space" %noformat% /dev/disk0sX

as shown in the guide (on my system X is 5, not 3 as in the guide but this should not make any difference). Then when I try to resize the APFS container as shown in the guide by doing

diskutil apfs resizeContainer disk0s2 0

it gives me

Started APFS operation. Error: -69519: The target disk is too small for this operation, or a gap is required in your partition map which is missing or too small, which is often caused by an attempt to grow a partition beyond the beginning of another partition or beyond the end of partition map usable space

disk0s2 seems to be the correct disk as shown in diskutil list

...
 2:                 Apple_APFS Container disk1         89.5 GB    disk0s2
...

Any ideas whether what I am trying to achieve is even possible and if it is, how to do it?

Conclusion: I went with the second suggestion by David Anderson and it seems fine. The only thing that I noticed is that the high-level folders in disk2 are owned by root after copying them back, but that doesn't seem to be an issue.

As always, make sure that you have reliable backup of your system before doing this

1
  • Please edit your question to provide the full output of diskutil list rather than just an excerpt.
    – Jivan Pal
    Commented Feb 5, 2020 at 17:43

1 Answer 1

1

If you shrunk the second (visible) partition to create free space. The free space is directly below this partition. You can not add this space to the APFS container, because the free space is not adjacent to the APFS container. In other words, the partition with the HFS volume is between the APFS container and the free space. This prevents adding the free space to the APFS container.

One possible solution would be the following.

  1. Move all the files from the HFS volume to an external drive.
  2. Convert the partition containing the HFS volume to free space.
  3. Add all the free space to the APFS container.
  4. Shrink the APFS container and add a new HFS volume.
  5. Move the files from the external drive to the HFS volume.

Another possibly better solution would be to replace partition with the HFS volume with a new APFS volume inside the existing APFS container. The steps are given below.

  1. Move all the files from the HFS volume to an external drive.
  2. Convert the partition containing the HFS volume to free space.
  3. Add all the free space to the APFS container.
  4. Add a new APFS volume to the APFS container.
  5. Move the files from the external drive to the new APFS volume.

The external drive would not have to be a HDD or SSD. You could use a 256 GB flash drive (or maybe a smaller flash drive).

2
  • As I am not familiar with APFS at all, here is a question -- if I go with the second option, would the I be able to make the new APFS volume appear as /Volumes/disk2 in the filesystem, the same as the current second partition?
    – lupincho
    Commented Feb 6, 2020 at 10:03
  • Yes, if you use the same name disk2, then the volume would appear as /Volumes/disk2. Commented Feb 6, 2020 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .