Ubuntu Linux includes utilities that you can use to format your USB flash drive (flash drive). For example, this can be done through the pre-installed "Disks" utility or through the terminal. In any case, the flash drive is formatted in just a few minutes.
Steps
Method 1 of 2: Disks Utility

Step 1. Open the main menu (Dash) and in the search bar enter "disks" (without quotes)
The Disks utility appears in the search results in the Applications section.

Step 2. Run the "Disks" utility
The list of connected devices will be displayed in the left pane.

Step 3. In the list of connected devices, select the USB flash drive
The information about the flash drive will appear in the right pane.

Step 4. Select at least one partition on the USB flash drive
Most flash drives include only one section, but in the case of multiple sections, select one or all sections at once.

Step 5. Under the section, click on the gear icon and select Format from the menu
A window with formatting options will open.

Step 6. Select the type of formatting
With a quick format, deleted data can be recovered. In case of full formatting, the information will be deleted irrevocably, and the flash drive will be checked for errors.

Step 7. Select the type of file system
You can choose from several file systems.
- For maximum compatibility with other devices, select “FAT” (FAT32) from the menu. In this case, the flash drive will work on any computer and practically on any device to which it can be connected.
- If the flash drive will only connect to a computer running Linux, select "ext3" from the menu. This will allow you to use extended Linux file permissions.

Step 8. Format the USB stick
Click "Format" to start the process of formatting the flash drive. It will take some time, which depends on the capacity of the flash drive and the selected formatting type.
Method 2 of 2: Terminal

Step 1. Open a terminal
This can be done through the main menu (Dash), or simply press Ctrl + Alt + T.

Step 2. Enter
lsblk and press ↵ Enter. A list of connected devices will be displayed.

Step 3. Find the USB flash drive in the list
To do this, look at the “SIZE” column to find the USB stick by its capacity.

Step 4. Unmount the flash drive partition
This must be done before formatting it. Enter the following command and then replace sdb1 with your flash drive partition label.
sudo umount / dev / sdb1

Step 5. Delete the data permanently
To do this, enter the following command. Replace sdb with your flash drive partition label.
- sudo dd if = / dev / zero of = / dev / sdb bs = 4k && sync
- It will take some time to execute this command, and the terminal will freeze.

Step 6. Create a new partition table
The partition table controls the partitions on a disk. Enter the following command, replacing sdb with your flash drive partition label.
Type sudo fdisk / dev / sdb and press ↵ Enter. Press O to create an empty partition table

Step 7. Click
N to create a new section.
Specify the size of the partition to be created. Enter the capacity of the entire flash drive if creating one partition.

Step 8. Click
W to write the table and exit.
This will take some time.

Step 9. Run again
lsblk to view the created section.
It will be located under the stick's label.

Step 10. Format the created partition
The new partition can be formatted in the desired file system. Enter the following command to format the partition with FAT32, which is the most compatible file system. Replace sdb1 with the partition label.
sudo mkfs.vfat / dev / sdb1

Step 11. Safely remove the USB flash drive when the formatting process is complete
To do this, enter the following command: