Sometimes we may want to format external USB drive. I recently encountered a situation, where I had bootable USB drive with operating system ready to install, but I wanted to remove all this stuff and use disk for storing data. I couldn’t format this disk with GUI tools for some reason and I kept getting errors or information that it’s not possible. In case you don’t know, on Linux everything is always possible, so I quit that GUI tool, opened terminal and start playing with good old and simple programs.

When we insert disk and type:

we can see the output:

When we type:

we’ll see:

Now, we have basic information about our USB drive. It’s located in /dev/sdb and has 7,5 GB of space.
Sometimes, we can have mulitple partitions on our drive. In such case, we may want to delete them and create new partition.

To do that, we can type:

next, we can use d for deleting partition:

and n for creating a new one:

after that, we can confirm the process with w command:

next, we can umount drive:

and create a file system - in our case, we’ll use FAT32 file system in order to make USB drive accessible across all operating systems

after that, we can create a label for our disk with name disk3 (it can be anything):

Please note, when we create file system of a different type, we need to use different commands for creating disk labels. For more information about that, read article about renaming USB devices on Linux.

That’s it! Maybe it’s not that easy as clicking on the GUI, but we can see whole process and format any disk even when something seems to be messed up.