Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Droooooj

macrumors regular
Original poster
Oct 19, 2009
104
5
London, UK
I'm trying to format a SATA 320GB WD 2.5" HDD as Mac OS Extended (Journaled), but Disk Utility reports the following error each time:

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

The drive is sitting in a USB enclosure. I've tried two different cables. I've tried Zeroing the drive as part of the format, same errors almost straight away. Eventually after trying to re-format it again and it fails I then get an error saying it can't unmount the drive and I have to do it via the Terminal.

I tried formatting the drive with a different Mac, got the same experience.

But I hooked the HDD up to a Windows machine, formatted it to NTFS (the only option as the machine is running XP), ran CHKDSK across the whole disk and it all came back ok, just 96k of bad blocks that got 'mapped out' as part of that particular format. Connected it back to the Mac and the mac could see it fine.

But obv I can't write to an NTFS formatted drive.

Any other suggestions/clues as to what the Disk Utility errors are all about and how I can format the drive to Mac OS Extended (Journaled)?
 
Just been digging a bit more for answers. This article suggests it's Disk Utility itself that can't cope with some drives over USB:

https://www.cnet.com/news/partitioning-usb-hard-drives-that-fail-in-disk-utility-with-posix-error/

So I tried formatting the drive using diskutil in Terminal, and it worked! I verified the drive and it was all OK. I then verified it in Disk Utility and it was fine.

But then I tried to zero the disk, in both Terminal and Disk Utility and it filed in both. Even Terminal said "POSIX reports: Cannot allocate memory."

So I'm back to square one.

If the USB connection is the problem, could I maybe put the drive in a MacBook Pro and format it from another using firewire and Target Disk Mode?

Does Target Disk Mode allow formatting?
 
Last edited:
There are utilities available to make read/write of NTFS work fully on macOS, I use one called Paragon NTFS for Mac OS X, which is great.
 
But I hooked the HDD up to a Windows machine, formatted it to NTFS (the only option as the machine is running XP), ran CHKDSK across the whole disk and it all came back ok, just 96k of bad blocks that got 'mapped out' as part of that particular format.

Well, a CHKDISK is meaningless, because that's a filesysystem-level check.

Second... if the drive has run out of spare sectors, to the point that it's exposing them to the interface and the computer (any computer) can see them to lock them out, the LAST thing you want to be doing is using it.

So, basically, you're fixing the wrong problem.
 
I have about two dozen drives of different types (spin, sticks, ssd), and need to format them from time to time. Sometimes one won't format. Sometimes this is pilot error, but more often it's unclear why it won't. In my experience, I try first for HFS. But if for some reason that doesn't work I format to FAT32, then HFS.
 
What is your goal with this drive?

Do you wish to re-use it again?
Do you want to sell it or give it away?
Are you "done with it" (never want to use it again)?

If you just want to reuse it, just re-initialize it using the Terminal (as you did above), and start using it again. Don't bother with "zero'ing it out". Waste of time.

If you want to sell it, and don't want anyone to have access to your data, you might try:
1. Reinitializing it to HFS+, then
2. Use filevault to encrypt it (even though there are no files on it, yet), then
3. Reinitialize it once more.
Because it was encrypted, the prior-written data will be unrecoverable.

If you're done with it, put it into a plastic bag and take a sledgehammer to it.
 
  • Like
Reactions: hobowankenobi
When I had this issue, I first checked the SMART status using a 3rd party App (Mac's built in SMART status is insufficient as it's metrics are not listed individually, and recently I've noticed that it seems to frequently not flag failing drives-in this instance, the App I used was CrystalDiskInfo in Windows), which indicated the drive was not suffering physical failure. I then tried two things at the same time - one of these two presumably fixed the issue, because it was resolved:

The first thing I did was change the enclosure.
Then I plugged into a Windows machine, entered the DISKPART menu, did the list disk-->select disk#-->clean-->convert MBR-->formatted at ExFAT-->went back to Mac and formatted as HFS+ without issue.

I found the same CNET article you linked to - my next attempt was going to be a low-level format in Windows (IIRC WD's own Windows App is capable of doing this), but it so happened it did not come to needing that.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.