We often need to format USB drives so that we can have all the storage freed once again and can use it for storing our favorite software, movies, music, or even our Operating System.
Also read: How to Create a Bootable USB Disk from Ubuntu Terminal?
In this article, we’ll go through 3 different methods to format a USB drive while working on Linux distributions. Many people find formatting a USB on Linux to be a very complex thing. However, it is a very simple and easy task.
We will go through 3 methods namely:
- Using Disks
- Using the GParted tool
- Using the Terminal
While the first two are very easy to follow, those who are not comfortable working with the terminal might find the third one a little tricky but trust me it is no rocket science and you should definitely learn all three methods.
File Systems To Use
There are many types of File Systems available for use but for this article, we will stick to these 3 different types of File Systems:
- FAT32: compatible with Windows, Mac and Linux
- NTFS: compatible with Windows, Mac(read, write both) and Linux(read only)
- exFAT: compatible with Windows, Mac and Linux but requires some extra drivers to access
Different Methods to Format USB On Linux
Let’s explore the methods individually now to format USB drives on Linux.
Method 1: Using the ‘Disks’ Application
Step 1: Open the ‘Disks’ application
Step 2: Select your USB Drive from the list on the left
Step 3: Select the ‘Additional Partition Options‘ button below the USB Drive on the right panel as shown in the picture below
Step 4: Now select the ‘Format Partition Option‘ from the menu as shown in the screenshot below
Step 5: Now enter the ‘new name‘ for your formatted USB drive and select the ‘type‘ as ‘FAT‘ so that you can use it with any type of Operating System and click ‘Next‘ as shown below
TADA… your USB Drive is formatted successfully
Method 2: Using ‘GParted Tool’
You can check if GParted is installed on your PC or not by running the following command
If you don’t have ‘GParted‘ already installed on your PC then you can install it using the apt command:
sudo apt install gparted
Step 1: Run the ‘GParted’ tool with the following command
Once the app is running, select your USB drive from the list on the top right corner
Step 2: To start the formatting ‘right click‘ on the drive and select the ‘Format to‘ option. From the drop-down menu select ‘FAT32‘
Step 3: Now select the green-colored ‘Tick‘ button on the top menu
Step 4: Click ‘Apply‘ and wait for the process to complete.
Viola! Your USB drive is brand new once again
Method 3: Using the Terminal
I personally prefer this method over all the other methods to format a USB drive because I am more of a Terminal person.
Also read: Top 5 Best Terminal Emulators For Linux
Also, this method feels a little more professional and you can always do a subtle flex in front of your friends while working on the Terminal. Enough of talking, now let’s move towards the implementation of this method
Step 1: Open theTerminal. The default shortcut for opening the Terminal is CTRL + SHIFT + T. And run the following command
The terminal prints out a list of all mounted partitions and relevant information: used space, available space, used space percentage, and the path.
Locate the USB in the list and find the corresponding device. In this example, the USB drive is
Step 3: Unmount the USB drive using the following command
sudo umount /dev/sdb1
Step 4: Format the USB drive using
After unmounting, format the USB drive using the preferred file system (replace
sdb1 with the name of your device):
- To format the USB drive with FAT32 file system(which can be used with all types of Operating Systems), use the following command
sudo mkfs.vfat /dev/sdb1
- To Format the USB drive using the NTFS file system run the following command
sudo mkfs.ntfs /dev/sdb1
- To Format the USB drive in accordance with the exFat file system, you can use this command
sudo mkfs.exfat /dev/sdb1
Step 5: To verify that the USB is formatted successfully, you can use the following command
sudo fsck /dev/sdb1
The USB drive with 0 files indicates that your device got Formatted successfully.
In this article, you learned how to format a USB drive in Linux using 3 different methods ranging from GUI-based apps like ‘Disks’ and ‘GParted’ to the keyboard-only method by using the ‘Terminal’. In addition to that, we also understood the difference between these three methods and the most commonly used File System types.