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

Sunday, October 21, 2012


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 drivehas 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 !
lost-space-usb-drive
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.
disk-management-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.
open-windows-diskpart-utility
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:
recover-space-usb-drive-diskpart
7. Next, type in the following commands one by one:
select disk 1
Clean
create partition primary
8. The first command selects your removable USB drive while the Clean command deletes all the current partitions present on theUSB 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:

0 comments: