How to Format a USB Drive in Linux

We independently review everything we recommend. When you buy through our links, we may earn a commission.

How to Format a USB Drive in Linux

When compared to other operating systems, Linux makes the formatting of USB drives a lot simpler. On Linux, you may format your USB stick using one of these three methods.

The transfer of data between computers using USB devices is a quick and easy process. In addition to that, you may utilize them in order to create live Linux installation media. The fact that specialized flash drives are simply plug-and-play devices makes it simple to use them. On the other hand, there are situations in which you could find it necessary to format your USB drive while using Linux.

You may simply format a flash drive by using the Linux command line or graphical user interface (GUI) tools like GParted and Disks. Thank goodness, formatting a flash drive does not need rocket science.

Using the Terminal in Linux, Format the USB Drive

If you are familiar with the terminal, formatting a USB drive is a simple and straightforward process. As you can see below, this work is made easier by the presence of many command-line tools.

Locate the USB Drive

Before you can format your USB drive, you will need to find the device that you want to format. You can find out the name of the device that your drive is attached to by using the lsblk command. Run the following command after connecting your USB drive to the appropriate port:


Examining the dimensions can help you identify the appropriate tool. It need to be something along the lines of /dev/sdX, where X might be anything from a to c. It is the name of the gadget.

Dismount the USB drive

Following that, you will need to unmount the USB partition. For the remainder of this article, we will proceed under the assumption that the device name is /dev/sdb and that the disk partition is /dev/sdb1.

sudo umount /dev/sdb1

The umount command will cause the device to be unmounted. At this point, you are prepared to format the USB drive.

Perform a format on the USB Drive

After the device has been unmounted, you can then move on to the next step of formatting it by utilizing a new file system. Make sure you have a backup of any important files, as you won’t have access to them after this step is completed.

sudo mkfs.vfat -F 32 /dev/sdb1

With the aforementioned command, your USB device will be formatted with the FAT32 file system format, which is the most common format for flash drives. However, you have the option of switching to a different file system such as NTFS or exFAT.

To give your device a name, use the -n option in the command line.

sudo mkfs.vfat -F 32 -n ‘live-usb’ /dev/sdb1

Using Disks to Format a USB Drive

The vast majority of popular Linux distributions come pre-packaged with a disk manager of some kind. For instance, Ubuntu comes along with GNOME Disk Utility, sometimes known as Disks. Using this program, we may format USBs under Linux in a quick and easy manner. In order to format yours, follow the instructions below.

Start Disks

You may find the software by going to the dash search menu and typing “disks” into the search bar. To begin using the software, select Disks from the menu.

Find the USB Drive that you need

When you click on Disks, a list of all of the accessible storage devices, such as HDDs and USBs, will appear. If you haven’t previously connected in your USB, you should do so now and look for the drive on the list of devices that are available. To choose the USB, you need to click on it.

Format the USB Drive

After you have chosen the correct device, you will be able to begin the formatting process. To format a partition, from the bottom menu’s Gear icon, pick the Format Partition option.

You will get a popup that will enable you to specify the name of your USB device, delete any data that is already there, and select the type of partition to use. Choose FAT as the partition type since it is compatible with all operating systems and devices. On the other hand, if you wish to choose a different kind, you can do so.

Now, click on the Next button, and go to the next question, which will offer you a warning about losing data. To finish formatting your USB drive using Linux, click the Format button.

You may use the KDE Partition Manager tool instead of the Disks application if you are working with KDE rather than GNOME. The steps are fairly interchangeable and ought not to present any difficulties.

Format USB Drive Using GParted

GParted is a powerful disk management application that facilitates an easier formatting process for USB devices for users of Linux. You may install it on your computer by using one of the scripts that are listed below:

After you have completed the installation of GParted, you will be able to use it to create, resize, or delete partitions, as well as format storage devices. To successfully format your USB drive using GParted, carefully follow the procedures below.

Start GParted

To launch GParted, look for the program’s name in the dash menu. When you first launch the application, check to see that your USB is properly connected. The initialization of the storage devices will take a few seconds to complete.

Locate the USB Drive

As soon as it is started, you will go to the menu in the top-right corner to choose your particular USB. Simply select the desired storage medium by clicking on the disk icon. The /dev/sdb device from before is going to be utilized in the next example.

Format the USB Drive

Once the USB device has been chosen, right-click on the partition table, and then pick the option labeled Format to from the context menu. Choose fat32 as the partition type, or select any other kind you like. GParted is now prepared to format your USB drive utilizing the file system of your choosing. A notification that an operation is about to take place will appear as a prompt at the bottom of the screen.

Now, all you have to do is click on the symbol that looks like a green checkmark towards the top of the page, and it will ask you for confirmation. To format the USB, click the Apply button.

The process of formatting your USB drive will just take a few seconds. GParted will keep you informed about the procedure by displaying a progress bar in the window.

Does Formatting a USB Drive Erase All of Its Contents?

We are aware that formatting a USB renders inaccessible any and all data stored on the device. However, does it totally delete any previously stored data? The correct response is “no.” Simply because the act of formatting your device entails nothing more than the creation of a new partition, which in turn renders the previous partitions readable.

Therefore, your Linux system is unaware of the previous partitions and the information that they contain. As you continue to add new content to that USB, the previously stored data will eventually be wiped. Nevertheless, by utilizing data recovery programs, you may still retrieve the previously stored information.

Instead of just formatting the device, you should concentrate on removing any sensitive data that could be stored on the disk in question.

Using Linux to Manage USB Devices

Linux provides a wide variety of robust tools for managing and operating on USB devices in the capacity of a disk. You may quickly build a new file system and format your USB drive by making use of one of these programs. Users who are familiar with the command line can format their USB rapidly via the terminal. On the other side, those who are just starting off might find GParted or GNOME Disks to be more useful.

On the other hand, regardless of what you save on your flash drive, you should never forget to protect the data on it with a robust password. Your USB device may be protected with a password in a number of straightforward methods, thankfully.

We will be happy to hear your thoughts

Leave a reply