# Format USB Drive

{% hint style="danger" %}
This will permanently delete any data stored on the USB drive. Make sure the correct drive is selected when following these commands.
{% endhint %}

If the USB drive does not boot on the target device then try to reformat the USB drive by following these steps:

{% tabs %}
{% tab title="Windows" %}

1. Insert the USB drive.
2. Open a Command Prompt as Administrator.
3. At the Command Prompt type the following pressing Enter after each line:

{% tabs %}
{% tab title="USB Drive 32GB or Smaller" %}

```
diskpart
list disk
select disk X (Where X is the number assigned to the target USB drive)
clean
convert mbr
create partition primary
format fs=fat32
assign
active
exit
exit
```

{% endtab %}

{% tab title="USB Drive Larger than 32GB" %}

```
diskpart
list disk
select disk X (Where X is the number assigned to the target USB drive)
clean
convert mbr
create partition primary size=32768
format fs=fat32
assign
active
exit
exit
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="Linux" %}

1. Open a terminal and run this command to locate the right device:

   ```
   lsblk
   ```
2. Use `fdisk` command accordingly:
   1. `sudo fdisk /dev/sdX`; `X` stands for the right disk letter something in the region of `b`, `c` or `d`
   2. Type o to change the partition table type to `dos`
   3. When the command runs type d and enter to delete the existing partition.
   4. Type n to create new partition.
   5. Accept the defaults when ask for the `partition type` and `size` (assuming that is desirable).
   6. Type p to see what you have done.
   7. Type t to change the file system type.
   8. Type c to create a `W95 FAT32 (LBA)` partition.
   9. Type a to activate that partition so it automounts.
   10. Type w to write the changes to disk
3. Format again from the terminal:

   ```
   sudo mkfs.vfat /dev/sdXi
   ```

   * Note: `i` represents the partition number in this case it should be `1`
4. Close the terminal.

Source: [askubuntu.com](https://askubuntu.com/a/1064316)
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://windows-rt-devices.gitbook.io/windows/miscellaneous/format-usb-drive.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
