keepcalculator

06 Numbers and Powers

Raspberry Pi Storage: SD Cards, SSDs & More

Card No. 06·17270 · Updated · Standard formula, shown below

Raspberry Pi storage means the SD card or SSD that holds the operating system and your files, and the right choice depends on which Pi model you have and what you use it for. You can boot and run a Pi from a microSD card, a USB SSD, or a USB flash drive, and each option has different speed, reliability, and cost trade-offs. This article explains the storage options, how to choose, and how to avoid common pitfalls.

Why Storage Matters on a Raspberry Pi

The Raspberry Pi has no built-in hard drive or SSD. Storage is provided by removable media, most commonly a microSD card. The card holds the operating system (usually Raspberry Pi OS), applications, and user data. Because the Pi reads and writes constantly to the storage during normal operation, the speed and quality of the card directly affect boot time, application loading, and overall responsiveness. A slow or failing card can cause crashes, corruption, and data loss.

Storage Options Overview

  • microSD card: The default for all models. Cheap, small, and easy to swap. Speeds vary widely; a high-end card can read at over 90 MB/s, while a cheap one might manage only 10–20 MB/s.
  • USB flash drive: Can be used for additional storage or as a boot device on Pi 4, Pi 5, and Pi 3B+. Slower than a good SSD but faster than a low-end SD card.
  • USB SSD (SATA or NVMe): The fastest and most reliable option for Pi 4 and Pi 5. Requires a USB-to-SATA or USB-to-NVMe adapter (or the Pi 5’s dedicated NVMe hat). Boot times can drop to under 15 seconds, and sustained writes are much faster.
  • Network storage (NAS, NFS, Samba): Not bootable, but excellent for large media libraries. The Pi accesses files over Ethernet or Wi-Fi.

How to Choose the Right Storage

Consider three factors: capacity, speed, and endurance.

  • Capacity: A 16 GB card is enough for a basic headless setup. For a desktop with a browser and office suite, 32 GB is comfortable. If you store media or run a home server, 64 GB or more is wise. The Pi’s OS uses about 4–8 GB, so 8 GB is the absolute minimum, but not recommended.
  • Speed class: Look for the A1 or A2 rating (Application Performance Class) and a U3 or V30 speed class. A2 cards have higher random read/write IOPS, which matter more than sequential speed for small files. Avoid cards labeled only as “Class 4” or “Class 10” without A1/A2; they may be too slow for a responsive system.
  • Endurance: Standard SD cards are not designed for constant writes. For 24/7 use (e.g., a home server, Pi-hole, or logging), use a high-endurance card or switch to an SSD. High-endurance cards use better flash memory and can last several times longer.

microSD Card Recommendations

While specific brands change, look for cards with the following characteristics:

  • Capacity: 32 GB or 64 GB for most users.
  • Speed class: A2, U3, V30 or higher.
  • From a reputable manufacturer (SanDisk, Samsung, Kingston, etc.) – but always check the card’s actual specs, as some cards from the same brand vary.
  • For continuous operation, choose a “High Endurance” or “Max Endurance” variant.

Beware of counterfeit cards, especially from online marketplaces. They often report more capacity than they actually have and fail within days. Buy from trusted retailers and test a new card immediately with a tool like f3 or h2testw.

Using an SSD for Better Performance

If you want the best performance, an SSD is the way to go. Here’s how to set it up:

  1. Connect the SSD to the Pi via USB (or the Pi 5’s PCIe slot). For Pi 4, use a USB 3.0 port (blue) and a good-quality cable.
  2. Flash the operating system image to the SSD using the Raspberry Pi Imager tool, which now supports USB drives and SSDs as target devices.
  3. Insert the SSD and power the Pi. It should boot from the SSD automatically on Pi 4 and Pi 5. On older models (Pi 3B+), you may need to change the boot order in the firmware settings.

Note that the Pi 4’s USB 3.0 controller is shared with the Ethernet port, so maximum SSD speed is around 300–400 MB/s. The Pi 5’s PCIe port can reach faster speeds, but requires an NVMe baseboard (HAT) and a compatible NVMe drive.

Common Storage Problems and Fixes

  • Corrupted filesystem: If the Pi won’t boot or shows errors, the card may be corrupted. Reflash the OS and back up your data regularly. To reduce corruption, always shut down properly (sudo shutdown now) and avoid unplugging the power.
  • Slow performance: A slow card or a card that’s nearly full can cause lag. Check free space with df -h. Also, the Pi’s firmware may throttle USB storage if the power supply is inadequate – use a good 5V/3A PSU.
  • Card not detected: Try re-seating the card, or use a different card reader. If the card is dead, replace it.
  • Overheating: SSDs can get hot, especially under heavy load. Use a heatsink or fan if needed.

Cost and Reliability Comparison

Prices fluctuate, but here’s a general idea (as of 2025):

  • 16 GB microSD: ~$5
  • 32 GB high-endurance microSD: ~$12
  • 64 GB microSD: ~$10
  • 128 GB SATA SSD + USB adapter: ~$25–30
  • 256 GB NVMe SSD + Pi 5 HAT: ~$40–50

SSDs are more expensive upfront but last much longer under constant writes. A typical SD card might last a few months to a year of 24/7 use, while an SSD can last years. For most desktop or light server use, a good microSD is fine; for heavy database or media server use, an SSD is worth the cost.

Frequently Asked Questions

What is the best SD card for a Raspberry Pi?

The best SD card is one that is A2-rated, U3, and from a reputable brand, with a capacity of at least 32 GB. For 24/7 use, choose a high-endurance version. Avoid cheap no-name cards, which often fail quickly.

Can I boot a Raspberry Pi from a USB SSD?

Yes, the Raspberry Pi 4, Pi 5, and Pi 3B+ support booting from a USB SSD. Use the Raspberry Pi Imager to write the OS to the SSD, then connect it and power on. Older models (Pi 2, Pi 3B) require a special boot code.

How do I check the health of my SD card?

You can use the fsck command to check the filesystem, but for the card’s physical health, tools like f3 (for Linux) or H2testw (for Windows) can test the actual capacity and read/write integrity. Run them before first use and periodically if you suspect issues.

Why does my Raspberry Pi keep corrupting the SD card?

Common causes are improper shutdown (pulling power without sudo shutdown), a low-quality or counterfeit card, insufficient power supply, or excessive writes. Use a high-endurance card, ensure a stable 5V/3A power supply, and always shut down cleanly.

Can I use a USB flash drive instead of an SD card?

Yes, on Pi 4, Pi 5, and Pi 3B+ you can boot from a USB flash drive. It’s faster than a low-end SD card but slower than an SSD. For best results, use a high-quality USB 3.0 flash drive with good random read/write performance.

How much storage do I need for Raspberry Pi OS?

Raspberry Pi OS (with desktop) takes about 4–5 GB. A 16 GB card is the minimum for basic use, but 32 GB is recommended for comfort. If you install many applications or store media, go with 64 GB or more.

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

The whole Numbers and Powers drawer →