A Raspberry Pi that boots fine for months can suddenly hang on a rainbow screen or drop you into a login it refuses to accept, usually right after the power got cut mid-write. That is a corrupted Raspberry Pi SD card, and chasing a repair tool is often slower than the fix that actually works. In most cases the practical answer is to re-flash, then stop it happening again by moving the boot off the card entirely.

Quick Answer

The reliable fix for a corrupted Pi SD card is to re-flash it with Raspberry Pi Imager, because power-loss corruption usually breaks the filesystem beyond what a repair pass can dependably mend. To stop it recurring, migrate the boot to an NVMe SSD using the M.2 HAT+ on a Pi 5.

Why repair usually fails and re-flashing wins

When a Pi loses power mid-write, the filesystem can be left half-updated. A repair pass can sometimes recover a lightly damaged card, but power-loss damage frequently corrupts the boot files and the filesystem structure together, leaving the card unable to start. At that point you are spending an hour coaxing a repair that may not hold, when a clean re-flash takes ten minutes and gives you a known-good system.

Before writing it off, try the card in another machine to copy off any files you still need. If the data is reachable, grab it first. If the card will not mount at all, the corruption has gone deep enough that re-flashing is the route back to a working Pi.

The re-flash, step by step

Download Raspberry Pi Imager from the official Raspberry Pi site onto a working computer. Insert the suspect card with a reader, choose your Pi model and the OS image, select the card as the target, and let it write and verify. Imager wipes the card and lays down a clean image, which clears the corruption along with everything else on it, so only do this once you have recovered any files you wanted.

If the card refuses to take a fresh image or throws verify errors, the card itself may be failing rather than just corrupted. Cheap or worn cards develop bad sectors, and a card that keeps corrupting is telling you to replace it. The boards and accessory kits that pair with these projects sit in the mini PC and single-board range, which is the place to grab a reliable replacement card or a fresh board.

Prevention: get the boot off the SD card

SD cards are the weak link because they handle write cycles and sudden power cuts poorly. On a Raspberry Pi 5, the cleanest prevention is to boot from an NVMe SSD fitted through the official M.2 HAT+. An SSD shrugs off the power-loss writes that wreck SD cards, and it is dramatically faster for everyday use.

The migration is straightforward: update the bootloader so it supports NVMe, set the boot order to include the NVMe option, boot from the SD card once, then use the built-in copier to clone the system onto the SSD. After that the Pi boots from the drive and the SD slot becomes a backup rather than a single point of failure. The boards and drives that suit always-on Pi projects often appear among the popular PC picks, worth checking when you plan the upgrade.

Frequently Asked Questions

Can I recover files from a corrupted Pi SD card?

Sometimes. Put the card in another computer with a reader and try to copy what you need before re-flashing. If it will not mount at all, the corruption is severe and the card likely needs replacing.

Why does my SD card keep corrupting?

Usually sudden power loss during a write, but a cheap or worn card with bad sectors will corrupt repeatedly. If a fresh re-flash corrupts again quickly, replace the card rather than re-imaging it endlessly.

Is NVMe boot really more reliable than an SD card?

Yes. An SSD handles write cycles and unexpected power cuts far better than an SD card, and it is much faster. On a Pi 5 with the M.2 HAT+ it is the recommended fix for recurring corruption.

Do I always need to re-flash, or can I just repair?

A repair pass is worth a quick attempt, but power-loss corruption often damages the boot files and filesystem together, so re-flashing is the dependable route. It takes about ten minutes once you have saved any needed files.

Tired of re-imaging the same card? Move the boot to a faster, sturdier drive and stop the corruption at its source. Browse the boards and storage in the Evetech mini PC range to set up an SD-free Raspberry Pi.