Repartition SD Card (Windows)

Introduction: Repartition SD Card (Windows)

About: I'm a software engineer living in Minneapolis, MN.

While tinkering with my new Raspberry Pi, I put the system in a bad place and it was clear that starting over was easiest. When Raspberry Pi images are installed on a microSD card, the card is divided into multiple partitions. To install Raspbian again, the microSD card needs to have one large partition.

Repartitioning disks is easy with the Windows Disk Management tool, but it doesn't always play nice with removable disks like flash drives and SD cards.

DiskPart is a powerful tool included with Windows. It is fairly easy to use and is able to list, create, and delete partitions. More information on DiskPart: https://technet.microsoft.com/en-us/library/bb4908...

Warnings:

- Be careful. Mistakes with DiskPart can seriously mess up your system.

- Back up any data. Everything on the SD card will be deleted.

Step 1: Open DiskPart

Search for DiskPart by hitting the Windows key and typing "diskpart". The tool will not show up until you have completely typed it out.

Right-click the tool and click "Run as administrator". This will open the DiskPart tool. You will see a command line interface like the picture above.

Step 2: Select Disk to Partition

Selecting the wrong disk could create a very unfortunate experience. Take extra precaution with this step. Make sure any data you wanted on this disk has been backed up.

I recommend disconnecting any extra disks (such as USB flash drives or other media) to make it easier to select the correct disk. To view disks, type "list disks".

Above, I typed "select disk 1" because I could see that Disk 1 was the correct disk by its size. The larger drive is my hard drive, I did not want to select that.

Step 3: Delete Partitions

Once you have selected the disk, you will want to list all of the disks on the partition by typing "list partition". In the picture above, I only have one partition left to remove. Type "select partition 1" and then "delete partition". Repeat for every partition listed.

You may want to write "list partition" after deleting each partition to make sure everything is going as planned. This is not necessary, but it's a good idea when using DiskPart for the first time.

Step 4: Create Partition

To begin using the SD card again, we need to create one large primary partition (as SD cards have by default). Type "create partition primary". Typing "list partition" shows that a new primary partition has been created.

If you want to see other options, you can also type "create partition" and various options will be shown on the screen.

Step 5: Reformat Disk

After repartitioning the disk, you can reformat the SD card like normal. This needs to be done before the SD card can be used.

If you aren't familiar with formatting a disk, you can choose the same options as above. The "Volume label" is whatever you want the SD card to be named. The other options should be selected by default. I highly recommend selecting "Quick Format". This will make formatting much faster.

DiskPart is a great tool because it doesn't take much time and doesn't require that you install any extra tools or software on your PC.

Be the First to Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Home Decor Challenge

      Home Decor Challenge
    • Furniture Contest

      Furniture Contest

    2 Comments

    0
    pereirajwc2020
    pereirajwc2020

    8 months ago

    pereirajwc2020. Hi, I need to know if it is possible to re-partition a 16GB micro SD Card into 2 x 8GB partitions.. I installed Raspbian on a 16GB card, to use with my raspberry pi, backed it up but am not able to write it to an 8GB card. If this were possible, would a 2 partition work on the pi ? Your advice will be much appreciated. Thanks.

    0
    nitishkr6702
    nitishkr6702

    Question 8 months ago

    Please, suggest what i do

    16025914603954595530802972566058.jpg