Data Recovery
How to Recover Files Deleted from Mac's Trash (Step-by-Step Guide)
September 10, 2026| 15 min read
Summary: This error means macOS can’t repartition or erase the drive due to macOS cannot modify the disk’s partition map due to corruption, incompatible partition schemes (like MBR/Hybrid GPT), or locked disk metadata. The reliable fix is just erasing and reformatting the disk fully and making sure that we use GUID Partition Map here. Just remember to back up first, because reformatting erases data, and if you lose it, you can use a Mac data recovery tool to get it back.
You connect your external drive to a new Mac, expecting everything to work smoothly… but suddenly you see the error “MediaKit reports not enough space on device for requested operation” and now nothing makes sense anymore. This cryptic Disk Utility error most of the time pops up when attempting to format or partition a disk. Let’s understand it with the most common scenario. A Mac user plugs in his WD Elements 1TB drive that he was using on Windows and gets the error upon trying to erase it for macOS. In some cases, users find this issue while using Time Machine backup drives or while merging partitions, because APFS container resizing can cause MediaKit errors and partition map conflicts.
In this guide, we’ll walk you through the common causes of the MediaKit error and then explain step-by-step methods to fix it. The following sections show methods to do exactly that.
Below we have shared 4 methods you can use to erase and repartition your drive so that macOS no longer gives this error.
This is the simplest approach if it works:
If the erase succeeds, eject the drive, disconnect it, reconnect it, and confirm that it mounts normally. If it fails with “MediaKit reports not enough space on device” then Disk Utility is not able to rewrite the device metadata cleanly and you should just move on to the next method.
If Disk Utility still doesn’t work for you, just go ahead and manually wipe and partition the drive using those Terminal commands. This method just zeroes out the partition table of your drive and creates you a new one:
Replace diskX with your disk number, e.g. diskutil unmountDisk force disk2. This makes sure the whole disk is unmounted.
sudo dd if=/dev/zero of=/dev/rdiskN bs=1024 count=1024
(Replace diskN as above; rdiskN refers to the raw device, for faster operation)
Note: This command is dangerous if you choose the wrong disk and it may jeopardise your data safety. So proceed only if you are have a fair amount of idea how these commands work
Enter your admin password when prompted. This writes zeros to the first 1MB of the disk, effectively erasing the partition map.
diskutil partitionDisk diskN GPT JHFS+ "NewName" 0g
This creates a GUID (GPT) partition scheme with one Journaled HFS+ (Mac OS Extended) volume filling the disk. (You could use APFS instead of JHFS+ if desired).
If you need APFS, just go ahead and replace JHFS+ with APFS in the command (or maybe let Disk Utility convert it later). The key here is that dd only wipes the first few blocks of the drive, which removes the old partition map, and diskutil partitionDisk then sets up a fresh GUID partition scheme and creates the EFI partition. These Terminal steps unmount it forcefully, wipe your old partition map and then rebuild the drive’s partition structure. It is a powerful fix honestly when Disk Utility alone just would not work.
There’s a quick workaround we found that you can perform. Initially format the drive to NTFS (or FAT32/exFAT) on a Windows PC, then reformat it on the Mac. The idea is that Windows formatting rewrites the partition table, which can remove corrupted or incompatible structures that macOS fails to fix. To do this:
Formatting in Windows forces the drive to just start with a clean state with a standard EFI partition.
Some drive manufacturers also provide you utilities that can reformat your drives when macOS tools just fail:
Manufacturers’ tools are designed to work with their hardware. These tools perform low-level initialization that can succeed where Disk Utility fails.
To prevent running into the MediaKit error and to protect your data, follow these best practices:
By taking these steps, you reduce the chance of encountering those partition or formatting errors. If you have to erase a drive, just double-check that you’re not in Recovery/Installer mode and the correct disk is selected.
The MediaKit “not enough space on device” error can stop you from formatting or installing macOS to a drive. It usually stems from partition-table or EFI-partition issues – for example, leftover Windows partitions. The cure here is just to wipe and reformat the disk so that macOS itself creates a fresh GUID partition scheme (with a 200–300 MB EFI). You can actually do this via Disk Utility (Show All Devices, Erase) or by using those Terminal commands (diskutil + dd). You can also go with reformatting the drive on Windows or just use the drive maker’s tools and then try Disk Utility again. Each method essentially forces a new clean partition map.
Just remember that these fixes will erase all that data of yours. So always try to take a back up before proceeding. If you do lose files though, Stellar Data Recovery for Mac can scan that formatted drive and help you to recover those photos, documents, and other data that you lost. With the right method and precautions, you will fix the MediaKit error shown here and get your drive working with macOS again.