How to format pen drive, USB drive or external drives in Linux

It’s very easy to format pendrive or any other external hard drives in Linux. The formatting of the drive will erase all the files and directories in your drive which cannot be recovered. So, be careful while formatting the drive. You can use either command line or the graphical way to format the drive. Once, you plug in external drives in the computer, that will map to /dev/sda or /dev/sdb1 etc. The names can vary. We will identify external drive with the name. Follow these simple steps to quickly format the USB drive or pendrive or external drive in Linux:

Format using Terminal:

1. Identifying drive:

Insert the external drive and type the following command in the terminal:

dmesg | tail

You will get the output like this:

Identify USB drive

The word “sdb” between the big brackets is the name of your external device that you just inserted. And the sdb1 is the partition name or generally it is the actual name that we are going to use while formatting ┬áthe drive.

2. Unmount the drive:

After we identified our drive, another step is to unmount the external drive. Use the following command:

sudo umount /dev/sdb1

3. Format the drive:

The drive can be formatted into two formats: EXT3 and FAT32. The EXT3 format only works in Linux machines whereas FAT32 format works in Linux, MAC and PCs.

Format in FAT32 file system:

Use the following command:

sudo mkdosfs -n 'New' -I /dev/sdb1

Format in EXT3 file system:

Use the following command:

sudo mkfs.ext3 -n 'New' -I /dev/sdb1

Wheres, -n ‘New’ gives the name ‘New’ to the formatted drive and -I force the format to work properly. However, they both are not mandatory.

Format using GUI:

If command line scares, you there’s a tool called Gnome format that lets you to format external drives easily. Install gnome format using the following command:

In Ubuntu/Mint:

sudo apt-get install gnome-disk-utility

In Fedora/Cent OS/Red Hat:

Most probably, Gnome Disk Utility is already available in Fedora, Cent OS or Red Hat machines.

If it’s not, type the following command to install.

sudo yum install gnome-disk-utility

Gnome Disk Utility


Open Gnome Disk Utility, select the external drive and click on Format Drive to format the external USB drives, pendrives or other external drives.

Posted in Linux | Tagged , , | 2 Comments

2 Responses to How to format pen drive, USB drive or external drives in Linux

  1. yuva Mozilla Firefox Ubuntu Linux says:

    while i am formating my pendrive using dislutility i am gettinf an error report as device is busy.
    but on pendrive i didnt perform any operation. what should i do?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>