Who does not have a flash memory USB drive? (128Mb – 16Gb…) Everybody does, even my dog, if I had one, would have it. However, sometimes these little dongles can be tricky to use if they are not properly formatted. The usual format for the flash memory USB drive is FAT16, and it is understood by many operating systems with no problem. But in case the drive is not formatted properly/or you think it is not formatted properly, you can always reformat it, and here is how.
The whole process consists of 5 steps ans takes about 15 seconds um.. if do it slowly..
In case you need to find the actual device your USB drive was associated with look here “Find USB flash device/drive in Linux“
WARNING: All the data will be lost from the flash UBS drive since we are going to reformat it.
We are going to use fdisk utility, so “for starters” here are available commands that you can use with fdisk:
a - toggle a bootable flag
b - edit bsd disklabel
c – toggle the dos compatibility flag
d – delete a partition
l – list known partition types
m – print this menu
n – add a new partition
o – create a new empty DOS partition table
p – print the partition table
q – quit without saving changes
s – create a new empty Sun disklabel
t – change a partition’s system id
u – change display/entry units
v – verify the partition table
w – write table to disk and exit
x – extra functionality (experts only)
b - edit bsd disklabel
c – toggle the dos compatibility flag
d – delete a partition
l – list known partition types
m – print this menu
n – add a new partition
o – create a new empty DOS partition table
p – print the partition table
q – quit without saving changes
s – create a new empty Sun disklabel
t – change a partition’s system id
u – change display/entry units
v – verify the partition table
w – write table to disk and exit
x – extra functionality (experts only)
Now let’s get to cooking a new and fresh flash memory USB drive…
Step 1. Run fdisk via sudo on your USB flash drive device:
enter “p” command to list current partition table of the USB drive:
Here you will see whatever partition (if any) currently present. In my case (above) it is a “Linux” partition, in your case it may be something different. But it does not really matter, because we are going to delete it anyway:
Step 2. Enter “d” command to delete existing partition (if you have any). If you have several, delete several by using”d” command multiple times:
Step 3. Now let’s get to business and enter “n” command to create a new partition:
As you can see from above, I entered “1” for “Partition number”, and hit enter key twice to leave everything by default.
Now let us list current partitions with “p” command again:
We have a single “Linux” partition which is fine (for now).
Step 4. Time to actually apply our changes, so enter a “w” command that will write out all the changes to the USB drive.
fdisk will write all the changes to the USB drive and exit. But we are not done yet. Our goal is to make a (in this case) FAT16 partition, so this USB drive can be read by most operating systems.
Step 5. For that we will use mkfs.vfat utility:
Now we are good to go! It was easy, as I promised
Let’s look at the new USB drive now. Mounting it first:
Checking what it has under the hood:
It has 991Mb which is what they call 1Gb flash memory USB drive!