How To Use DiskPart Command To Recover Missing Or Unallocated Space On A USB Drive

The other day I was trying to burn an Image on a USB drive and ran into a strange problem.

After using a freeware image burner to burn a portable Operating system on my 4GB removable drive, I found that my USB drive has lost all it’s space. I opened Windows Explorer, right clicked the USB drive icon, selected properties and found that the available space shown was only 250 MB.

More than 3 Gigabytes of free space was lost in thin air !


I thought that since I have burned all the files of a portable os on the USB drive, it might have rewritten the partition on the USB drive. I performed a quick format and then a complete clean format of the removable pen drive but the lost space was not recovered. The USB drive was showing the same space status e.g “ Free space available: 30 MB”, Used Space: 3.5 GB”.

The fact of the matter is that the USB drive was completely accessible and I can easily copy or move files and folders from my computer to the removable drive. But anything more than 250 MB was not accepted as the USB drive has lost all space after trying to burn some files on to it.

Next I tried a disk wipe utility to completely delete the USB partition, formatted it again but the problem was not fixed. Again, I tried some free programs to recover hard drive space in Windows but none of them worked.

Finally, I was able to recover lost space on the USB drive using DiskPart command built right within Windows.

Recover Lost Space On a USB Partition: Reuse Unallocated Space

If you are going through a similar situation and want to get back the lost space on a USB partition or rewrite the unallocated USB partition, here are the steps you should follow:

1. First back up all the data from your USB drive to another location.

2. Click Windows start menu, type disk management in the search box and click on “Create and format hard disk partitions”

Create and format hard disk or USB partitions

3. On the disk management window, you should see your computer’s hard drive listed under the “Disk 0” pane. All removable drives including the USB drive or any removable hard disk which you might be using shall be listed under the “Disk 1” pane.


Note: Be very careful while working over the disk management console window. If you don’t know what you’re doing, please consult an expert who has the knowledge of formatting hard disk partitions. In case your hard drive has crashed and the OS isn’t booting at all, please read our guide on recovering all the data from a hard drive in case of system failure

3. If you have lost space on the USB drive or any removable storage, you should see a large amount of unallocated space under “Disk 1” pane.

If you see that a good amount of unallocated space is shown in the Drive 1 pane, calm down. Your USB drive is perfectly fine and it is very much possible to allocate the lost space and recover it on the USB partition. The hardware is OK and neither you need to go to your computer vendor and install any firmware on it.

The Problem with Unallocated space on USB drives

The problem here is that the freeware image burner completely changed the system partition on the USB drive and after the image was burned, all the unused space has been automatically unallocated. [ Some operating systems e.g Chrome OS requires that the source disk should not have any free space available and I am very sure that the Chrome OS image is the actual culprit which unallocated all the free space on my USB drive. ]

Now all you have to do is delete the existing partitions on the USB drive and recreate a new partition from Windows Disk management console.

While there are a lot of open source and free disk management utilities available, there is no need t use any of them. You can recreate the fresh partition using any of the following two ways:

  • Use Windows Disk Management console to delete the existing partition, create a new partition and allocate the unallocated space
  • Use Windows DiskPart command to delete all partitions in the removable drive and allocate all the unavailable space to a new parition.

I would follow the second method because it’s more easy and takes only half a minute.

4. Click Windows start menu, type “Diskpart” and click the result to open the DiskPart command prompt window.


5. In the command prompt window, type list disk and hit Enter.

6. This will show the current hard drive as well as removable drive status of your computer. The removable USB drive or hard disk will be shown under Disk 1, as shown below:


7. Next, type in the following commands one by one:

select disk 1


create partition primary

8. The first command selects your removable USB drive while the Clean command deletes all the current partitions present on the USB drive. Next, the “Create primary partition” creates a fresh partition and allocates all the unallocated space on this fresh partition.

9. When you are done, type Exit to close the command prompt window.

10. Done !

Unplug your USB drive and plug it back again. You should now see that the entire unallocated space on the USB drive has been recovered. Here are a couple of more articles which are worth a read:

Did you accidentally deleted your USB partition ever? How did you fix the problem? Let us know your thoughts in the comments section.


  1. if the upper post are not working please try this

    0. Download the Lexar tool and extract to your PC
    – Click here to download:
    1. On Windows 7, remember to right click and “Run as Admin”.
    2. Select your thumb drive letter, and click on the ‘Non-Active’ radio button at the bottom of the window
    3. Now click on the ‘Format’ button
    4. Remove and insert back of your Flash drive
    5. Go back to disc management and reformat the flash drive again and you will get the whole space again


  2. the second part of this article helped me so quickly after trying to figure this out myself!  thanks alot.

  3. thanks man! works great for me I have now the lost usb space. before only 1gb was seen but now
    it is completely 8gb. i use the disk part.. wonderful !!!!

  4. Thank you! I knew my 8GB TMNT USB wasn’t 2GB it was due to changing the file system to install Windows XP off USB. Will keep this for future reference!

  5. hey there tried doing option 2 on my usb drive, in dos prompt it gave an error, said access denied. the last I had tried using it was for installing chrome os on a netbook. now when I plug in the usb drive on the computer window pops up with the usb name (G:) but says please insert disk into G:. and when I access it in my computer it says o bytes available …. please help

  6. i cant find Disk 1 in the list disk command .. i only find Disk 0 .. plus the disk management feature gives an error when i try to create a new partition .. So what can i do ?

  7. Hi,
    I tried this after I had the same problem after recovering the Chrome OS on my daughter’s Chromebook. Now, when I go to format the disk, it says I can’t write to it. I tried changing the attribute but it says “No” under the readonly attribute such that it thinks it’s not read-only. How do I get this thing formatted??

  8. hey thanks very much everything worked very well; except from the fact that i can’t see my external disk no more except in the disk management. AND it says capacity : 0 octet. CAN you help me please ?

  9. Thank you soooo much this actually worked! However the usb dive I wanted to clean showed up under Disk 2. So just be mindful that not all external usb drives will be under disk 1 as the article states. Look carefully to make sure you are erasing the right drive and changing the command to fit that.

  10. great bro! exactly what I wanted, Remix OS converted my 16gb pen drive into 1 gb, but you post helped me, thank you.

  11. Diskpart. Great little program. Great article… right to the point and easy to follow. Thank you so much.


Please enter your comment!
Please enter your name here