How to restore factory Hard Drive / Flash drive Capacity

SHBSystems Consultant
Problem description : Some external hard disks / USB flash drives do not show actual space as mentioned in the factory settings.

This is a common problem when you use an 8 GB USB drive to make it bootable to install a firmware/ driver on a server, which is a DOS flavored utility. After this, connect the flash drive to a laptop and it shows less than 2 GB. The reason for this is when making the flash disk to run a DOS program, it will format the flash disk with FAT file system. To correct this we need command line mode.

In Disk Management we can see the remaining space is available as unallocated. To partition it and make use of it, run the following from the command prompt:

Before executing the disk part command, make sure that the data from the flash drive is backed up as the command wipes data from the flash drive - or any other drive you select.

Run command prompt as administrator
Type "diskpart"

Type "list disk" it will show the following output (as example)
Disk ###  Status      Size     Free     Dyn  Gpt
                      --------  ----------  -------  -------  ---  ---
                      Disk 0    Online      2040 GB     0 B
                      Disk 1    Online       683 GB      0 B

Open in new window

To select Disk 0:
Type "select disk 0" (or whatever number that corresponds to your flash drive or disk), and proceed at your own risk, in particular if you have other external hard disks or USB flash drives connected to your computer.

This will shows the output as "Disk 0 is now the selected disk."

In the prompt type "clean" if you are satisfied that you have selected the right disk.
Now the entire disk shows as unallocated. You can create new partition using disk management or by using the following commands
create partition primary
                      select partition 1
                      format fs=fat32

Open in new window

After creating the primary partition and making it active, you can format the USB drive with NTFS file system from the windows explorer as well. Now it will show the entire space.
SHBSystems Consultant

Comments (3)

Very good tweak..
Top Expert 2010

This does not restore "factory" capacity.  All it does is clear a few dozen bytes in block zero which holds partition tables for a few operating systems.  

Software can actually reprogram the block counts in SSDs, USB flash drives, SATA and SAS disks to make the drive report any capacity (less than the true physical capacity).  If I were to send the command to a device to instruct it to report that total capacity was 57KB, then you could run this all day long, and even do a full format on windows, DOS, LINUX, and all you will ever see is 57KB.

Granted people like me write such code for appliance manufacturers, and antivirus people and entities that care about security and hacking, but it does not change the fact that your technique won't work if I short stroke a device, nor will it even be able to detect that this has happened.
Hi Shani Basha,

I've tried the commands above, but it was not successful for me and it was producing the same result as I do it with Device Manager.

At the end of "format fs=fat32" I've got the below message,
"100 percent completed"
Virtual Disk Service error:
The volume size is too big."

So I tried the same command with NTFS and it was success.

I even tried multiple tools like "HDD restore capacity" (Works for HDD connected in SATA cable), since I've WD external hard disk connected by USB.

Now I don't have any clue how to restore my lost space.

Details about my device:
OS: Windows 7 64 bit
Model: WD Elements external hard disk connected by USB
Claimed size : 2 TB (1.86 TB)
Size as per Windows: 37.26 GB

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.