Luckily, formatting a flash drive is not rocket science, and you can easily do it via the Linux terminal or GUI tools like GParted and Disks.
Format USB Drive Using the Linux Terminal
Formatting a USB drive is effortless if you’re comfortable with the terminal. Several command-line tools aid in this task, as illustrated below.
Step 1: Locate the USB Drive
Before you can format your USB drive, you must locate the correct device. Use the lsblk command to find out the device name for your drive. Plug your USB to the desired port and run the following command:
Determine the required device by looking at the size. It should be something like /dev/sdX, where X can be a, b, c, etc. It is the device name.
Step 2: Unmount the USB
You’ll have to unmount the USB partition next. We’ll assume the device name to be /dev/sdb and the disk partition /dev/sdb1 for the rest of this guide.
The umount command unmounts the device. You’re ready for formatting the USB now.
Step 3: Format the USB Drive
Once unmounted, you can proceed with formatting the device using a new file system. Make sure to back up any critical files because you’ll lose access to them after this step.
The above command will format your USB drive with the FAT32 file system format, widely used in flash drives. But you may opt for a different file system like NTFS or exFAT.
Use the -n option to set a name for your device.
Format USB Drive Using Disks
Most popular Linux distributions are pre-packed with some type of disk manager. For example, Ubuntu ships Disks aka GNOME Disk Utility. We can easily format USBs in Linux using this application. Follow the below steps to format yours.
Step 1: Start Disks
Head over to the dash search menu and type “disks” to locate the program. Click on Disks to start the software.
Step 2: Locate the USB Drive
Disks will show a list of all available storage devices like HDDs and USBs. If you haven’t plugged your USB already, do it and locate the drive from the list of available devices. Click on it to select the USB.
Step 3: Format the USB Drive
You can start formatting once you’ve selected the appropriate device. Click on the Gear icon from the bottom menu and select Format Partition.
A prompt will appear, allowing you to set the name of your USB device, erase existing data, and choose the partition type. Select the partition type to be FAT as it works with all systems and devices. However, you can select any other type if you want.
Now click on Next and go to the following prompt showing a warning about data loss. Click on Format to complete formatting your USB in Linux.
If you’re using KDE instead of GNOME, you can use the KDE Partition Manager program in place of Disks. The steps are relatively similar and shouldn’t pose any issues.
Format USB Drive Using GParted
GParted is a robust disk management tool that makes formatting USB drives easier for Linux users. You can install it on your system using one of the below commands:
Once you’ve installed GParted, you can use it for creating, resizing, or deleting partitions and formatting storage devices. Follow the below steps carefully to format your USB using GParted.
Step 1: Start GParted
Open GParted by searching for it in the dash menu. Make sure your USB is plugged in when you start the app. It will take a few moments to initialize the storage devices.
Step 2: Locate the USB Drive
Once running, you will need to select your specific USB from the top-right menu. Click on the disk icon and choose the desired device. The following example uses the /dev/sdb device used earlier.
Step 3: Format the USB Drive
After selecting the USB device, right-click on the partition table and select the Format to option. Choose fat32 or any other partition type of your choice. GParted is now ready to format your USB using the desired file system. You’ll see a prompt at the bottom notifying you there’s a pending operation.
All you need to do now is click on the green tick icon on the top menu, and it will prompt you for confirmation. Click on Apply to format the USB.
It will take a few seconds to format your USB. GParted will display a progress bar to keep you posted about the operation.
Does Formatting USB Drive Remove All Data?
We know formatting a USB makes all the data on that device inaccessible. But does it completely wipe out existing data? The answer is no. Because when you format your device, all you’re doing is creating a new partition and thus making the old partitions writable.
So your Linux system has no idea about the old partitions and the data they hold. As you start to put new stuff into that USB, those old data get overwritten. However, you can still access the old data using data recovery tools.
If your drive holds any sensitive data, you should focus on erasing them instead of just formatting the device.
Managing USB Devices on Linux
Linux offers many powerful tools to manage and perform disk operations on USB drives. You can easily use one of these tools to format your USB and create a new file system. Users comfortable with the command line can quickly format their USB from the terminal. On the other hand, beginners may find GParted or GNOME Disks more helpful.
However, no matter what you save on your pen drive, you should always safeguard data using a strong password. Luckily, there are several easy ways to password protect your USB drive.