How to Format USB Drive or Pendrive on Linux?

Suppose you want to know how you can format a pen drive or USB drive. There are many ways to format, but I’ll show you both the GUI and CLI method whichever you are comfortable that you can use.

Method 1: Format USB Drive or Pen drive Using Terminals

First we will see how to use terminal method to format USB drive

Press a super key and search for terminals or use the shortcut key “Ctrl + Alt + T” to open terminal.

To go further down we should know the USB drive partition otherwise we will format the wrong drive.

How to check partition? There are many commands which you can use to check disk partition

$ lsblk

or

$ df

After passing this command now, you know which partition is assigned for your USB drive.

format pendrive on linux df command
Pass “df” command

In my case /dev/sdb1 is the file system for 16GB USB Drive.

Second Step is you need to unmount USB drive file system “/dev/sdb1”

Syntax

$ sudo umount /dev/{disk-name}
$ sudo umount /dev/sdb1

Now the main step goes here

If you want partition in FAT32 file system format then use this command,and you can choose other file system

$ sudo mkfs.ntfs /dev/{device-name}
$ sudo mkfs.vfat -F 32 /dev/sdb1

You pendrive is successfully formatted.

It’s time to mount pendrive for this type command

$ sudo mount -o uid=shen /dev/sdb1 /media/shen

Through this way you can format using command mkfs.

How to Install VMware Workstation 16 Pro on Ubuntu?

Method 2

How to Format USB Drive or Pen drive Using Disk or GUI?

Above you have seen how to format using terminal now, I’ll show how to use the Disk or GUI to format Pendrive.

Press the super key and search for File Manager, Open File Manager and on the left side of the screen you will see your Pendrive

Select the pen drive and click on setting icon then click on format partition

Select Format partition
Select Format partition

Now you will get the option to set Volume Name, Erase, Type. You can change according to your requirement.

For example, I have set the Volume name, not required, and selected FAT as a storage format. After this click on Next.

Select the format type
Select the format type

In this step it will ask your confirmation, If you are sure what you are doing then click on Format.

Confirm Format
Confirm Format

Wrap up

If you want other format than mkfs.vfat then just replace this

mkdosfs, mke2fs, mkfs.ntfs,mkfs.bfs,mkfs.ext2, mkfs.ext3,mkfs.ext4(8), mkfs.minix,mkfs.msdos, mkfs.xfs

For terminal you can use Disk,Gparted or any other software.

Leave a Reply