> For the complete documentation index, see [llms.txt](https://windows-rt-devices.gitbook.io/windows/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://windows-rt-devices.gitbook.io/windows/miscellaneous/format-usb-drive.md).

# 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 %}
