Removing partitions from a USB thumb drive
So… 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.
- 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.
- In the command prompt window, type “diskpart”. That will launch another window with a DISKPART> prompt.
- 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.
- 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,
- 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.
- Type “create partition primary”. This sets up the new partition (one big one instead of a small one) for the drive.
- Type “select partition 1” to select the partition you just created.
- Type “active” to mark the selected partition as active.
- Type “format fs=ntfs quick” to format the drive. This may take a few minutes depending on the size of the drive.
- Type “assign”.
- 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.
really useful and works great with windows 8 !
thanks for sharing!
Thanks for the help…indeed useful
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!
Worked like a charm! Thanks for posting this.
You are a life saver.
Brilliant clear instructions. Thanks so much. My hard drive is now one clear drive again.
Thanks!
THANK YOU SO MUCH, these options were to the point, easy to read, and AWESOME.!!!
Thanks!
My boss had used my 4GB thummy for his Linux update and neglected to remove his created partition!!!
I got my 4gigs back! 🙂
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.”
“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)
Thank you. Exactly what I needed and worked as you described.
Tried it but I get an error on step 5. Says something about my disk being write protected… I can’t proceed
what if diskpart dont show the required flashdrive?
This worked like a charm. Thank you very much for posting this information. Very useful and very easy to follow the instructions.
Thank You Buddy
[…] 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. […]
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!
Thanks a lot!! Had some problems finding a good explanation and this was it!
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!
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.”
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.
Really useful, thanks a lot…
Great work! Saved me.
Thanks! 😉
Thanks for the post. Really saved me!
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!
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!
thank you so much I thought I had lost my flash drive
Thanks for this! Helped me fix my flash drive after my PS3 partitioned it.
Even now I still refer to this article. Its helped me so many times. Thankyou.
Thank you sir!!
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!