In short: Use the official 27 W supply, move the system to an SSD (NVMe on a Pi 5, USB on a Pi 4), and put the board on a UPS if your power is unreliable. OpenClaw's own Pi page says the same about storage: "Use a USB SSD, SD cards are slow and wear out." The read-only overlay file system also stops writes to the card, but it throws away every change at reboot, which rules it out for the agent's own data.
| Cause 1 (Raspberry Pi) | power dropouts can cause storage corruption |
|---|---|
| Cause 2 (Raspberry Pi) | low quality power supplies can corrupt storage |
| Fix for the system | an SSD: M.2 HAT+ on a Pi 5, or USB 3 |
| Fix for the supply | the 27 W USB-C supply (5.1 V, 5.0 A) and a UPS |
| Overlay file system | root read-only, changes in RAM, lost at reboot |
Why the card corrupts
Raspberry Pi's power supply docs say it plainly: "Raspberry Pi devices are frequently used as data storage and monitoring devices, often in places where sudden power-downs can occur. As with any computing device, power dropouts can cause storage corruption." And about supplies: "Low quality power supplies can corrupt storage or cause unpredictable behaviour within the Raspberry Pi."
An agent host makes both more likely to hurt. It is on all day, so it is on when the power cuts. It is writing at almost any moment, so a cut is likely to land in the middle of a write. And SD cards are slow at the small random writes an agent makes: the official Raspberry Pi card, rated A2 with command queueing, is documented at 2,000 random 4 kB writes per second on a Pi 5 and 1,200 on a Pi 4. The official SSDs are documented at 70,000 to 90,000. Slower writes mean more time with data in flight.
Raspberry Pi does not claim that an A2 card prevents corruption; A2 is a performance rating of its card. It does say card quality matters: "SD card quality is a critical factor in determining the overall user experience for a Raspberry Pi."
Check the power first
Before buying storage, rule out the supply. Every Pi since the B+ (except the Zero range) detects a drop below 4.63 V (±5%) and logs it. Run:
vcgencmd get_throttledIf bit 0 (0x1, undervoltage now) or bit 16 (0x10000, undervoltage since boot) is set, the supply or cable is the first thing to change. Raspberry Pi's advice: "If you see warnings, switch to a higher quality power supply and cable." For a Pi 5 it recommends the 27 W USB-C supply (27W supply on Amazon). The full decoding and the 5A message are on the power supply warning page.
Move the system to an SSD
This is the fix that removes the card from the write path. On a Pi 5, the PCIe connector takes an NVMe drive through the M.2 HAT+ (M.2 HAT+ on Amazon), which supports 2230 and 2242 drives such as the Raspberry Pi SSD (Raspberry Pi SSD on Amazon). Booting from it needs a bootloader setting:
sudo rpi-eeprom-config --edit
# then set:
BOOT_ORDER=0xf416The M.2 HAT+ page adds that with no SD card inserted, a Pi 5 "boots automatically from your NVMe drive". If the drive does not appear, the checks in order are on Pi 5 NVMe not detected; the full setup is on NVMe on the Raspberry Pi 5.
On a Pi 4, which has no PCIe connector, a USB 3 SSD (USB 3 SSD on Amazon) is the route; Pi 4 and newer boot from USB by default once USB is in the boot order, although early Pi 4 boards may need a bootloader update first. One catch on a Pi 5: USB boot is disabled by default on a 3A supply, another reason to use a 5A one.
The read-only overlay, and why it rarely suits an agent
Raspberry Pi OS can make the root file system read-only, with a temporary overlay in RAM, and write-protect the boot partition. In sudo raspi-config it is under 4 Performance Options > P2 Overlay File System. With nothing written to the card, a power cut has nothing to corrupt.
The price is stated in the same docs: "any changes will be lost when your Raspberry Pi reboots or powers off." For a kiosk or a sensor logger that is fine. For an agent it means losing its sessions, its memory, its configuration changes and every update. It only works if the agent's data lives on another drive that stays writable, at which point that drive is already the better boot disk. It also puts the writes in RAM, which a small board does not have to spare.
Power cuts: a UPS and a clean shutdown
An SSD makes writes faster; it does not make a power cut safe. Where cuts happen, add a UPS (line-interactive UPS on Amazon) so the board can shut down cleanly; the options, including UPS HATs for the Pi 5, are on the UPS page. If you stay on a card for now, keep it to the system only and take a decent one: Raspberry Pi recommends at least 8 GB for the Lite image and 32 GB for the desktop images, and its own card comes in 32, 64 and 128 GB.
What to buy
- Raspberry Pi 27W USB-C power supply: Raspberry Pi's recommended supply for the Pi 5; rules out the low-quality supply cause.
- Raspberry Pi M.2 HAT+: takes a 2230 or 2242 NVMe drive on the Pi 5's PCIe connector.
- Raspberry Pi SSD, M.2 2230: the system and the agent's data, off the card.
- Line-interactive UPS: rides through short cuts and leaves time to shut down cleanly.
- Raspberry Pi SD card, A2: if you stay on a card: the official one, with command queueing.
Shop links go through /go/ and open Amazon (amazon.fr in the EU and Switzerland, amazon.com elsewhere). As an Amazon Associate we earn from qualifying purchases. Your price does not change and no brand pays for a place on this page (disclosure). We write no price down: it moves, the shop shows today's.
Questions
Why does my Raspberry Pi keep corrupting SD cards?
Does an A2 or high-endurance card stop corruption?
Should I enable the overlay file system on an agent host?
NVMe or USB SSD on a Pi 5?
Is a UPS worth it for a Raspberry Pi?
Sources
- Raspberry Pi documentation source, power supplies, read on 21 November 2026.
- Raspberry Pi documentation source, SD cards, read on 21 November 2026.
- Raspberry Pi documentation source, performance (overlay file system), read on 21 November 2026.
- Raspberry Pi documentation source, PCIe, read on 21 November 2026.
- Raspberry Pi documentation source, boot flow and USB boot on a 3A supply, read on 21 November 2026.
- Raspberry Pi documentation source, getting started (card sizes), read on 21 November 2026.
- Raspberry Pi documentation, M.2 HAT+, read on 21 November 2026.
- Raspberry Pi documentation, SSDs, read on 21 November 2026.
- Raspberry Pi documentation, Raspberry Pi hardware (USB boot), read on 21 November 2026.
- OpenClaw docs, Raspberry Pi, read on 21 November 2026.