MediaKit reports not enough space on device for requested operation I have a 4TB WD external hard disk that is partitioned as follows:

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 TB     disk2
   1:         Microsoft Reserved                         134.2 MB   disk2s1
   2:       Microsoft Basic Data NTFS                    3.2 TB     disk2s2
   3:       Microsoft Basic Data exFAT                   506.0 GB   disk2s3
   4:                  Apple_HFS TIMEMACHINE             272.9 GB   disk2s4


Time Machine app recognizes the disk and all the partitions but when it attempts to erase the partition a popup message appears saying "MediaKit reports not enough space on device for requested operation"

How can I fix this problem?

macOS 10.13.3 High Sierra
The problem is that Disk Utility isn't able to reformat your drive from NTFS to APFS. You can format it to HFS+, then Disk Utility will pick up and do the rest for you. Here is a tutorial with detailed, step by step instructions: https://mycyberuniverse.com/web/how-fix-mediakit-reports-not-enough-space-on-device.html
Note that this will erase your entire disk (in case you have multiple volumes).
Summary of commands needed, in terminal:
diskutil list
diskutil unmountDisk force disk2
sudo dd if=/dev/zero of=/dev/rdisk2 bs=1024 count=1024
diskutil partitionDisk disk2 GPT JHFS+ &quot;New Drive Name&quot; 0g

Where disk2 is the name of your external drive, listed from diskutil list