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.

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:

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:

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:

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= 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 . 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 doesn’t let you auto-mount, you should create a mount point first and then mount the device manually as such:sudo mkdir /mnt/usbsudo mount /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.

How To Format USB In Linux  5 Easy Ways  - 43How To Format USB In Linux  5 Easy Ways  - 35How To Format USB In Linux  5 Easy Ways  - 30How To Format USB In Linux  5 Easy Ways  - 82How To Format USB In Linux  5 Easy Ways  - 26How To Format USB In Linux  5 Easy Ways  - 65How To Format USB In Linux  5 Easy Ways  - 3How To Format USB In Linux  5 Easy Ways  - 77How To Format USB In Linux  5 Easy Ways  - 97How To Format USB In Linux  5 Easy Ways  - 45