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.

  • & disabling TM like in stackoverflow.com/a/47601488/4100967 ? Please add how much free space remains on disk0 (About this Mac > Storage). – klanomath Feb 21 '18 at 8:13
  • @klanomath Yes, that's the method I used. I have 103.82GB free of 250.66GB – atirit Feb 21 '18 at 14:52
  • 2
    I have this same issue (APFS, same error code) with no Time Machine or encryption enabled, 346 GB free space (out of 500 GB), and even when attempting to add the partition from Recovery Mode. Boot Camp Assistant also fails due to this problem. First Aid says there are no issues with the disk. (SSD on MacBook Pro Retina, 15-inch, Mid 2014 w/ macOS High Sierra 10.13.4) – Blixt Apr 19 '18 at 14:45
  • I'm in the same situation as @Blixt. – Lyle Apr 30 '18 at 19:00
  • Same here. Reinstall OS tried. – Kroderia May 2 '18 at 18:04

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.

| improve this answer | |
  • Thanks. I booted my iMac in Safe Mode and it worked this time. – Mohit Singh Jul 6 at 9:08

I experienced the same error code, 49187. Below is some background context from my situation and my resolution at the end.

I had re-imaged a MacBook Air as a dev machine and forgot that I wanted to partition the drive.

I, too, ensured file encryption and Time Machine were not active (and used tmutil to thin snapshots) but still experienced the same partition error as the OP. I then took the scorched earth approach; I was going to re-format entirely. I first ensured I had a Mojave installer on a USB thumb drive (using DiskMaker X) then rebooted into recovery mode (Cmd-R).

There, I started Disk Utility to erase and partition. In fact, it failed there as well. After it failed, it showed used file space of roughly 1gig and 75gig of 'other' (which is actually the size of the partition I attempted to add).

The resolution, fortunately, was at hand. I was able to Unmount the APFS drive and actually erase/re-format it with APFS and then create the additional partition.

I am not exactly sure why this worked. When I looked at my drive initially in Disk Utility, it said that it was shared by 4 volumes although I hadn't partitioned anything myself. Once I unmounted and erased the entire drive in Recovery Mode, it showed as One Volume. I wonder if any recovery volume(s) added during High Sierra or Mojave's install prevented APFS partitioning to take effect.

| improve this answer | |

I managed to solve the problem.

Error code 49187 appears to be an internal error in the structure of the APFS that occurred during the file system installation.

I couldn't find a solution to fix it, so I could only recover the following steps:

Step 1:

I made a Time Machine backup (otherwise I just updated my existing one)

Step 2:

I restarted the computer and selected the installation option from the USB installer

Step 3:

I then run the following command in the terminal to list the disks:

diskutil list

Step 4:

I selected the disk on which the macOS is installed (in this case, this was "disk1")

Step 5:

Then I ran the following command (To convert an APFS container into a free space, you must first delete the container):

diskutil apfs deleteContainer disk1

Step 6:

Then restore the system using Time Machine

After restoring the system, I was able to partition without problems enter image description here

| improve this answer | |

My solution was trying a smaller second partition size. Disk Utility said the space was free but I guess it really isn't.

| improve this answer | |

You must log in to answer this question.

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