I usually format virus infected pen drive to ensure my windows system not infected with the infected pen drive.  Virus written for windows platform usually do not work within Linux platform so you can use infected pen drive without worry in the Linux system. Here i am showing you how you can format USB pen drive from graphical interface and command prompt.

Use below mentioned command to format USB pen drive.

Make sure USB pen is not mounted.

If mounted Click on Places > Computer > Select USB pen > Right click > Select Unmount Volume to unmount volume USB volume.

Check partition label using fdisk command or gnome graphical partition editor.

mkfs command

In my case USB partition label is /dev/sda1. Please check at your end using above method. Be careful using while using partition label, Wrong partition label can wipe out your entire hard disk or specific partition volume.

To format open terminal window and type the command

$ sudo mkfs.vfat /dev/sda1

For LINUX/EXT3 file system use below mentioned command

$ sudo mkfs.ext3 /dev/sda1

Written by Bala Krishna

Bala Krishna is web developer and occasional blogger from Bhopal, MP, India. He like to share idea, issue he face while working with the code.

This article has 2 comments

  1. Vasanth

    You can use the Disk Utility tool in Ubuntu

    1. System>Administration>Disk Utility
    2. Select the pendrive and click “unmount volume”
    3. format the drive
    4. create partition (of whatever your choice)

    that’s it. works 100%