Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to format a USB flash drive?
How do I clear everything (data, viruses) from a thumbdrive?

Disk utility

How to format a pen drive in Ubuntu 12.04? I have this pen drive which I made bootable using some other system (OS). But I need to format it now in my Ubuntu 12.04. On right click there is no option to format it. Please guide me.

share|improve this question

marked as duplicate by Anwar Shah, maythux, Eliah Kagan, jokerdino, Mitch Oct 9 '12 at 7:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You can check this question. –  Anwar Shah Oct 9 '12 at 5:54

2 Answers 2

up vote 21 down vote accepted

Method #1 (The Graphical Way)

Open Disks program from dash:

enter image description here

Then choose your device from left. Make sure you have selected at least one volume, and click on format as below:

enter image description here


Method #2 (The Command-Line Way)

In case you can't get your device formatted from Method #1 try this way.

  1. Open the Terminal (Ctrl + Alt + T)

  2. List your block storage devices by issuing the command lsblk
    Then identify your pen drive by it's SIZE. In my case its /dev/sdb

    enter image description here

  3. Erase everything in the pen drive (OPTIONAL):

    sudo dd if=/dev/zero of=/dev/sdb bs=4k && sync

    Replace /dev/sdb with your corresponding device. This will take some time. It will pretend to stuck. Just be patient.

  4. Make a new partition table in the device:

    sudo fdisk /dev/sdb

    • Then press letter o to create a new empty DOS partition table.
  5. Make a new partition:

    • Press letter n to add a new partition. You will be prompted for the size of the partition. Making a primary partition when prompted, if you are not sure.

    • Then press letter w to write table to disk and exit.

  6. Format your new partition.

    • See what is your new partition with a command lsblk
      In my case it is /dev/sdb1

    enter image description here

    • Issue the command below to format the new volume:

      sudo mkfs.vfat /dev/sdb1

      Please replace /dev/sdb1 with your corresponding device.

    • Eject the device:

      sudo eject /dev/sdb

share|improve this answer
1  
damn u just beat me :( –  Karthik T Oct 9 '12 at 5:36
1  
i have this XENSERVER bootable setup in that pen drive so whenever i do format volume or format drive it says "An Error occurred while performing an operation on "Verbatim 0302"(Verbatim 0302):The device is busy –  vipin8169 Oct 9 '12 at 5:41
1  
Oh, sorry Karthika T.... Well, I'll vote your answer :D @ vipin8169 - You have to unmount the device before you format. –  Naveen Oct 9 '12 at 14:24
    
got it naveen even before u cud speak it :P... –  vipin8169 Oct 10 '12 at 3:50
2  
No......... Y???? –  Naveen Oct 10 '12 at 10:28

Can you try the application called "Disk Utility". Its a very handy utility which should let you format the disk, among other things. You can find it by pressing ALT + F2 and typing the name, or going (i think) System->Administration, or I guess typing the name in unity dash.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.