To format an SD card for a Raspberry Pi, you need to erase it and create a FAT32 (or exFAT) partition so the Pi’s bootloader can read it. This guide explains the correct formatting methods for Windows, macOS, and Linux, plus how to avoid common pitfalls like card corruption and boot failures.
Why Formatting Matters
The Raspberry Pi does not have a built-in hard drive; it boots entirely from a microSD card. The Pi’s GPU (VideoCore) contains the first-stage bootloader, which expects the card to have a specific partition layout and file system. If the card is formatted with the wrong file system (e.g., NTFS or ext4 without a boot partition), the Pi will not start. Proper formatting ensures the card is recognized and ready for the operating system image.
What File System Does the Pi Need?
For most Raspberry Pi operating systems (Raspberry Pi OS, Ubuntu, etc.), the SD card is written with a disk image that contains two partitions: a small FAT32 boot partition and a larger ext4 root partition. The FAT32 partition is essential because the Pi’s firmware can only read FAT (or exFAT) from the boot partition. If you are formatting a blank card to later flash an OS image, you do not need to manually create partitions—the imaging tool will do that for you. However, if you want to reuse an old card or fix a corrupted one, formatting it to FAT32 (or exFAT) as a single partition is a good starting point.
How to Format an SD Card on Windows
- Insert the SD card into your computer’s card reader.
- Open File Explorer and note the drive letter assigned to the card (e.g., E:).
- Right-click the drive and select Format.
- In the File System dropdown, choose FAT32 (if the card is 32GB or smaller) or exFAT (if larger than 32GB, as Windows won’t offer FAT32 for large cards).
- Set Allocation Unit Size to Default and check Quick Format.
- Click Start and wait for completion.
If the card is larger than 32GB and you need FAT32 (some older Pi models require it), you can use a third-party tool like Rufus or the Raspberry Pi Imager’s “Format” feature, which can create FAT32 on large cards.
How to Format on macOS
- Insert the card and open Disk Utility (Applications > Utilities).
- Select the card in the sidebar (not just the volume).
- Click Erase.
- Name it (e.g., “BOOT”).
- Choose MS-DOS (FAT) for FAT32, or ExFAT for larger cards.
- Click Erase.
Note: macOS may not show the “MS-DOS (FAT)” option for cards over 32GB. In that case, use exFAT or use the Raspberry Pi Imager to format.
How to Format on Linux
On Linux, you can use the fdisk or parted command-line tools, or a GUI like GParted. Here’s a simple method using fdisk:
- Insert the card and find its device name with
lsblk(e.g., /dev/sdb). - Unmount any mounted partitions:
sudo umount /dev/sdb* - Run
sudo fdisk /dev/sdb. - Type
oto create a new partition table, thennto create a new partition (accept defaults). - Type
tto change partition type, thencfor FAT32 (or7for exFAT). - Type
wto write changes. - Format the partition:
sudo mkfs.vfat -F 32 /dev/sdb1(orsudo mkfs.exfat /dev/sdb1for exFAT).
Common Mistakes and How to Avoid Them
- Formatting the wrong drive: Always double-check the drive letter/name to avoid erasing your main hard drive.
- Using NTFS: The Pi cannot boot from NTFS. Stick to FAT32 or exFAT.
- Not using the official imager: For a fresh OS install, you don’t need to format manually. Use the Raspberry Pi Imager, which formats and writes the image correctly.
- Quick format vs. full format: Quick format is fine for most cases, but if the card is corrupted, a full format (unchecking Quick Format) may help.
- Card size limits: Older Pi models (Pi 1, Pi 2) may have trouble with cards larger than 32GB. Check your model’s documentation.
When to Format vs. When to Reflash
If you are simply reusing an SD card for a new project, formatting to FAT32 is sufficient before writing a new image. However, if the card is corrupted or has been used with a different OS, it’s safer to use the Raspberry Pi Imager’s “Erase” feature (which formats to FAT32) or a full format. If you want to repartition the card to have more storage space for data (not booting), you can format it as ext4 or exFAT, but then it won’t be bootable.
Frequently Asked Questions
Do I need to format a new SD card before using it with Raspberry Pi?
No. If you use the Raspberry Pi Imager, it will overwrite the card completely, including any existing partitions. Formatting first is only necessary if you want to erase the card or fix a corrupted one.
Why does my Pi not boot after formatting?
Formatting alone does not make a card bootable. You must write an operating system image to the card. The Pi cannot boot from an empty FAT32 partition. Use Raspberry Pi Imager to write the OS.
Can I use exFAT instead of FAT32?
Yes, for the boot partition, the Pi supports exFAT on most recent firmware versions. However, FAT32 is more universally compatible, especially with older Pi models. If you are using a card larger than 32GB, exFAT is a practical choice.
Why does Windows not offer FAT32 for my 64GB card?
Windows only offers FAT32 for drives up to 32GB. For larger cards, use exFAT or a third-party tool like Rufus. The Raspberry Pi Imager can also format large cards to FAT32.
How do I completely erase an SD card to sell or reuse?
Use the Raspberry Pi Imager’s “Erase” option, which formats the card to FAT32. For more thorough erasure, you can use a tool like SD Card Formatter (official from the SD Association) or do a full format in your OS.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Mac Start Up Automatically After Power Failure?
- Expose Self-Hosted Service Securely Without Cloudflare Tunnel
- Nano Delivery for Functional Foods: What It Can and Can’t Do4.00
- Disable Apple Watch Turn-by-Turn Vibration While Driving
- Convert Play FLAC in iTunes: Full Guide
- Soda Foundation Charter: What It Means