x32x01
ADMINISTRATOR
- by x32x01 ||
How to Format USB Drives in Linux
The easiest and fastest way to format a USB drive in Linux is through the terminal. The procedure consists of three steps:- Locating the USB drive.
- Unmounting and formatting the USB drive.
- Verifying the process was successful.
Step 1: Locate USB Drive
Open the terminal and run the following command:
Code:
df
The terminal prints out a list of all mounted partitions and relevant information: used space, available space, used space percentage, and the path.
Locate the USB in the list and find the corresponding device. In this example, the USB drive is /dev/sdb1.
Note: If you are unsure of the drive designation, unplug the USB drive temporarily before running the df command again. The device that is now gone from the list is your USB device.
Step 2: Unmount and Format USB Drive
Unmount the USB drives before formatting. To do so, run this command:
Code:
sudo umount /dev/sdb1
- To format a USB drive with FAT32 file system, use:
Code:
sudo mkfs.vfat /dev/sdb1
- To format a USB drive using the NTFS file system run:
Code:
sudo mkfs.ntfs /dev/sdb1
- To format a USB drive in accordance with the exFAT file system use:
Code:
sudo mkfs.exfat /dev/sdb1
Step 3: Verify USB Drive Formatting
Confirm the formatting process has completed successfully:
Code:
sudo fsck /dev/sdb1
A USB drive with no files indicates successful formatting.