The Ubuntu operating system includes several software tools that allow you to format a USB stick according to your needs. You can use the "Disks" system utility which can be installed on your system directly from the packages included in Ubuntu. Alternatively, you can use the command console of the operating system, ie the "Terminal" window. Either way, you'll be able to successfully format a USB memory drive in minutes.
Steps
Method 1 of 2: Using the Disk Utility
Step 1. Press the "Dash" button and search using the keyword "disks"
You will see the "Disks" icon appear in the "Applications" section of the results list.
Step 2. Start the "Disks" program by clicking on its icon
In the panel on the left of the "Disks" window, you will see a complete list of all storage devices currently connected to your computer.
Step 3. Select the USB key to format from the "Devices" list
The detailed information about the memory unit will be displayed in the right pane of the "Disks" window.
Step 4. Select at least one of the volumes on the chosen USB stick
Most removable USB memory drives have only one volume, but if yours has multiple volumes you can choose to select one or select all.
Step 5. Press the gear button at the bottom of the "Volumes" box, then choose the "Format" option from the menu that appears
The options for formatting will be displayed.
Step 6. Choose how to format
If you choose "quick" format, the data on the memory drive will not be deleted. If you choose the "slow" format, all data on the drive will be overwritten and a check on the integrity of the device will be performed.
Step 7. Select the file system to use for formatting
There are several file systems to choose from.
- If you want to ensure maximum compatibility of the memory unit with existing platforms, choose the "FAT" (FAT32) file system: this format is compatible with practically all operating systems and devices in circulation that allow the use of memory units USB.
- If you intend to use the USB drive only on Linux systems, choose the "ext3" option: this way, you will be able to take advantage of the advanced system for managing Linux file access permissions.
Step 8. Format the memory drive
Press the "Format" button and wait for the formatting procedure to complete. Depending on the size of the USB stick, this may take some time, especially if you have chosen the "slow" mode.
Method 2 of 2: Using the Terminal Window
Step 1. Open a "Terminal" window
You can perform this step using the Ubuntu "Dash" or by pressing the key combination Ctrl + Alt + T.
Step 2. Type the command
lsblk inside the "Terminal" window and press the key Enter.
This will display the complete list of all storage devices currently connected to your computer.
Step 3. Identify the USB drive to format
Please refer to the "Size" column of the table.
Step 4. Unmount the USB drive
Before you can proceed to format the USB stick, you will need to unmount it. Type the following command in the "Terminal" window and press the "Enter" key (replace the sdb1 parameter with the name of the partition on the USB drive):
sudo umount / dev / sdb1
Step 5. Erase all data on the drive (optional)
Using the command described in this step, you will be able to physically erase all information stored on the USB drive. Also in this case replace the sdb parameter with the identifier of the USB key:
- sudo dd if = / dev / zero of = / dev / sdb bs = 4k && sync
- This step takes a long time to complete and the "Terminal" window may appear to be frozen.
- If you are using Ubuntu 16.04 or later, you will need to use the following command: sudo dd if = / dev / zero of = / dev / sdb bs = 4k status = progress && sync.
Step 6. Create a new partition table
This item checks all volumes on a storage unit. Type the following command replacing the sdb parameter with the identifier of your USB drive.
Type the command sudo fdisk / dev / sdb and press the Enter key. When prompted, press the O key to create an empty partition table
Step 7. Press the button
No. to create a new partition.
Specify the size of the new partition you want to create. If you only need to create one partition, enter the value corresponding to the overall storage capacity of the drive.
Step 8. Press the button
W to save the drive to disk and complete the command.
Performing this step will take a few moments.
Step 9. Run the command again
lsblk to view the newly created partition.
It will be listed under the name of the USB drive.
Step 10. Format the new volume
Now that you have created a new partition, you can format it using the file system that best suits your needs. Use the following command to format the drive using the "FAT32" file system, which is the one that guarantees the highest compatibility level. Replace the sdb1 parameter with the identifier of the volume to be formatted:
sudo mkfs.vfat / dev / sdb1
Step 11. After formatting is complete, eject the drive from the system in a safe and controlled manner
Use the following command: