Removing partitions from a USB thumb drive

diskpartSo… a while back I was playing around with Linux and needed a bootable install disc. I decided to make one of my spare USB thumb drives into one. All went well, and I successfully installed Ubuntu Server on my machine. Great.

Fast forward to this morning when I needed said thumb drive to transfer some pretty hefty files. Low and behold, my 4GB thumb drive was being read as a 2MB thumb drive. No problem… just format the thing, right? Uh… no. Apparently not.

To create the install disk, I used a nice little program called Image Writer for Windows It worked great, but unfortunately it partitioned my thumb drive, and Windows 7, for some reason, couldn’t get rid of the partitions when I tried to format it. Bleh. Thankfully, Google is always there when I need it.

It turns out there’s utility in Windows 7 (and probably other Windows versions as well, but I’m using 7) called Diskpart that will fix this problem right up for you. Here’s how to use it to format a USB drive.

  1. Bring up the command prompt. Easiest way is to go to the Start menu and type in “cmd” in the search box and hit enter.
  2. In the command prompt window, type “diskpart”. That will launch another window with a DISKPART> prompt.
  3. Type “list disk” to find out which disk your USB drive is. It should be pretty obvious from the size of the disk. If it’s not, alternatively, you can search “Computer Management” under the Start menu, and then click on “Disk Management”. You should see something that says “Disk 1 Removeable” or something similar.
  4. Once you know which disk you want, in the Diskpart window, type “select disk 1” (or whatever number your thumb drive happens to be assigned to). Diskpart should tell you that this is now the selected disk,
  5. Type “clean”. This will get rid of all the old information on the disk, as well as any partitions. Diskpart will tell you when this has succeeded.
  6. Type “create partition primary”. This sets up the new partition (one big one instead of a small one) for the drive.
  7. Type “select partition 1” to select the partition you just created.
  8. Type “active” to mark the selected partition as active.
  9. Type “format fs=ntfs quick” to format the drive. This may take a few minutes depending on the size of the drive.
  10. Type “assign”.
  11. Type “exit” to leave the Diskpart program.

Now remove the thumb drive from the USB port, and then plug it back in. It should come up at its original size. Ta-da!

Just as a word of caution, Diskpart doesn’t seem to have any confirmation prompts built into it. So BE CAREFUL which drive you’re telling it to use, or you might end up formatting something that shouldn’t be formatted.

Tags: , ,

170 Comments to "Removing partitions from a USB thumb drive"

  1. Big ups for the knowledge. Danke

  2. Hies says:

    Thanks so much!! you helped me get my 7500MB back 🙂

  3. Amresh RAj says:

    stuck here after the clean command, message says :

    DISKPART> select disk 1

    Disk 1 is now the selected disk.

    DISKPART> clean

    Virtual Disk Service error:
    Clean is not allowed on the disk containing the current boot,
    system, pagefile, crashdump or hibernation volume.

    DISKPART>

    • sauron says:

      try executing it whit administrator privileges you can find the app whit the adresse you sould have at the top of the window.
      hop i helped

  4. Joe says:

    Thank you so much for the directions and for sharing your knowledge!!!!

  5. Swanand says:

    Really useful. Well written in perfect steps

  6. N. Vitus says:

    The parameter is incorrect is what i get at step 8. please how do i rectify this.

  7. Philip says:

    Still not working for me. Showing only 27.5gb on a 64gb Samsung disk? Any other help you can give? Thanks

  8. Trish says:

    Works great, thank you very much!!!
    I needed to run “clean”, the first time i got an error message “Access is denied”, i just reentered the command after 30 sec and it worked.

  9. Twinkle says:

    Thanks! This worked! ????

  10. Aravind says:

    Thanks a ton!!
    You saved me from getting a new USB drive.

  11. tulchca says:

    Worked perfectly on my SanDisk 32GB drive that was showing two 16M partitions. Thank you!

  12. bippi says:

    Thanks you so much my pendrive is now back…..

  13. chriskourd says:

    It worked like a charm!many thanks!

  14. Joseph says:

    WOW! It works like a charm.. Followed the instructions and rescued USB Drives I had given up on. Thanks a Big Bunch!

  15. Absar Syed says:

    when i typed in “create partition primary” i got “virtual disk service error: the operation is not supported on an non-empty removable disk” even though i typed clean and it was successful. any help would be appreciated.

  16. Daniel W Anderson says:

    thank you very much for your wisdom!!!

  17. Manu says:

    Really usefull…..

    My 32 gb memory card (after installing remix os) showed only 7.90 gb free space left…i couldn’t solve it…

    When I done steps as said in this site…access denied message occured on clean command…as one commented above i waited and done again….

    It worked….Thanks so much…!!!

  18. Purveyor says:

    Thank you so much for this! It worked perfectly and your instructions were incredibly clear and easy to follow! Thank you again!!

  19. Nepenthes says:

    Unfortunately for me, it didn’t work.

    DISKPART> clean
    DiskPart succeeded in cleaning the disk.

    DISKPART> create partition primary
    No usable free extent could be found. It may be that there is insufficient
    free space to create a partition at the specified size and offset. Specify
    different size and offset values or don’t specify either to create the
    maximum sized partition. It may be that the disk is partitioned using the MBR disk
    partitioning format and the disk contains either 4 primary partitions, (no
    more partitions may be created), or 3 primary partitions and one extended
    partition, (only logical drives may be created).

  20. Klaus says:

    Thank you, thank you, thank you.
    I have my 32GB SD card back!! I used diskpart on Windows 10 and formatted “fs=fat32” which took about 1 hour to do because I didn’t use quick formatting…
    All is good now. I am grateful for the Internet and all it’s helpful websites.

  21. Bert says:

    Thank you, saved me throwing a good SD card away!

  22. Karunakar says:

    Thanks for the help, i got my 8GB back

  23. DeusEM says:

    Thank you very much!

  24. Nigel says:

    Well written easy to follow instructions, thanks for taking the time to provide them.

  25. Con says:

    Thanks mate. Such a simple thing, but hard to find info on. Awesome.

  26. jef says:

    thank you 🙂

  27. dookie x says:

    yay! thanks, did the trick. the Linux works on the other machine swell, as well, but now back to Win 10 and a 16G USB working like always.
    thanks for the hand-holding.

  28. Onassis says:

    Amazing infoset. Have been scratching my head for weeks. Thanks a million

  29. Aditya Khandwal says:

    Wooww…..!!Its really worked.
    Thnx a lot…..

  30. uk_eee says:

    THANKS WORKED IN UNDER 1 MINUTE. U R A GENIUS!

Leave a Reply

Your email address will not be published. Required fields are marked *

Nikki Blight – Web/PHP Developer