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. anyone says:

    really useful and works great with windows 8 !
    thanks for sharing!

  2. Kathy says:

    THANK YOU! Your instructions are great. I’ve tried researching multiple sites without success. Followed your instructions and I corrected my flash drive in a matter of minutes!

  3. Brian says:

    Worked like a charm! Thanks for posting this.

  4. James says:

    You are a life saver.

  5. Mark says:

    Brilliant clear instructions. Thanks so much. My hard drive is now one clear drive again.

  6. Will says:

    Thanks!

  7. Mathew says:

    THANK YOU SO MUCH, these options were to the point, easy to read, and AWESOME.!!!

  8. Kwan says:

    Thanks!

    My boss had used my 4GB thummy for his Linux update and neglected to remove his created partition!!!

    I got my 4gigs back! 🙂

  9. Guy Boisvert says:

    In step 5, sometimes Windows will tell you it encounters and error and won’t proceed. This was the case with a USB key with VMWare ESXi on it (it was on a server serving as “boot drive”).

    “clean all” works in that case. It take a while but just let diskpart do its stuff and you will get a blank USB key that you’ll be able to use as you wish.

    “The data on the HDD is not written over using the clean command like it does with the clean all command below. With the clean command, the data on the HDD is only marked as being deleted instead and is only written over when new data is written/saved to the same location on the HDD next.”

    • N. Vitus says:

      “Diskpart has encountered an error: The parameter is incorrect. see the system event Log for more infor” this is what i encountered at step 8 ( format fs=ntfs quick)

  10. Stephen says:

    Thank you. Exactly what I needed and worked as you described.

  11. Harding says:

    Tried it but I get an error on step 5. Says something about my disk being write protected… I can’t proceed

  12. wasim says:

    what if diskpart dont show the required flashdrive?

  13. Kelli says:

    This worked like a charm. Thank you very much for posting this information. Very useful and very easy to follow the instructions.

  14. Suhas says:

    Thank You Buddy

  15. […] La siguiente prueba requiere tener una sola partición en la SD que ocupe toda la memoria (ya sea fat32 o NTFS), en Windows esto requiere un proceso especial, la forma más cómoda que he encontrado es por linea de comando en Windows. […]

  16. Alexis says:

    Thank you so much!

    I hade huge problems with a 32GB USB drive, ended up with tho partitions, one with 200mb which the PC could read and one with the remaining memory for my mac…

    Now my problems are solved! Thanks again!

  17. Simon says:

    Thanks a lot!! Had some problems finding a good explanation and this was it!

  18. Laurie says:

    THANK YOU!

    This solved my exact same problem. What a relief to have back all of that space! And I have no problems reading it on my Mac, with it saying the USB has the same 8GB available.

    Much appreciate you taking the time to post this most valuable information!

  19. Alex says:

    I have similar issue as well. The step 5 error saying that “DiskPart has encountered an error: The media is write protected. See the System Event Log for more information.”

    • Nikki Blight says:

      Some thumb drives have a little switch that can be flipped to turn on write protection. Check to see if yours is such a drive.

      If not, then you may just have a defective/dead/dying drive.

  20. bhavani says:

    Really useful, thanks a lot…

  21. Mike says:

    Great work! Saved me.

  22. Kaspar says:

    Thanks! 😉

  23. Glenn says:

    Thanks for the post. Really saved me!

  24. Matt says:

    Excellent article – easy to follow and solved my problem with trying to get back unallocated disk space on my USB Flash Drive after making the drive a Windows 8 recovery drive. Thanks!

  25. Al Rohrer says:

    Thank you! Thank you! Thank you! I had a 64 GB SanDisk Thumb Drive partition itself and searching everywhere brought me no results that worked. This worked with no hitch and took only a couple minutes. Again, thank you!

  26. Derek says:

    thank you so much I thought I had lost my flash drive

  27. GF-REX says:

    Thanks for this! Helped me fix my flash drive after my PS3 partitioned it.

  28. Dave O says:

    Even now I still refer to this article. Its helped me so many times. Thankyou.

  29. John says:

    Thank you sir!!

  30. Hunter says:

    Win10 repartitioned my 64GB thumb drive to 32 gigs when I needed it to create a bootable recovery disk. Then I was stuck in the same boat you described. The above worked like a charm. Thank you for the fix and the insight!

Leave a Reply

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

Nikki Blight – Web/PHP Developer