How to Format USB Drives and SD Cards on Linux?

It is essential for the user to format the SD card or USB drive before using it to avoid any issues. Formatting the USB drive and SD card is easy for Windows users. However, users find it complicated to format the USB or SD card on Linux or Unix-based operating systems. There are various methods that Linux provides for Formatting the USB drive or SD card.

This article will demonstrate the methods to format SD cards and USB drives on Linux. The content for the post is:

Let’s explore the first method.

Method 1: Format USB Drive and SD Card Using File Manager

The first method that can be considered while formatting the flash drive or SD card is using the File manager. This method can be performed by both the command line interface (CLI) and the graphical user interface (GUI). Let’s implement both in the below guide.

Using GUI

For formatting the USB or SD card using the GUI method, open the files in Linux, right-click on the inserted USB drive or SD card, and hit the “Format option” as shown in the below image:

Once you click on the “Format” option, the following interface will be opened. Type the new volume name, choose the option for the format, either FAT 32 or NTFS, depending upon the user’s requirement and click on “Next”:

After performing the above operations, Linux will confirm from the user for formatting the USB or SD card. Click on the “Format” button:

The USB drive or SD card will be formatted.

Using CLI

To format the USB drive or SD card using the CLI method, first, list down all the drives in the operating system. To do so, run the given command in the terminal:

$ df -h

After listing, choose your specific USB drive or SD card. In our case, it is on the last “/dev/sdc1”.

Unmount the selected drive using the command:

$ sudo umount /dev/sdc1

The USB drive or SD card will be unmounted.

After unmounting, format the drive or SD card with a file system such as FAT, NTFS, etc. Here, we will format the FAT 32:

$ sudo mkfs.vfat -F 32 /dev/sdc1

The execution of the above command shows that the drive is formatted with file system FAT 32.

Note: For NTFS Formatting, use the “mkfs.ntfs” in the command.

Method 2: Format USB Drive and SD Card Using GParted

Another method to Format the USB drive or SD card is using third-party software such as “GParted”. The “GParted” is a free and open-source package for editing the partition of disks. To install the GParted package in Linux, run the given command in the terminal:

$ sudo apt install gparted                    #For Debian/Ubuntu-based
$ sudo pacman -S gparted                      #For Arch-based

The GParted package will be installed.

After installing, open it by running the “GParted” command in the terminal:

$ gparted

After running the above command, the interface will be opened. Choose the inserted drive and unmount it first by right-clicking:

After unmounting it, the “Format to” option will appear in the right-click file manager. Hover on this option and then click on the desired file system (FAT 32, NTFS, EXT2, EXT3, etc) for formatting:

After that, apply the pending operation of formatting using the above toolbar:

Linux will confirm it before applying the operation, click on the “Apply” option:

The formatting will start for the selected drive:

Close it once it is completed.

The methods for formatting the USB drives or SD card have been covered.

Conclusion

In Linux, to format the USB drives and SD cards, use the file manager method either by GUI and CLI or install the GParted package. For using the GUI way to format the Drives and SD card, right-click on the inserted drive or SD card and click on the “Format” option while using the CLI way to run the commands given in the article. To format using the GParted package open it and select the drive for formatting and apply the operation. This write-up has illustrated the most convenient methods for formatting the drives and SD cards.