How to format a USB stick in Ubuntu

Author: William Ramirez
Date Of Creation: 23 September 2021
Update Date: 1 July 2024
Anonim
How to format pendrive in ubuntu 20.04
Video: How to format pendrive in ubuntu 20.04

Content

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

  1. 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.
  2. 2 Run the "Disks" utility. The list of connected devices will be displayed in the left pane.
  3. 3 Select the USB flash drive in the list of connected devices. The information about the flash drive will appear in the right pane.
  4. 4 Select at least one section 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.
  5. 5 Under the section, click on the gear icon and select Format from the menu. A window with formatting options will open.
  6. 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.
  7. 7 Select the file system type. 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.
  8. 8 Format your 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

  1. 1 Open a terminal. This can be done through the main menu (Dash), or simply press Ctrl+Alt+T.
  2. 2 Enter.lsblkand press↵ Enter. A list of connected devices will be displayed.
  3. 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.
  4. 4 Unmount the flash drive partition. This must be done before formatting it. Enter the following command and then replace sdb1 flash drive partition label.
    • sudo umount / dev /sdb1
  5. 5 Delete data permanently. To do this, enter the following command. Replace sdb 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.
  6. 6 Create a new partition table. The partition table controls the partitions on a disk. Enter the following command replacing sdb flash drive partition label.
    • Enter sudo fdisk / dev /sdb and press ↵ Enter... Click on Oto create an empty partition table.
  7. 7 Click.Nto 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.
  8. 8 Click.Wto write the table and exit. This will take some time.
  9. 9 Run again.lsblkto view the created section. It will be located under the stick's label.
  10. 10 Format the created section. The new partition can be formatted with the desired file system. Enter the following command to format the partition with FAT32, which is the most compatible file system. Replace sdb1 section label.
    • sudo mkfs.vfat / dev / sdb1
  11. 11 Safely remove the USB flash drive when the formatting process is complete. To do this, enter the following command:
    • sudo eject / dev / sdb