
The above command will unmount /dev/sdb1. Some systems will have mounted the drive automatically, and some will not have. You can’t format a drive that is in use, so the drive must be unmounted from the file system. The device names sdb/sdb1 may differ on your system! Make Sure the Drive Isn’t Mounted dev/sdb1 2048 61341695 61339648 29.3G c W95 FAT32 (LBA)Ībove, you can see the device /dev/sdb (the physical USB drive) and /dev/sdb1 – a FAT partition on that drive. I/O size (minimum/optimal): 512 bytes / 512 bytesĭevice Boot Start End Sectors Size Id Type Sector size (logical/physical): 512 bytes / 512 bytes Among them (hopefully last in the list to make it easy to find) will be the device you just plugged in: Disk /dev/sdb: 29.26 GiB, 31406948352 bytes, 61341696 sectors The fdisk command will output a list of storage devices attached to your system. We’ll be using the sudo command frequently – many of these tasks require administrative privileges. Next, find the drive you just plugged in using the fdisk command to list ( -l) the attached storage devices: sudo fdisk -l

The first step – plug in your USB stick or external hard drive and give it a few moments to be detected.

This article will show you how to format a USB stick or external USB hard drive from the Linux command line/shell for FAT, NTFS, and EXT file systems.
