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.
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