Formating USB using Fdisk (NO GUI)

If you want to make a simple quick partition and you have no GUI, here’s what you should do. (Besides #RTFM)

We’ll try to make this simple. To the point. If you need a quick format, then you won’t like reading a lot.
Follow this steps:

You can use the df command to scann your mounted devices

Open a terminal and type sudo su
Type fdisk -l (and note which device is your USB)

# fdisk /dev/sdbX (X is the number of your usb device)

Now, you enter into a menu where you can press ”m” to get help and see all the stuff you can do. But to our purposes we’ll:

1. MAKE YOUR USB A SINGLE PARTITION

Type d (To Delete the existing partition)
Type 1 (to select which partition will be deleted)

Now, you’ll see something like this: (steps below)

fdisk1

Type n (new partition on your USB)

Select your Partition type:
(from here you can type just enter..)
Type p (primary partition)
Type 1 (Partition number)
Type enter (Use default)
Now you decide the size of the partition. If you want to use it all, use default.
Type enter (Default [the whole disk])

Now change the partition type id.

Type t (choose type)
Type 1 (choose your partition number)
Type 83 (Linux system id ext3) [is the most common, but you may type “L” to see all the types

At the end. If everything went well, You should type:

Type w (To write)

After this, all your changes will be done.

Well.. after all the complicated stuff, you can use simply these next lines to format partitions:

in the /dev/ path are all the devices. Scan typing “df

Unmount the device you want to format.

umount /dev/sdb1

Fat16:
(-n is used to label the formated disk)

mkfs.vfat -F 16 -n MyUSB /dev/sdb1

Ext3:
(-L is the label)
(-b size per block. Can take 1024, 2048, 4096… )

mkfs.ext3 -b 4096 -L MyUSB /dev/sdb2

NTFS:

mkfs.ntfs -v -L data /dev/sdc1.

there are also this other types of quick format:

mkfs.btrfs
mkfs.ext2
mkfs.ext4
mkfs.msdos
mkfs.vfat
mkfs.cramfs
mkfs.ext3
mkfs.ext4dev
mkfs.ntfs
mkfs.xfs

Well. Connect and disconnect.. and… Enjoy. =)