Are you trying to erase a USB drive on your mac but getting this error as soon as you insert it?
That might be because the disk is a Windows/Linux bootable formatted as FAT-32, which OSX cannot read.
And then when you try to erase in disk utility, the USB is greyed out and First Aid doesn’t work, you can’t repair it, and you can’t mount or unmount it.
You get this error, and the details vary depending on the format type you try:
I was getting things like: “could not modify partition map” and “couldn’t unmount disk.” Other things could be things like “couldn’t open device.”
Erasing an External USB or Hard Drive that keeps failing in Disk Utility
Thankfully I ended up fixing it quickly (with a little googleing).
Here’s what you do:
(note: be EXTREMELY careful, ask you could wipe your computer if you do this wrong)
- Open terminal
- Run the command: diskutil list
- Determine which disk is the external
- Type this very carefully (sudo might not be necessary): sudo diskutil unmountDisk force /dev/disk2
- Then this: diskutil erasedisk <format type> <desired name> <disk identifier>
- Where <format type> could be HFS+ or MS-DOS or others
- Where <desired name> is what you want to call this disk (you can easily change it later by reformatting again via Disk Utility)
- And <disk identifier> is the ID of your disk. DO NOT MESS THIS UP.
That’s it. Congratulations!
Let me know if this was helpful in the comments.