Formatting USB flash drive securely on Ubuntu

After days of searching on the internet - I really need you help.

I have fresh installation of Ubuntu 20.04. No additional software has been installed. Also no changes to the system have been made. It is really just clean installation from DVD and update through “software update”.

I want to connect an USB-drive to this system and format it. I do not need to open any files from USB-drive. The only purpose is to have a fat32 formatted USB-drive.

How to perform this action without risking to get a worm or any other malware potentially contained on the USB-drive?


Solution 1:

General advice:

  • You can use the built-in tool Disks alias gnome-disks to format the USB-drive.

  • or you can install mkusb from its PPA and use it either

    • to format the USB-drive (create a fresh partition table with one FAT32 partition) that you ask for
    • or a more advanced 2 step procedure to first wipe the whole device (overwrite with zeros) and then format it.

Please ask in a comment, if you need more details.