Unable to format / erase hard drive

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?


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 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


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