Formatting a USB drive in Ubuntu

Author: Charles Brown
Date Of Creation: 1 February 2021
Update Date: 26 June 2024
Anonim
How to format pendrive in ubuntu 20.04
Video: How to format pendrive in ubuntu 20.04

Content

Ubuntu Linux includes several utilities for formatting your USB drive. You can use Disk Utility or the Terminal, both standard Ubuntu programs. It allows you to format a USB drive in just a few minutes.

To step

Method 1 of 2: Using Disk Utility

  1. Click the Dash button and search for "disks". You will see Disks appear in the Applications results window.
  2. Launch Disks from the search results. A list of connected devices will appear in the left frame.
  3. Select your USB drive from the list of devices. Its details appear in the right frame.
  4. Select at least one volume on the USB drive. Most USB drives have only one volume, but yours has multiple volumes, then you can select one or more.
  5. Click the gear under Volumes and select "Format". This will open the options for formatting.
  6. Select what you want to delete. A Quick Format will not erase any of the data on the drive. A Slow Format will erase all data and check the drive for errors.
  7. Select the file system. There are several file systems to choose from.
    • For maximum compatibility with other devices, select "FAT" (FAT32). This works on almost all computers and just about any other device suitable for USB drives.
    • If you do not intend to use the drive for anything other than Linux, select "ext3". This allows you to take advantage of the advanced file permissions in Linux.
  8. Format the drive. Click the Format button and wait for the USB drive to be formatted. This may take a little longer on larger hard drives, and erasing all data will add some time.

Method 2 of 2: Using the Terminal

  1. Open the Terminal. You can open this with the Dash button, or by pressing Ctrl+Alt+T. to push.
  2. Type.lsblkand press "↵ Enter. This will display a list of storage devices connected to your computer.
  3. Identify your USB drive. Use the SIZE column in the list to find your USB drive.
  4. Unmount (Unmount) the partition from your USB drive. You must unmount the drive before you can start formatting. Type the following command and replace sdb1 by the partition label of your USB drive.
    • sudo umount / dev /sdb1
  5. Delete all data from the drive (optional). You can erase everything on the drive by entering the following command. Replace sdb by the name of your USB drive.
    • sudo dd if = / dev / zero or = / dev /sdb bs = 4k && sync
    • This takes time to process and it may seem like your system is stuck.
  6. Create a new partition table. This partition table defines the volume on the drive. Type the following command, replace sdb by the label of your USB drive.
    • Type sudo fdisk / dev /sdb and press ↵ Enter. Press O to create an empty partition table.
  7. Press .N.to create a new partition to make. Enter the size of the partition you want to create. Enter the full size of the drive if you are only creating a single partition.
  8. Pressure .W.to write and close the table. This may take a while.
  9. Turn.lsblkagain to view your new partition. You can find it under the name of your USB drive.
  10. Format your new volume. Now that you have created the new volume, you can format it with the file system of your choice. Enter the command to format the drive as FAT32, the most compatible file system. Replace sdb1 by the name of your partition:
    • sudo mkfs.vfat / dev / sdb1
  11. Eject the drive when you are done. When formatting is complete, you can eject the device and safely remove it:
    • sudo eject / dev / sdb