Skip to content

Instantly share code, notes, and snippets.

@aindong
Created March 17, 2015 13:24
Show Gist options
  • Save aindong/3dd21e500d8d79f7edbf to your computer and use it in GitHub Desktop.
Save aindong/3dd21e500d8d79f7edbf to your computer and use it in GitHub Desktop.
Fixed a partitioned(shrinked) in size USB
The command line procedure is not simple, but it is the most likely thing to work.
When re-formatting the "drive" you're actually only formatting a partition on the drive. You need to use the diskpart utility to remove the partitions and create 1 single partition covering the full volume.
diskpart can be a bit dangerous, because if you pick the wrong disk or partition, you can remove data or partitions that are extremely, EXTREMELY important and lose all data on your machine.
Proceed with extreme caution!
Open up a command prompt as administrator (open the start menu, type cmd and press Enter.)
Type diskpart and press Enter. You'll end up with a new prompt that looks like this:
DISKPART>
Type
list disk <ENTER>
and you'll get a listing of all drives on your machine.
Type
select disk # <ENTER>
to select a disk, where # is the number of the disk Windows screw-balled. Usually, the device is disk 1, but it's always best to make sure.
Then type
list partition <ENTER>
to get a listing of all partitions on the disk.
If you're sure you have the right disk/partition, you can then repeat typing
select partition # <ENTER>
delete partition <ENTER>
until all partitions are removed from that drive.
Once the drive is empty, exit diskpart and remove the drive. Wait at least 5 minutes, then re-insert the drive. DO NOT CLICK FORMAT – this will most likely re-create the problem. Instead, enter diskpart again, and select the disk. Then type
create partition primary <ENTER>
Once you have created the partition, exit diskpart and, in the command promt, type
diskmgmt.msc <ENTER>
This will provide a reliable way to create a FAT32 partition. On the drive you would like to format (NEVER TOUCH DISK 0!), right click and select format. The allocation unit size option should be default, and the File System option should be set to FAT32. The format may take a while, depending on the disk size, be patient.
This should fix partition troubles on any readable USB flash drive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment