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: , ,

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

  1. Juris says:

    Many thanks, it helped!

  2. Moshie says:

    Thanks man this is helpful

  3. Adam says:

    Thanks this helped a lot. I had a 64 gig drive that showed up as 32 MB.

  4. ZzdayInfo says:

    Windows should be able to mount the drive, but will not be able to read the partition; at least not without a d party tool.

  5. Mike says:

    This is super helpful and worked great. Thank you so much!

  6. William says:

    Never in a million years would have have thought to do this or tinkered enough to get to it by luck. It worked, perfectly, first time, exactly as described. Amazing, and a big deal because that was a very annoying problem.

  7. LAURIE L says:

    Will this work for an sd card also?

  8. john says:

    thanks very much

  9. Cedric Conti says:

    Soo easy to follow! Thank you so much, worked like a charm!

  10. Domingo says:

    Extremely helpful, thanks]]]

  11. Mike says:

    I get this message when I try this. any idea what to do?
    Before this method i’ve been trying 5-6 different options for formatting and getting this sd card to work….

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

    • TexasKid747 says:

      Looking at the disk list, one should have the missing data. Mine was Disk 5. Select that one and the rest of the instructions works as described.

  12. raul says:

    perfect… thanks!

  13. Jorge says:

    This works perfect! Thanks!

  14. thebigoso says:

    worked great thx

  15. Tyler says:

    Thank you so much!! a necessary step if your trying to reinstall a Raspberry Pi OS on a SD card

  16. bill says:

    thank-you

  17. Chris says:

    That worked a treat, many thanks.

  18. Brandt says:

    Thanks much

  19. greatful user says:

    Thanks man, saved 93% of space on a drive

  20. Marc says:

    Thanks dude !

  21. J. Smith says:

    Wow! I never knew this utility existed. It saved my new 32GB SD card for my Raspberry Pi cluster. 🙂

    Now, I’m bummed about all those thumb drives I threw away from conferences, because I couldn’t get through their partitions.

  22. carrie Colvin says:

    I didn’t work help

  23. Vishnu says:

    My SanDisk 16 Gb shows as 30 mb..wheb tried using cmd prompt.. at the step * select partition 1. The partition doesn’t get selcted so I couldn’t proceed further..kindly help

  24. Steve says:

    THANKS! Your steps worked, unlike some other posting. I go between Mac and Win 7, somehow had fudged up a 32 gig thumb stick into 2 partitions, one of which was only 200 megs and that’s all Win 7 would see.

  25. nice says:

    Thanks! still helpful in 2018. I also used it for installing Ubuntu and my 8GB became 2MB..haha..but fix it (: Thank you for telling about computer management because I’m wasn’t sure where’s my flash drive.

  26. Umi says:

    lifesaver

  27. alejandro says:

    Great! Easy to follow! thanks a lot!

  28. cg says:

    Hi, and what to do if still not ok?
    my 16GB sandisk ulra is not repairable this way.

    until and with “clean” looks ok regarding DISKPART-messages,
    but afterwards the new partition is not created, even the original is still visible in the W10 and in diskpart as well…

  29. Jack Goff says:

    Awesome!!!! Thank you!!!!!

  30. AJ says:

    After running the “Clean” comment (without quotation marks of course) I get the following message:

    DiskDart had encountered an error: access denied. See the System Event Log for more information.

    Now what?

Leave a Reply

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

Nikki Blight – Web/PHP Developer