Posted inInformation Technology

How to Command Line Format a Thumb Drive on Linux

Every now and then you find yourself on a distro where the GUI tools to format a thumb drive simply aren’t there or aren’t the ones you know about so you don’t find them. As always, the terminal is your friend. Simply plug in your thumb drive and wait for your machine to auto-mount it. Then open a terminal.

sudo fdisk -l

Disk /dev/sdc: 14.9 GiB, 16026435584 bytes, 31301632 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc3072e18

I decided to save you the lengthy listing and just show you the information for the thumb drive. I know it is my thumb drive because it is the only 16 Gig thing connected to the machine. Odd that it lost a whole 1.1 gig with formatting, but such is life. FAT never was efficient, just simple.

Now that we have identified the drive we need to format it.

sudo mkdosfs -F 32 -n travel -I /dev/sdc

-F is for FAT and 32 says to use FAT-32 instead of either FAT or FAT-16.

-n sets the label/name of the newly formatted media

-I identifies the full path to the device.