[[!meta title="Resetting a USB stick or SD card using Windows"]]

[[!inline pages="doc/first_steps/reset.intro" raw="yes"]]

<div class="bug">

<strong>The following instructions do not work on Windows XP.</strong><br/>
The version of <span class="application">Diskpart</span> on Windows XP does not list removable disks.

</div>

Using <span class="application">Diskpart</span>
===============================================

<div class="caution">

<strong>You might overwrite any hard disk on the computer.</strong><br/>
If at some point you are not sure about the disk number, stop proceeding.

</div>

1.  Make sure that the USB stick or SD card that you want to reset is unplugged.

1.  Click on the <span class="button">Start</span> button, and choose <span
    class="menuchoice">All Programs&nbsp;▸ Accessories&nbsp;▸ Command
    Prompt</span>, to open the <span class="application">[[!wikipedia Command
    Prompt]]</span>,

    [[More help on how to start the <span class="application">Command
    Prompt</span>|http://www.computerhope.com/issues/chdos.htm]]

2.  Execute the <span class="command">diskpart</span> command, to start
<span class="application">Diskpart</span>.

3.  Execute the <span class="command">list disk</span> command to obtain
    information about each disk in the computer.

    For example:

        Diskpart> list disk

          Disk ###  Status      Size     Free     Dyn  Gpt
          --------  ----------  -------  -------  ---  ---
          Disk 0    Online        80 GB      0 B

4. Plug the USB stick or SD card that you want to reset. Run the <span
   class="command">list disk</span> command again.

   A new disk, which corresponds to that device, appears in the list.

   For example:

        Diskpart> list disk

          Disk ###  Status      Size     Free     Dyn  Gpt
          --------  ----------  -------  -------  ---  ---
          Disk 0    Online        80 GB      0 B
          Disk 1    Online         4 GB      0 B

   Make sure that its size corresponds to the size of the device that you want to
   reset. Note down the disk number assigned by <span
   class="application">Diskpart</span> to the device.

5. To select the device, execute the following command: <span
   class="command">select disk=<span class="replaceable">number</span></span>.
   Replace <span class="replaceable">number</span> by the disk number of the
   device that you want to reset.

6. Execute the <span class="command">clean</span> command to delete the
   partition table from the device.

7. Execute the <span class="command">convert mbr</span> command to
   create a new partition table on the device.

8. Execute the <span class="command">create partition primary</span>
   command to create a new primary partition on the device.

Troubleshooting
===============

See the [[Diskpart documentation from Microsoft Support|http://support.microsoft.com/kb/300415]].
