How to format an SD card to FAT32 from the command line
Format a microSD card as FAT32 with diskpart, mkfs.vfat or diskutil, then copy firmware assets to the card root safely.
Intermediate · about 5 min · Linux, Windows, macOS
Embedded firmware, display projects and handheld devices almost always want a FAT32 card with files at the root. Windows refuses to offer FAT32 for cards above 32 GB in the GUI, so the command line is the shortest path — and the only one that tells you exactly which disk you are about to erase.
What this guide covers
- Identify the card — do this first
- Linux: unmount before formatting
- Linux: create the FAT32 filesystem
- Windows: pick the disk in diskpart
- Windows: single-command alternative
- macOS: format with diskutil
- Unzip assets to the card root
- Flush writes before pulling the card
Common pitfalls covered
- Formatting /dev/sdb instead of /dev/sdb1 destroys the partition table — check the trailing number.
- Windows Explorer hides the FAT32 option for cards over 32 GB; diskpart still does it.
- exFAT looks similar but most microcontroller SD libraries cannot read it.
- Unzipping into a subfolder is the usual reason firmware reports 'no database found'.
- Removing the card without sync or Safely Remove leaves truncated files.
Questions answered
- Can I format a 64 GB card as FAT32?
- FAT32 or exFAT for embedded projects?
- How do I know which disk is my SD card?
This is a limited preview. The full walkthrough, command syntax and copy-ready examples are available to signed-in users.