Mkfs.bfs mkfs.ext2 mkfs.hfs mkfs.msdos mkfs.xfs Also we clear the entire device ( /dev/sdb) and not just a partition (i.e. The zero device is faster than the random device.
One of the easiest way is to use the cat command line instruction with the zero device: cat /dev/zero >/dev/sdb. List all supported filesystem types: $ mkfs. To low level format a hard drive, the best is to clear it with all zeroes or some random value. $ sudo mkfs.xfs -f /dev/sdb1 -L "USB Drive" $ sudo mkfs.ext4 /dev/sdb1 -L "USB Drive" $ sudo mkfs.ntfs /dev/sdb1 -L "USB Drive" $ 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 WD external hard drives that cost between 50 and 100 include 1TB to 4TB on average, but be warned that the overall price will continue to rise with each additional TB of memory. 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. Since WD external hard drives are premium data storage devices, you should expect to pay anywhere between 50 and 800 for one.
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.
Formatting USB drives in Linux from the command line (terminal) is very easy.