How to format a USB stick in Ubuntu (with pictures)

Table of contents:

How to format a USB stick in Ubuntu (with pictures)
How to format a USB stick in Ubuntu (with pictures)
Anonim

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

Format a USB Flash Drive in Ubuntu Step 1
Format a USB Flash Drive in Ubuntu Step 1

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.

Format a USB Flash Drive in Ubuntu Step 2
Format a USB Flash Drive in Ubuntu Step 2

Step 2. Run the "Disks" utility

The list of connected devices will be displayed in the left pane.

Format a USB Flash Drive in Ubuntu Step 3
Format a USB Flash Drive in Ubuntu Step 3

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.

Format a USB Flash Drive in Ubuntu Step 4
Format a USB Flash Drive in Ubuntu Step 4

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.

Format a USB Flash Drive in Ubuntu Step 5
Format a USB Flash Drive in Ubuntu Step 5

Step 5. Under the section, click on the gear icon and select Format from the menu

A window with formatting options will open.

Format a USB Flash Drive in Ubuntu Step 6
Format a USB Flash Drive in Ubuntu Step 6

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.

Format a USB Flash Drive in Ubuntu Step 7
Format a USB Flash Drive in Ubuntu Step 7

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.
Format a USB Flash Drive in Ubuntu Step 8
Format a USB Flash Drive in Ubuntu Step 8

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

Format a USB Flash Drive in Ubuntu Step 9
Format a USB Flash Drive in Ubuntu Step 9

Step 1. Open a terminal

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

Format a USB Flash Drive in Ubuntu Step 10
Format a USB Flash Drive in Ubuntu Step 10

Step 2. Enter

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

Format a USB Flash Drive in Ubuntu Step 11
Format a USB Flash Drive in Ubuntu Step 11

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.

Format a USB Flash Drive in Ubuntu Step 12
Format a USB Flash Drive in Ubuntu Step 12

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

Format a USB Flash Drive in Ubuntu Step 13
Format a USB Flash Drive in Ubuntu Step 13

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.
Format a USB Flash Drive in Ubuntu Step 14
Format a USB Flash Drive in Ubuntu Step 14

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

Format a USB Flash Drive in Ubuntu Step 15
Format a USB Flash Drive in Ubuntu Step 15

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.

Format a USB Flash Drive in Ubuntu Step 16
Format a USB Flash Drive in Ubuntu Step 16

Step 8. Click

W to write the table and exit.

This will take some time.

Format a USB Flash Drive in Ubuntu Step 17
Format a USB Flash Drive in Ubuntu Step 17

Step 9. Run again

lsblk to view the created section.

It will be located under the stick's label.

Format a USB Flash Drive in Ubuntu Step 18
Format a USB Flash Drive in Ubuntu Step 18

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

Format a USB Flash Drive in Ubuntu Step 19
Format a USB Flash Drive in Ubuntu Step 19

Step 11. Safely remove the USB flash drive when the formatting process is complete

To do this, enter the following command:

Popular by topic