Format USB drives In FAT32 Or NTFS Format In Arch Linux

Today, we will see how to format USB drives in FAT or NTFS file system in Arch Linux and its derivatives like Antergos and Manjaro Linux. There are many GUI tools available to get this job done. However, some of you might wondering if there is any way to format the usb drives from command line. No worries! This tutorial will teach you how. The following are the two commands that I use throughout this guide to format the USB drives in FAT or NTFS format.

mkfs.vfat

mkfs.ntfs

As the name implies, mkfs.vfat will format an USB drive in FAT, and mkfs.ntfs will format the USB drive in NTFS format.

These two utilities comes preinstalled with most Linux distributions. However, these two aren’t available in my Arch Linux minimal system. After a few google search, I came to know that I must install the following two packages in-order to use those commands.

dosfstools

ntfsprogs

They are available in the default repositories of Arch Linux. So, you can install them by running the following command using Pacman as shown below.

$ sudo pacman -S dosfstools

To install ntfsprogs, run:

$ sudo pacman -S ntfsprogs

Now, let us see how to format an USB drive in MSDOS file system. The commands are same for almost all Linux distributions.

Format USB drives In FAT32 Or NTFS Format In Arch Linux

First, we will see how to format the usb drive in FAT.

Format USB drive in FAT32

First we will find out the USB drive name (This is what we say Drive letter in Windows OS).

It’s very simple, but at the same time you should be very careful if you are using dual-booting with Windows. If you don’t be careful, you might format one of your windows partitions accidentally.

We can easily find out our disk drive letters using fdisk command.

Plug your USB drive and run the following command to display the partition table.

As you see in the above output, I have two disks. One is my local hard disk (500 GB), and another one is my USB drive (8 GB).

Again, I warn you please be careful if you are using dual boot with Windows or if you have multiple OSs in the single hard drive. If you use dual boot, this command will also display the Windows drives names like /dev/sdb1, /dev/sdc1 etc., in the above result. Just make sure you are formatting the correct drive.

As I mentioned in the above screenshot, my USB drive name is /dev/sdb1.

Once you find out the USB drive name, unmount it. Because you can’t format a mounted drive. Do not un-plug, just unmount the USB drive.

To unmount the drive, run:

$ sudo umount /dev/sdb1

Sample output:

Finally, format the USB drive in FAT32 using command:

$ sudo mkfs.vfat /dev/sdb1

Sample output:

mkfs.fat 4.0 (2016-05-06)

After formatting the drive, just unmount using it command:

$ sudo umount /dev/sdb1

Again, re-plug the USB drive to start using the it.

For further details, refer man pages.

$ man mkfs.vfat

Format USB drive in NTFS

Similarly, To format the drive in NTFS, just run:

$ sudo mkfs.ntfs /dev/sdb1

For more options, refer man pages.

$ man mkfs.ntfs

Set label name to USB drives

To set drive label name use ‘-n’ flag.

For example, the following command will format my USB drive in FAT32 format and set label name for my USB drive as “sk”.

$ sudo mkfs.vfat /dev/sdb1 -n sk

Please note that lowercase labels might not work properly with DOS or Windows. So, use upper case label name.

And, that’s all for now. You know now how to format an USB drive in MSDOS filesystem in Arch Linux. Hope this helps. If you find this guide helpful, please share it on your social, prpfessional networks and support OSTechNix.