Can’t resize macOS partition (APFS error code 49187)

apfsdisk-utilityhard drivehigh sierrapartition

I'm unable to shrink my APFS macOS partition in Disk Utility or by using diskutil. When I try with either method, I receive error code 49187. There appears to be no reference for these codes and I can't find any information online. I have tried deleting Time Machine snapshots and that made no difference. First Aid on my disk reveals some kind of corruption in the partition map:

enter image description here

I tried what it said and First Aid only lets me scan my macOS partition in Recovery Mode. Using diskutil gives me Error starting file system repair for disk0: Invalid request (-69886).

Is there any way to fix this? I'm trying to add a FAT32 partition to my disk.

This is on macOS 10.13.3.

Best Answer

I solved this error for myself by the following steps, (to be sure I included all)

  • Time Machine snapshot delete fix
  • Decrypt harddrive from filevault

This resulted in the persistence of the error. But then I booted in recovery mode (reboot and hold cmd+R) and started the disk utility there. To my surprise the Disk Utility showed me different values for the free space of my partition. I only had 20g free instead of the 50g I tried to allocate each time.

When I did the normal partition steps in the recovery boot Disk Utility everything went fine and I am currently running Ubuntu 18.04.1 alongside Mojave 10.14.1 without problems, be it that I only have 20g.