Cannot erase USB flash drive, “name invalid”

The problem:

  1. Created a bootable USB flash drive for Windows 10 for my HTPC, but after adding the files I just couldn’t get it to work (ended up burning to a CD and using an external CD drive instead).
  2. Later, tried adding new personal files to said USB but couldn’t. So I tried to erase.
  3. Got an error when attempting to erase. Here’s what happened…
    1. Goto Disk Utility -> Erase
    2. Received Error: “Invalid name. Operation failed…”

This is how to fix it:

  1. Open Terminal
  2. Type in diskutil list to determine what the disk number is
  3. Then type in diskutil eraseVolume [HFS+] [NAME] [DISK#]
    1. Where [HFS+] is the erase type you want (I just left it as HFS+)
    2. And [NAME] is the new name you want the disk to be called
    3. And [DISK#] is the disk number returned in Step 2
  4. In my case, I did (see below): diskutil eraseVolume HFS+ prince disk1
  5. Problem solved!

 

AA73B292-C118-46B1-97C9-110F571379EC

11 thoughts on “Cannot erase USB flash drive, “name invalid”

  1. it says –
    Started erase on disk2
    Unmounting dis
    Creating the partition map
    Error: -69877: Couldn’t open device

  2. Thank goodness I found this. Had a SanDisk Cruzer I wrote a disk image to. Turned out the disk image was useless for what I was wanting to do, so I needed to reformat the Cruzer. Disk Utility couldn’t do it. Came across other suggestions for erasing with Terminal that said to use eraseDisk, not eraseVolume, and that wasn’t working for me. EraseVolume worked for me and I can finally re-purpose this flash drive. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.