There are two methods of formatting a usb in linux that I use.
- The first method is using gparted (or parted non gui version of gparted). This is an easy gui interface that uses shell commands as backend. It is easy to do it.
You install this package using the command.sudo apt-get install gparted
- The second method is using the commands. You can format USB pen drive with the help of following commands:[a] fdisk : Partition table manipulator for Linux[b] mkfs.vfat : Create an vfat filesystem by formatting given partition name (/dev/partition)First make sure USB pen is not mounted. Unmount the drive by right clicking the usb folder in the desktop and selecting “Unmount Volume”.
Now we need to find the device name of the usb. For that we use the command fdisk. Use the command fdisk -l.The output of the command is like
Thus we get the device name as /dev/sdb1 for USB pen. To format type the following commandsudo mkfs.vfat /dev/sda1
That’s all mount the usb again and use it.