If you have been playing with a Raspberry Pi and the usual SD cards, chances are that you also found yourself unable to reconvert your SD card back to Windows for normal use. When you try to reformat the card in Windows, you will most likely get to a point where you have only one primary partition with all the rest of the space on the card free, but you are unable to expand the partition to cover the whole available space. You will have something like 50 to 100 MB space in your FAT32 partition and many GB space that can’t be utilised.
Well, your frustration is over. Here is how to proceed to repartition your card as you wish – in Windows. No extra tools or software is required. In the below explanation, when you see [square brackets] you don’t need to type the brackets, just the content.
Before you proceed, the usual disclaimer: I tried this on my system and it worked well, however you do this at your risk and peril and if anything happens to your computer or your card while following these instructions, I am not responsible for it.
STEP 1: insert the SD card in your reader so that the computer can recognise it, then open a command prompt and type [diskpart]. You will be taken to a window where the prompt says DISKPART> or something similar.
STEP 2: display the list of volumes by typing [list disk]. You will see a list of disks, probably something like Disk 0 and Disk 1, with the capacity in GB for each disk.
STEP 3: select the relevant volume. In my case, Disk 0 was the computer’s HDD, Disk 1 was the SD card. I recognised it because the capacity in GB matched that of the card and I had no other storage devices connected to the system other than my HDD, which I also could recognise the same way (by looking at the capacity in GB). If you are still not sure, try to run [diskpart] and [list disk] without the SD card in the slot, and then again with the card; you should notice the difference and be able to identify the correct volume. Back to business, to select the correct volume, assuming (once again, check carefully your system first when you try on your computer!) that the SD card is Disk 1, type [select disk 1].
STEP 4: clean the unit by typing [clean]. Make sure you selected the right disk when you type this, as this will clear all your partition table!
STEP 5: create a new partition by typing [create partition primary] and format it by typing [format fs=fat32 quick]. This will quick-format your partition as FAT32.
STEP 6: type [assign] and your card will immediately become ready to use.