I have an external HD that died on me a while ago and I'm trying to see if I can format / erase it to start using it again.

The disk does not show up in Finder but I can see it in Disk Utility. When I try to erase it from there I get

Disk Erase failed with the error:
POSIX reports: The operation couldn’t be completed. Cannot allocate memory

When I try to verify the volume:

diskutil verifyVolume /dev/disk2
Error starting filesystem verification for disk2: Unrecognized filesystem (-9958)

I've tried running a surface scan in Techtools Pro, it processed 650 blocks and all were bad. I cancelled the operation cause it was very slow.

Diskutil info /dev/disk2 tells me:

Device Identifier:        disk2
   Device Node:              /dev/disk2
   Part Of Whole:            disk2
   Device / Media Name:      WD Ext HDD 1021 Media

   Volume Name:              
   Escaped with Unicode:     

   Mounted:                  No

   File System:              None

   Partition Type:           None
   Bootable:                 Not bootable
   Media Type:               Generic
   Protocol:                 USB
   SMART Status:             Not Supported

   Total Size:               2.0 TB (2000396746752 Bytes) (exactly 3907024896 512-Byte-Blocks)
   Volume Free Space:        Not Applicable

   Read-Only Media:          No
   Read-Only Volume:         Not applicable (no filesystem)
   Ejectable:                Yes

   Whole:                    Yes
   Internal:                 No
   OS 9 Drivers:             No
   Low Level Format:         Not Supported

I've also tried:

diskutil eraseDisk JHFS+ Stef2TB /dev/disk2
Started erase on disk2
Unmounting disk
Creating partition map
Waiting for disks to reappear
Formatting disk2s2 as Mac OS Extended (Journaled) with name Stef2TB
Error: -9944: File system formatter failed

Can I salvage this drive somehow or is it ready for the trash?

  • 1
    Did you find the answer in the end? Im having the exact same issue..
    – user88264
    Commented Aug 20, 2014 at 12:37

9 Answers 9


This worked for me! Disk Utility > View > Show all devices.

This made the troublesome drive's item in the sidebar become an item of larger item (sorry my vocabulary sucks).

Select the larger one and start the erase process from there. See if that works!

[Beginning state

View > Show all devices

New item

  • 3
    Oh Apple. Crippling computer programs one invisible option at a time. Commented Sep 22, 2019 at 7:13
  • This worked perfectly for me. Thank you so much Commented May 5, 2020 at 5:35

I found this worked perfectly (from the terminal):

diskutil eraseVolume ExFAT MyName diskX

You'll need to change diskX to whatever the number is for your drive. You can find that out in disk utility, select the drive, click info, and look under 'BSD device node'

  • this worked perfect, my issue was i interrupted a dd process where i was trying to make a bootable SD and it then had a 3GB volume on my 64GB card, doing this cleaned it up
    – SeanClt
    Commented Apr 8, 2016 at 2:55
  • 2
    @SeanClt same here! none of the other solutions worked for me.
    – dc95
    Commented Aug 30, 2016 at 20:54
  • Anyone wanting a different format than ExFAT, you can type man diskutil in Terminal to reference the manual and find out what to type to get your desired format. Type q to quit when done reading. There are also some other commands besides eraseVolume that might better suit your reformatting needs.
    – Mentalist
    Commented Dec 5, 2017 at 4:48
  • Then I'm just getting "Error: 22: Invalid argument" after 10 or so seconds of it attempting to erase. Edit: The name needed to be wrapped like so 'MyName' Commented Mar 6, 2018 at 16:48
  • 1
    I had a pesky ubuntu boot USB that Disk Utility wouldn't erase, a variation worked for me: diskutil eraseDisk ExFAT MyName diskX
    – ArleyM
    Commented Aug 7, 2019 at 19:50

I found that this worked (on macOS 10.11) for a USB drive to erase and format it as HFS+ with journaling (normal format on older macOS - you would normally use APFS on macOS 10.13+):

sudo diskutil eraseDisk  JHFS+ 'My disk name' diskX

Where X is a number.

First run sudo diskutil list to find the relevant disk3, or whatever, to determine X - check the size and make sure it's the right disk!

WARNING: You could erase another disk (such as backup drive) if you get the X number wrong.


Before trashing it try this:

In disk utility Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button.

Set the format type to Mac OS Extended (Journaled.)

Click on the Partition button and wait until the process has completed.

Next step:

Select the volume you just created (this is the sub-entry under the drive entry) from the left side list.

Click on the Erase tab in the DU main window.

Set the format type to Mac OS Extended (Journaled.)

Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window. Click on the Erase button.

The format process can take up to several hours depending upon the drive size

  • When I try to create the partition I get "Partition failed with the error:File system formatter failed". When I try again I get "POSIX reports: The operation couldn’t be completed. Cannot allocate memory". Any other options?
    – stef
    Commented Mar 30, 2014 at 13:48
  • I was trying to avoid this, but it does look like trashing is the option.
    – Ruskes
    Commented Mar 30, 2014 at 14:13
  • @stef one last option would be to remove the drive from the enclosure, disconnect it from the SATA interface, and then attach to diff. SATA bus (whether on hub, or SATA to USB cable). Would take some effort, but if the data is valuable enough and not backed up, it may be worth trying. Still, in all likelihood, it's mechanical failure of the drive head and not a problem with the SATA connection.
    – njboot
    Commented Aug 20, 2014 at 16:23
  • I did as you advised once and it failed. Then I tried a second time (leaving the name "Untitled") and it worked. Not sure if it was the second try or omitting a name that did it, but it worked. (Renamed it later with Finder's "Get Info")
    – Mentalist
    Commented Dec 5, 2017 at 4:39

Before you trash your drive, it is also worth restarting the mac.

Sounds simple, but first boot after an OS upgrade or with a failed disk mount due to timing problems, and the system can get confused.

A reboot sorts this out. Happened to me: disk utility couldn't erase or reformat, tried all of the above, including macissues' bash script for overwriting the disk in terminal, multiple unplug/plug-in for the drive.... to no avail. Started the mac, and all was well: reformatted and on its way.


On the left hand side of your finder, check the list of devices that are mounted. There may be more than one disk mounted. Eject all the mounted ones except for the one that you have to format. Now go to disk utility, select external hard drive and erase. This should work.


The only solution for me was to format this USB drive on Windows. Also, the Quick Format didn't seem to work, I had to performa a standard format who took very long.

I don't understand what happened to the drive to be honest, I never had any error when formatting until now


Sometimes there's a problem with flash disk that is null name and only format corrupting data. Other problem is flash disk that are no media. There's no solution for this removable disks.


I was having exactly the same problem as described above; unable to reformat my 16GB USB after interrupting an "erase free space" command. This worked http://www.macissues.com/2014/04/05/how-to-fix-deep-formatting-problems-with-os-x-drives/ The instructions are clear & simple, no Terminal experience required. The command will force a reformat--of course any data will be lost, but your drive will be usable. EDIT: After doing this, my pendrive wouldn't mount but was detected by Disk Utility. I simply selected it and formatted it and voila! It mounts and works!

  • 2
    Hi Jaans, while this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. Please take a look here: Why and how are some answers deleted?
    – bummi
    Commented Apr 22, 2015 at 20:41

You must log in to answer this question.

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