Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
138
rated 0 times [  138] [ 0]  / answers: 1 / hits: 459557  / 3 Years ago, sat, november 13, 2021, 7:14:34

Possible Duplicate:

How to format a USB flash drive?

How do I clear everything (data, viruses) from a thumbdrive?






How to format a pen drive in Ubuntu?

I have this pen drive which I made bootable using some other system (OS).

But I need to format it from my Ubuntu 12.04. Please guide me.


More From » usb-drive

 Answers
2

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



[#35064] Saturday, November 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
whipstder

Total Points: 189
Total Questions: 110
Total Answers: 99

Location: Uzbekistan
Member since Sat, Feb 27, 2021
3 Years ago
;