Links

Format USB Drive

This will permanently delete any data stored on the USB drive. Make sure the correct drive is selected when following these commands.
If the USB drive does not boot on the target device try to reformat the USB drive by following these steps:
Windows
Linux
  1. 1.
    Insert the USB drive.
  2. 2.
    Open a Command Prompt as Administrator.
  3. 3.
    At the Command Prompt type the following pressing Enter after each line:
USB Drive 32GB or Smaller
USB Drive Larger than 32GB
diskpart
list disk
select disk X (Where X is the number assigned to the target USB drive)
clean
convert mbr
create partition primary
format fs=fat32
assign
active
exit
exit
diskpart
list disk
select disk X (Where X is the number assigned to the target USB drive)
clean
convert mbr
create partition primary size=32768
format fs=fat32
assign
active
exit
exit
  1. 1.
    Open a terminal and run this command to locate the right device:
    lsblk
  2. 2.
    Use fdisk command accordingly:
    1. 1.
      sudo fdisk /dev/sdX; X stands for the right disk letter something in the region of b, c or d
    2. 2.
      Type o to change the partition table type to dos
    3. 3.
      When the command runs type d and enter to delete the existing partition.
    4. 4.
      Type n to create new partition.
    5. 5.
      Accept the defaults when ask for the partition type and size (assuming that is desirable).
    6. 6.
      Type p to see what you have done.
    7. 7.
      Type t to change the file system type.
    8. 8.
      Type c to create a W95 FAT32 (LBA) partition.
    9. 9.
      Type a to activate that partition so it automounts.
    10. 10.
      Type w to write the changes to disk
  3. 3.
    Format again from the terminal:
    sudo mkfs.vfat /dev/sdXi
    • Note: i represents the partition number in this case it should be 1
  4. 4.
    Close the terminal.
Source: askubuntu.com