How To Format USB Drive in Linux Command Line
Abstract: /dev/sdc1 14.8G 1.4G 13.4G 10% /media/tecadminnone 1.4G 34M 1.4G 3% /run/shm
USB formatting is the process of erasing all data from the disk and prepare it for use. Sometimes we are required to change the filesystem on our USB drive, In that case, we have to format the USB drive with the new filesystem type. Formatting a USB drive in Ubuntu using Terminal commands is much easier than formatting it in Windows systems.
This tutorial will help Ubuntu (Linux) users with the simple steps for format a USB flash drive using the command line.
Step 1 – Attach USB to SystemInsert a USB drive into your system and identify your USB drive correctly. This is the step you need to take care, because you may format the wrong disk if not correctly identify your disk.
df -h
Filesystem Size Used Avail Use% Mounted on /dev/sda1 28G 24G 2.3G 92% / udev 1.4G 12K 1.4G 1% /dev tmpfs 277M 1.2M 276M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.4G 34M 1.4G 3% /run/shm /dev/sdc1 14.8G 1.4G 13.4G 10% /media/tecadmin
Now, You can see that the USD drive is attached as /dev/sdc1 device. Which is mounted on /media/tecadmin.
Step 2 – Format USB Drive in LinuxWhenever we attach a USB drive in Ubuntu, it is automatically mounted to the system. We can not format any disk on Linux systems that are already mounted. So first un-mount /dev/sdc1 USB drive on your system.
sudo umount /dev/sdc1
Now, Use one of the following commands as per the file system you want. To format a USB drive, most of the users prefer VFAT and NTFS file systems because they can be easily used on the Windows operating system.
- Format with vFat File System
sudo mkfs.vfat /dev/sdc1
- Format with NTFS File System
sudo mkfs.ntfs /dev/sdc1
- Format with EXT4 File System
sudo mkfs.ext4 /dev/sdc1
Similarly, you can format a USB Flash drive with any required file system.
ConclusionIn this tutorial, you have learned to format a USB drive on a Linux system via the command-line interface.