Skip to content
Bytearium

No ads or affiliate links active

Homelab & storage

Raspberry Pi 5 storage: SD, USB SSD or NVMe

microSD (A2), USB SSD or NVMe on the M.2 HAT+: how they differ in wear, speed, boot setup and power needs, and which fits your Pi 5.

A Raspberry Pi 5 will boot from almost anything that holds an operating system. What you give it decides whether it behaves like a gadget or like a small server.

The short answer

Start with a good microSD card of class A2 when the Pi runs light jobs, you shut it down cleanly and you keep a backup [1][5]. Move to a USB SSD when you want the simplest upgrade without extra boards, as long as your power supply can deliver 5 A [13][14]. Choose an NVMe SSD on the M.2 HAT+ when the Pi writes a lot, for example as a database, container or file-share host [7][15]. Our assessment: for a Pi that should run for years, an SSD of either kind is the safer default, and speed is the smaller benefit. Raspberry Pi's own whitepaper says that SD cards are "susceptible to failure over time, depending on how they are being used" [5].

How it works

  1. What the board offers. The Pi 5 has a microSD slot with the high-speed SDR104 mode, two USB 3.0 ports that support simultaneous 5 Gbit/s operation, and a single-lane PCIe 2.0 interface for fast peripherals. The last one needs a separate adapter such as an M.2 HAT [16]. Those are your three storage routes. The firmware tries boot sources in an order you can change, and with an SD card inserted the Pi 5 tries the card first [7].
  2. microSD: what A1 and A2 promise. The SD Association defines Application Performance Classes that describe random access, which is what an operating system mostly does. A1 came with the SD 5.1 specification. A2 came with SD 6.0 and relies on command queuing and a cache. A2 speed is only available when both the card and the host support A2 [4]. Raspberry Pi has tested against the A1 level: at least 10 MB/s sequential write, 500 random writes and 1,500 random reads per second [3]. Its own official cards are A2 and are specified at 5,000 random read and 2,000 random write operations per second (4 kB blocks) on a Pi 5 [1][2]. Those figures belong to those cards on that board. We found no source that guarantees the same numbers for other brands, so read "A2" as the label to look for, not as a promise. Raspberry Pi also notes that write speed on an SD card drops as the card fills up [3].
  3. microSD: how long it lasts. Flash memory survives a limited number of write cycles. Most cards use wear levelling to spread the load, and they can still fail, "from months to years" depending on how much data is written or erased. The typical sign is random file corruption [5]. The same whitepaper points out that Linux keeps writing logs in the background even if your application writes nothing, and that a power cut during a write can corrupt data [5]. Its countermeasures: buy a well-known brand, reduce writes, run the root file system read-only (raspi-config has an overlay option), protect the boot partition, keep data off the device and use a UPS [5]. "High endurance" cards exist. Kingston's datasheet for its High-Endurance microSD names 3K program/erase cycles and 26.9K hours of 24/7 recording for the three-year warranty, with A1 as its application class [6]. Those hours describe continuous video recording, which is mostly sequential writing. Our assessment: such a card helps in logging-like workloads, but a dash-cam datasheet does not tell you how it behaves under many small random writes.
  4. USB SSD: the no-extra-board route. The Pi supports USB mass storage boot when you put USB (boot mode 4) in the boot order [10][12]. Two traps come from the documentation. USB-to-SATA adapters can work in the bootloader but fail if Linux selects UAS mode, so boot from SD first and check that the drive works under Linux. Spinning disks typically need a powered USB hub [12]. For a measurement we only have a user report: a Raspberry Pi forum member tested one NVMe SSD in an unbranded USB 3 bridge (RTL9210 chip) and on a PCIe base board with a Pi 5 8 GB. Via USB the drive read 359 MB/s and wrote 254 MB/s (hdparm and dd) and managed about 29,000 random 4 kB reads per second (fio). On PCIe Gen 2 it read 417 MB/s, wrote 261 MB/s and managed about 106,000 random reads per second. On Gen 3 it read 784 MB/s, wrote 377 MB/s and managed about 151,000 [18]. One person, one drive, no way to verify; it shows the order of magnitude, not a rule.
  5. NVMe on the M.2 HAT+. NVMe is a protocol for flash storage over PCIe; our NVMe glossary entry explains the details. The M.2 HAT+ converts the Pi's PCIe connector to one M.2 M-key slot. The standard board takes drives in the 2230 or 2242 format, the Compact variant only 2230. The documentation lists a single-lane PCIe 2.0 interface with 500 MB/s peak transfer rate and up to 3 A supply for the M.2 device. Raspberry Pi OS recognises the HAT+ automatically [7]. Your firmware must be from 6 December 2023 or later; sudo rpi-eeprom-update shows the date [7]. A new, unformatted drive does not show up in the file manager or in sudo blkid until you partition and format it, for example with the erase option in Raspberry Pi Imager. ls -l /dev/nvme* should list /dev/nvme0 and /dev/nvme0n1 [7]. Always disconnect the power before you touch the M.2 slot [7]. An adapter that is not HAT+-compliant needs dtparam=pciex1 in /boot/firmware/config.txt (alias dtparam=nvme) and, for booting, PCIE_PROBE=1 in the bootloader configuration [8][10].
  6. PCIe Gen 2 or Gen 3. By default the Pi 5 runs the connector at Gen 2.0 speed (5 GT/s). You can raise it to Gen 3.0 (8 GT/s) with dtparam=pciex1_gen=3 in config.txt or in raspi-config under Advanced Options, PCIe Speed. Raspberry Pi warns that the Pi 5 is not certified for Gen 3.0 and that such connections might be unstable [7][8]. Raspberry Pi's own SSDs are Gen 3-compliant, use the M.2 2230 format and are specified at 40,000 to 90,000 random read operations per second depending on capacity [15]. Measurements by one reviewer (see below) show roughly double the sequential speed on Gen 3 and a smaller gain for small random writes. Our assessment: stay on Gen 2 unless you move large files all day. If you switch, run your real workload for a while and watch the kernel log (sudo dmesg) for PCIe or NVMe errors before you trust it.
  7. Booting from NVMe. Write the operating system to the NVMe drive with Raspberry Pi Imager. If the Pi already runs from an SD card, start Imager on the Pi and choose the NVMe drive as target. With no SD card inserted, the Pi 5 boots from NVMe by itself; with a card inserted it tries the card first [7]. To change that, open sudo raspi-config, go to Advanced Options, Boot Order and choose NVMe/USB Boot. That option tries NVMe first, then USB, then the SD card [7][11]. The same effect is available in the bootloader configuration (sudo rpi-eeprom-config --edit). The BOOT_ORDER value is read from right to left, with 1 for SD, 4 for USB mass storage, 6 for NVMe and f for "restart the loop". So BOOT_ORDER=0xf416 means NVMe, then SD, then USB, then start over [8][10].
  8. Power supply. Raspberry Pi recommends its 27 W USB-C supply for the Pi 5 [13]. Its USB power delivery whitepaper explains the consequence of anything less. Without a 5 V / 5 A mode the Pi limits the USB ports to 600 mA instead of 1.6 A, shows a warning on the desktop, and disables USB boot unless you deliberately press the power button. The whitepaper adds that high-current devices such as SSDs and hard drives may then fail to operate correctly, while the Pi itself runs fine on a 3 A supply with light peripherals [14]. vcgencmd get_config usb_max_current_enable shows whether the higher limit is active [13]. The settings usb_max_current_enable=1 and PSU_MAX_CURRENT=5000 lift the limit and re-enable USB boot, and the documentation intends them for supplies that really deliver 5 A without USB PD [14]. Do not set them to silence a warning on a weaker supply. As far as we can tell from the documentation, an NVMe drive on the M.2 HAT+ does not use the USB budget, but it still draws its power from the same board supply.
  9. What measurements show. The best table we found is from a CNX Software review of 19 November 2024. It ran iozone3 on one Pi 5 with several devices [17]. Figures in KB/s as printed there:
