Erase USB in Disk Utility says "Permission denied"

I'm trying to format my USB so I can get all the space back onto it, but every time I try to erase it in Disk Utility, this comes up:

POSIX reports: The operation couldn’t be completed. Permission denied


Solution 1:

Try with diskutil:

diskutil eraseVolume HFS+ "new name" disk1

Replace new name with the name you wish the disk to have, and disk1 with the disk identifier (select disk → Info).