Format a Linux USB or SD Card Using Windows

1 minute read

You may have noticed that if you connect a disk with Linux partitions to your Windows box, that you cannot view all of the files or the size of the drive seems to be reported incorrectly. Here is a super quick way to format a Linux USB drive or SD card on a Windows PC using Diskpart so that it can be repurposed.

Start by launching a command prompt or Powershell session, then run the command diskpart. This will open the Diskpart command line application in a new window.

From here, start by using list disk to show all of the disks connected to the PC. Now determine which of these is your Linux disk. You can usually identify it based on the sizes listed. You will want to be 100% sure of your selection here because the following commands will wipe ALL DATA from whichever disk you select.

diskpart

Select the disk by using the command select disk X where X is the number of your disk from the previous command.

Once you have selected your disk, use clean to remove all existing partitions. Create a new partition with create partition primary and then mark it as active.

Finally, we can format the disk with format fs=Fat32 quick. Now your USB drive or SD card is ready to be used again.

For quick reference, here are all of the commands in order:

diskpart
list disk
select disk X
clean
create partition primary
active
format fs=Fat32 quick

Note: If your disk is larger than 32gb you can format it using fs=exFat instead of Fat32 to support larger capacities.

Leave a comment