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
- 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].
- 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].
- 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.
- 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.
- 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-updateshows the date [7]. A new, unformatted drive does not show up in the file manager or insudo blkiduntil you partition and format it, for example with the erase option in Raspberry Pi Imager.ls -l /dev/nvme*should list/dev/nvme0and/dev/nvme0n1[7]. Always disconnect the power before you touch the M.2 slot [7]. An adapter that is not HAT+-compliant needsdtparam=pciex1in/boot/firmware/config.txt(aliasdtparam=nvme) and, for booting,PCIE_PROBE=1in the bootloader configuration [8][10]. - 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=3inconfig.txtor 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. - 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). TheBOOT_ORDERvalue is read from right to left, with 1 for SD, 4 for USB mass storage, 6 for NVMe and f for "restart the loop". SoBOOT_ORDER=0xf416means NVMe, then SD, then USB, then start over [8][10]. - 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_enableshows whether the higher limit is active [13]. The settingsusb_max_current_enable=1andPSU_MAX_CURRENT=5000lift 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. - 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 read | Sequential write | Random 4 kB read | Random 4 kB write |
|---|---|---|---|---|
| Raspberry Pi microSD 32 GB, run 1 | 93,180 | 40,226 | 16,133 | 6,104 |
| Raspberry Pi microSD 32 GB, run 2 | 91,769 | 72,909 | 26,655 | 15,862 |
| SanDisk A1 microSD 32 GB | 89,501 | 20,146 | 12,051 | 2,439 |
| Raspberry Pi SSD 256 GB, PCIe Gen 2 | 440,835 | 390,976 | 58,477 | 165,305 |
| Raspberry Pi SSD 256 GB, PCIe Gen 3 | 861,605 | 739,594 | 62,231 | 209,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
| Situation | Storage that fits | Watch out for |
|---|---|---|
| First start, learning, a Pi-hole or a sensor logger with little data | microSD, class A2 from a known brand | Clean shutdowns, a backup of the card, fewer writes [5] |
| A small server that runs for years but needs no extra board | USB SSD | 5 A supply, UAS-capable adapter, boot test before you rely on it [12][14] |
| Many small writes: database, containers, file share | NVMe 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 USB | Powered USB hub | Disks 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_enableto 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-updateshows 6 December 2023 or later [7]. - Format a new NVMe drive, then confirm
/dev/nvme0and/dev/nvme0n1exist [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.