Formatting a USB Drive in Linux is a straightforward process for the most part, but you may encounter a few roadblocks along the way.
For instance, users are often unsure as to what file system they should format the USB with. Generally, you should stick to ext4 for the best performance and stability. But if cross-platform compatibility is a concern, you can instead go with exFAT or FAT32.
Users have also reported facing issues with the USB not being usable after formatting. We’ve detailed how you can format the USB properly and resolve all such issues in this article.
Table of Contents
How to Format USB in Linux
We’ll use ext4 as an example, but you can choose your preferred file system when formatting the USB. Remember to backup any important data beforehand. Also, make sure you specify the correct device to format when performing the command-line methods, as it’s easy to mess this up and format the wrong drive.
Using GParted
GParted is a GUI-based partition manager. Using GParted is generally the easiest way to format USB drives on most distros, so if you’re new to Linux, this should be your go-to option. Here are the necessary steps for this:
- First, you’ll have to install GParted. On Debian-based distros, you can do so with the following command:
sudo apt install gparted
- Open GParted and enter your password to authenticate.
- Select the USB from the top right.
- Right-click the USB and select Unmount.
- Next, right-click the data partition and select Format To > ext4.
- Click on Apply all operations.
- Afterward, right-click it once more and select Mount.
- If the Mount option is greyed out, execute the following commands in the terminal:
sudo mkdir /mnt/usb
sudo mount <devicepath> /mnt/usb
GNOME Disks
GNOME Disks is the default partition manager for GNOME desktop environments. It’s pre-installed in most of the popular Linux distros, including Ubuntu. Here are the steps to format your USB using this utility:
- Open the Disks utility and select the USB.
- Select the partition you want to format and click on the settings cog.
- Select Format partition and rename the volume if you want.
- You can enable Erase to overwrite the existing data, and you can also select the filesystem. Afterward, press Next > Format.
- If you want to format the entire drive at once instead, click on the triple-dot button and select Format Disk > Format.
- Press the + button to create a partition in the unallocated space.
- Adjust the partition size and other values as before and create the partition.
- Now, mount the USB to make it accessible again.
Make File System (mkfs)
GParted performs the disk operations through the mkfs
utility. So, you can think of this method as using GParted but via the command line, although their origins are actually the other way around. In any case, here are the steps to format your USB using mkfs:
- Use
df -h
to check the USB’s device path. - Unmount the USB using
sudo umount <devicepath>
. - Type
sudo mkfs -t <filesystem> <devicepath>
. - Replace
<filesystem>
with your preferred filesystem (ext4, vfat, nfts, etc.) and execute the command. - Afterward, mount the USB with the following commands:
sudo mkdir /mnt/usb
sudo mount <devicepath> /mnt/usb
Using dd
You can use dd to either zero-fill or write random data to your USB drive, essentially formatting it and making the data unrecoverable. This is a good idea if you plan to lend the USB or sell it to someone.
Using dd is very simple; the base syntax is as follows:dd if=source of=<targetdevice> <options>
For instance, if you wanted to write random data instead of zeroes to a USB mounted at /dev/sdb1
, you would use the following command:dd if=/dev/urandom of=/dev/sdb1 bs=16M

Using Shred
Shred is essentially dd but more secure. Its overwriting patterns are optimized to destroy as much residual data as possible, so this is your best bet if you’re trying to wipe the USB completely.
The base syntax for Shred is shred <options> <devicepath>
. In our example, we’ll use the -f option to force write, -n to specify the number of times to overwrite, and -v to display the ongoing operation. But for the full list of options, you can check the shred man page.

Problems When Formatting USB
A commonly reported issue regarding USBs is that users installed Linux onto the USB, and now it’s not usable for data transfer. Reverting a bootable USB to a non-bootable state is very simple; all you have to do is format it.
The USB not being mountable after formatting is another common problem. This time, it usually happens because the formatting tools in Linux are capable of removing everything from the drive, including the filesystem signatures. As there are no partitions to mount, you’ll have to create one first.
If sudo mount <device>
doesn’t let you auto-mount, you should create a mount point first and then mount the device manually as such:sudo mkdir /mnt/usb
sudo mount <devicepath> /mnt/usb
Finally, another problem worth mentioning is that the formatting process gets interrupted, and the USB doesn’t get detected afterward. Users generally use lsusb
, and when they find that the system isn’t detecting the USB at all, they assume they bricked the device.
While this is certainly a possibility, we’ve found that simple fixes like restarting the PC and reseating the USB a few times are surprisingly effective at resolving this issue.
2 Comments
What happened to the gui usb format apps?
Hi Bt,
We included GParted and GNOME Disks as these are the most popular GUI-based methods. Are you referring to any other specific app in your question?