I tried installing Windows 10 on my Macbook Pro with Bootcamp on Mojave, but through a series of manipulations, I broke my Windows installation and Bootcamp would not let me restore my system as it was before. So I deleted the Windows partition to the point where "diskutil list" gives me this:

MacBook-Pro-9:~ sarbogast$ diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         2.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk2         1.8 TB     disk0s2
   3:                  Apple_HFS Untitled                196.7 GB   disk0s3

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.8 TB     disk2
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            1.6 TB     disk2s1
   2:                APFS Volume Preboot                 64.7 MB    disk2s2
   3:                APFS Volume Recovery                1.0 GB     disk2s3
   4:                APFS Volume VM                      1.1 GB     disk2s4

How can I reclaim the 196.7GB that used to be occupied by my Windows partition so that my main container is almost 2TB again?

Note that I tried the resizeContainer command but got this:

MacBook-Pro-9:~ sarbogast$ diskutil apfs resizeContainer disk2 0
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
  • set the size to zero (0)
    – Ruskes
    Dec 29 '18 at 20:11
  • Which release of Windows 10 were you trying install? Was it the October 2018 release (1809)? Dec 29 '18 at 20:37
  • It would be helpful, if you could give the model year of your Mac. Also, did you eventually get Windows installed by using the Boot Camp Assistant? Dec 31 '18 at 2:00
  • My Macbook Pro is mid-2017, model 14,3. I did eventually get Windows installed using the bootcamp assistant, but then I destroyed it trying to also install Linux in triple boot. Linux and that model of Macbook Pro: forget it.
    – Sebastien
    Dec 31 '18 at 13:01

You need to first remove the 196.7 GB partition. Try the commands given below.

diskutil eraseVolume free none disk0s3
diskutil apfs resizeContainer disk0s2 0

You must log in to answer this question.

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