Mkfs.btrfs mkfs.ext3 mkfs.hfsplus mkfs. Mkfs.bfs mkfs.ext2 mkfs.hfs mkfs.msdos mkfs.xfs List all supported filesystem types: $ mkfs. $ sudo mkfs.xfs -f /dev/sdb1 -L "USB Drive" $ sudo mkfs.ext4 /dev/sdb1 -L "USB Drive" Select the exFAT radio button, then click the Next button. Type a name for your USB drive, select the Other radio button, then click the Next button. Click on the cogged wheel icon, then click the Format Partition menu option. Before we can format the USB drive with GParted, we need to unmount the USB drive. Most Linux systems with a desktop environment automatically mount the USB drive, when plugged in. Unmount the partitions on your USB drive. I’ll use this device name in the remainder of this article. After that, you can completely overwrite all the blocks of your flash drive with zeros. Remember, sdb1 is for the partition name.
#How to format usb drive on linux Pc#
$ sudo mkfs.ntfs /dev/sdb1 -L "USB Drive" We can see that it is formatted with the ext4 file system, and its Linux designation is /dev/sdc. As you can see, on my PC the USB drive is known as /dev/sdb. First, make sure that your flash drive is not mounted: sudo umount /dev/sdb1. $ sudo mkfs.exfat /dev/sdb1 -n "USB Drive" $ sudo mkfs.fat -F 32 /dev/sdb1 -n "USB Drive" Warning: Formatting the USB drive will cause the loose of data on it!įormat a USB drive to the desired format and create a label (optionally): Format To Unmount the USB drive if it is mounted: $ sudo umount /media/user/usb0 In the example above, the USB drive is recognized by the operating system as a disk named /dev/sdb with a single partition /dev/sdb1 mounted on /media/user/usb0.
#How to format usb drive on linux how to#
I will provide the examples of disk formatting to the most popular file system types: FAT32, exFAT, NTFS, EXT4, XFS and will show how to list the all supported file systems.Ĭool Tip: Check the real actual size of USB flash drive or SD card! Read More → Format USB Drive in LinuxĮxecute the lsblk command to identify the name of the partition on the USB drive you want to format: $ lsblk -fp In this note i will show how to format an external HDD, SSD or USB flash drive in Linux from the command line using mkfs utility. Other option to format a bootable USB to. This will be kind of complete refreshment of your flash drive. Now, look for Disks in menu and open the GNOME Disks application. Formatting USB drives in Linux from the command line (terminal) is very easy. First, make sure that your flash drive is not mounted: sudo umount /dev/sdb1. It comes preinstalled in a number of Linux distributions.