Jannah Theme License is not validated, Go to the theme options page to validate the license, You need a single license for each domain name.
Linux

How to Format USB Drive on Linux?

Introduction 

Do you know people used floppy disks, CDs, and external hard disks for data storage and transportation before the introduction of USBs? Yes, USBs have been a major game-changer when it comes to portable storage devices. This small device is capable of storing large documents, photos, videos, files, etc. While this device is excellent, there is still a need to format USB drives on Linux

USB drives on Linux have proved to be a better alternative to traditional storage devices due to their portability, ease of use, compatibility, and storage space. 

In this article, we will read about USB drives in Linux and various methods to format these devices. Now let’s move forward and understand file system and formatting.

Which File System to Use for USB Formatting? 

You must understand specific terms before looking for a file system to format USB. A file system is used to store and organize data. You can store anything under the file system, from photos to documents. Each file gets a unique address for easy allocation at the time of requirement. This ensures every file has its own home and there is no confusion about the data. On the other hand, contrary to the common myth, USBs are not just formatted when there is an issue; they are also formatted to prepare them for first use. 

Do you know formatting a USB creates a brand-new file system? When you format a USB, you are prompted to choose a certain file system depending on your operating system. We have listed some file systems below for your convenience.

  • FAT32- This file system has a limited file size and is more suitable for small-sized files in a USB drive on Linux.
  • exFAT- This slightly advanced version of FAT32 supports large files. Also, it is highly compatible.
  • NTFS- This file system was specially designed for Windows and can easily store large-sized files.
  • macOS- This was created specifically for macOS. This file system is a pro at storing and organizing large-sized files. The only drawback of this file system is that you cannot use it with Windows. 

Also Read: How to Start, Stop, and Restart Nginx in Linux?

Method 1: Format USB Drive on Linux Using the Terminal 

We will now move forward to the method where we will use the terminal window to format the USB drive on Linux

Step 1: Connect the USB to the system.

Step 2: Now open the terminal by pressing Ctrl+Alt+T, type the command ‘lsblk,’ and press enter. 

Format USB Using the Terminal 

Step 3: Your terminal will display a list of devices, and you have to identify your USB from the list. 

Step 4: Once you have properly identified your device, simply enter the command ‘mkfs’ to start the formatting process. 

If you are using the exFAT file system, then use the below command.

sudo mkfs.exfat /dev/sdX
Format USB Using the Terminal 

In the above command, you can see terms like ‘dev/sdx,’ which defines the name of the target storage device which you want to format.

If you use the NTFS file system, run the following command.

sudo mkfs.ntfs /dev/sdb1

Format USB Using the Terminal 

Step 5: After the above step, you need to enter your super user password in the terminal. 

Step 6: After you press enter, the formatting process will complete.

Step 7: If you want to ensure your process completion, the below command can be used.

sudo fsck /dev/sdb1
Format USB Using the Terminal 

Method 2: Format USB Using Disk Utility 

A disk utility, like a USB, is the best tool to manage your storage device. If you want to format, connect, and organize your device, then using tools like GNOME can be very beneficial. Let’s have a look at the steps to format a USB drive on Linux through a disk utility application. 

  • Press the Windows key and search for applications in the search bar.
  • Once you enter the application menu, search for ‘disks’ and launch it.
Format USB Using Disk Utility 
  • A list of device storage will appear on the left sidebar of the disks.
Format USB Using Disk Utility 
  • Pick your storage device and click the gear icon on the top-right of the window. 
  • In the gear option, you will find the option ‘format disk’; click on this option.
Format USB Using Disk Utility 
  • Now the system will ask you to give your confirmation, allow the system to move forward with the process, and choose your file system from the displayed menu.
Format USB Using Disk Utility 
  • The last step is to confirm the formatting process, and the GNOME disk utility will format your USB device in Linux
Format USB Using Disk Utility 

Method 3: Format USB Drive in Linux Using the GParted Tool 

GParted, or GNOME partition editor, is very different from the GNOME tool. GNOME is a full-fledged desktop tool that helps in interaction with the operating system. GParted wholly focuses on storage device management. Check out the steps to format a USB drive on Linux through the GParted tool. 

  • First, you need to install the GParted tool if it is not already on the system. 
  • Use the following command to install the GParted.
sudo apt-get install GParted
Format USB Using the GParted Tool 
  • After the installation, you need to open the tool through the application menu.
Format USB Using the GParted Tool 
  • Once you open the tool, look for the drop-down menu in the top-right corner. Select the storage device that you want to format.
Format USB Using the GParted Tool 
  • Right-click on the chosen storage device and select ‘format to.’
Format USB Using the GParted Tool 
  • The tool will display a variety of file systems; pick the suitable one as per your operating system. 
  • After selecting the file system, you need to click on the green tick from the top banner.
Format USB Using the GParted Tool 
  • A warning message will appear on your screen regarding the deletion of the device data. Click on ‘apply’ under that message.
Format USB Using the GParted Tool 
  • Once the tool completes the formatting process, simply click on the close button.
Format USB Using the GParted Tool 

Also Read: Steps to Unzip/Extract tar.gz Files in Linux Using Command Line

Conclusion

Formatting a USB drive on Linux is easy and can be done through different methods. You can use the terminal and enter commands like mkfs.exfat or mkfs.ntfs, or use utilities like GNOME Disks or GParted to format the drive with the file system that is best for your needs and compatible with your operating system. Before formatting, make sure you have selected the correct USB drive, as all data will be erased. Formatting your USB drive will allow you to easily store and transport your files.

Arpit Saini

He is the Director of Cloud Operations at Serverwala and also follows a passion to break complex tech topics into practical and easy-to-understand articles. He loves to write about Web Hosting, Software, Virtualization, Cloud Computing, and much more.

Related Articles