How can I format my USB? [duplicate]

Solution 1:

  1. Unplug your usb stick
  2. Restart your mac
  3. Download gdisk from https://sourceforge.net/projects/gptfdisk/files/latest/download
  4. Double click the package and install gdisk.
  5. Then open up your terminal and type diskutil list
  6. Find the usb disk that you are trying to erase (/dev/diskx)
  7. Unmount the disk you are trying to erase with diskutil unmountDisk force /dev/diskx
  8. type use gdisk on the disk you want to erase. sudo gdisk /dev/diskx
  9. Once in gdisk, type x for expert command and press enter.
  10. Type ? to verify you are in the expert menu. Look for zap (destroy) GPT data structures and exit
  11. Type z
  12. When asked if you would like to delete the MBR partition also, type YES and hit enter.
  13. Gdisk will now erase your GPT and MBR and tell you it is now okay to reformat in disk utility or another partitioning utility. Do so, and let us know if you can now format your disk.

IF NONE OF THIS WORKS. TRY THE FOLLOWING:

  1. Unmount the disk you are trying to erase with diskutil unmountDisk force /dev/diskx
  2. Use the DD command to erase your USB stick with zeros by entering sudo dd if=/dev/zero of=/dev/rdiskX bs=1m, where diskX is the usb disk you want to erase. This will take a long time. Please be patient.

FINALLY IF THAT DOESN'T WORK... Create a linux live cd like linux mint, and boot from it. Then use gparted to erase and format your usb.

IF NONE OF THESE WORK... Then your usb stick is most likely bricked and has hardware failure. Throw it out.