Device (Pi 5)Sequential readSequential writeRandom 4 kB readRandom 4 kB write
Raspberry Pi microSD 32 GB, run 193,18040,22616,1336,104
Raspberry Pi microSD 32 GB, run 291,76972,90926,65515,862
SanDisk A1 microSD 32 GB89,50120,14612,0512,439
Raspberry Pi SSD 256 GB, PCIe Gen 2440,835390,97658,477165,305
Raspberry Pi SSD 256 GB, PCIe Gen 3861,605739,59462,231209,284

Read the table with care. The two microSD rows are the same card model in two runs, and the review does not explain the difference in the excerpt we read. Sequential reads sit near the interface limit: about 440 MB/s on Gen 2 and about 860 MB/s on Gen 3. The most telling column is random write. The SSD is roughly 10 to 27 times faster than the Raspberry Pi card and about 68 times faster than the A1 card (our calculation from the table). That gap is what you feel with databases, package updates and containers. The reviewer also writes that a larger boot-time gap between microSD and NVMe had been expected than was measured [17]. It is one tester, one board and one day, and it contains no endurance data.

When what fits

SituationStorage that fitsWatch out for
First start, learning, a Pi-hole or a sensor logger with little datamicroSD, class A2 from a known brandClean shutdowns, a backup of the card, fewer writes [5]
A small server that runs for years but needs no extra boardUSB SSD5 A supply, UAS-capable adapter, boot test before you rely on it [12][14]
Many small writes: database, containers, file shareNVMe on the M.2 HAT+Firmware date, boot order, a 2230 or 2242 drive, Gen 3 only after testing [7][8]
A spinning hard disk over USBPowered USB hubDisks need their own power [12]

A worked example (commands, not a test)

This is a plan for your own Pi, not a report on our systems. Assume a Pi 5 that runs from an SD card, the official 27 W supply and an M.2 HAT+ with a 2230 NVMe drive. Update the system and the bootloader first: sudo apt update && sudo apt full-upgrade, then sudo rpi-eeprom-update and check the date [7]. Power the Pi down, fit the HAT+ and the drive, and start again. Check the drive with ls -l /dev/nvme* [7]. Start Raspberry Pi Imager on the Pi, choose Raspberry Pi OS and the NVMe drive as target, and write it [7]. Then open sudo raspi-config, choose Advanced Options, Boot Order, NVMe/USB Boot, and reboot with the SD card removed [7]. Check with lsblk that /boot/firmware and / now sit on nvme0n1p1 and nvme0n1p2 [9]. Keep the old card as a rescue medium. Leave PCIe at Gen 2 for the first weeks. If you test Gen 3 later, add dtparam=pciex1_gen=3, reboot, copy a large amount of data and read sudo dmesg afterwards [8].

Checklist

  • Decide which of the three routes matches your workload before you buy anything: light and read-mostly, long-running, or write-heavy.
  • Look for an A2 card from a known brand if you stay on microSD, and keep a current backup of it.
  • Reduce writes on a microSD system: consider the read-only overlay in raspi-config, and shut down with the shutdown option, never by pulling the plug [5].
  • Check that your power supply offers 5 V / 5 A before you attach a USB SSD, and run vcgencmd get_config usb_max_current_enable to see the limit in use [13][14].
  • Boot from SD once and confirm that your USB-SATA adapter works under Linux before you move the system onto it [12].
  • Update the OS and the bootloader before you install the M.2 HAT+, and make sure sudo rpi-eeprom-update shows 6 December 2023 or later [7].
  • Format a new NVMe drive, then confirm /dev/nvme0 and /dev/nvme0n1 exist [7].
  • Set the boot order deliberately and test a boot without the SD card [7][11].
  • Keep PCIe at Gen 2 unless sequential speed matters, and treat Gen 3 as an experiment you can undo [7][8].
  • Test a restore from your backup on a second card or drive, whichever storage you choose.

Primary sources

These sources are the basis of this page. That does not mean every claim was checked individually; whether a review record exists is shown above under “Status”. The interpretation and checklist are our own work.

There is no documented review record for this version yet. The text relies on the sources listed.

How this page was made: Bytearium creates these pages with the help of AI and is responsible for publishing them. AI can be wrong, so we show our sources and review status openly.

  1. Raspberry Pi LtdSD Cards
  2. Raspberry Pi LtdRaspberry Pi SD Cards
  3. Raspberry Pi LtdRaspberry Pi SD Card Speed Test
  4. SD AssociationApplication Performance Class
  5. Raspberry Pi LtdMaking a more resilient file system
  6. Kingston TechnologyHigh-Endurance microSD Memory Card for Security, Body and Dash Cams
  7. Raspberry Pi LtdM.2 HAT+
  8. Raspberry Pi LtdPCIe on Raspberry Pi
  9. Raspberry Pi LtdNVMe SSD boot
  10. Raspberry Pi LtdRaspberry Pi bootloader configuration
  11. Raspberry Pi LtdFirmware, change the boot order
  12. Raspberry Pi LtdUSB mass storage boot
  13. Raspberry Pi LtdPower supply
  14. Raspberry Pi LtdUSB Power Delivery on Raspberry Pi 5
  15. Raspberry Pi LtdSSDs
  16. Raspberry Pi LtdRaspberry Pi 5
  17. Jean-Luc Aufranc, CNX SoftwareRaspberry Pi SSD Kit and Class A2 microSD cards review with Raspberry Pi 5
  18. Raspberry Pi ForumsRaspberry Pi Forums: Forum thread on an NVMe SSD in a USB 3 enclosure versus an NVMe adapter on the Pi 5 (user-reported

This page has no ads and no affiliate links.