Apps / Pi SD Manager / Guide
Guide — Raspberry Pi
How to back up a Raspberry Pi SD card on a Mac
Every Raspberry Pi lives one corrupted card away from a rebuild. Here is every honest way to image a Pi's SD card from macOS — the free Terminal route, the tools that don't quite do it, and the app we built because none of it was good enough.
01 /Why bother
Your Pi is one bad card away from starting over.
The SD card is the weakest component in any Raspberry Pi. Flash memory survives a finite number of writes, and a Pi writes all the time — system logs, temporary files, whatever your project is doing. Cut the power mid-write, which happens to every Pi that lives behind a switch or a plug timer, and the filesystem can corrupt long before the card physically wears out.
The part that stings is that the card is the machine. The OS, your configuration, your scripts, that Wi-Fi fix you found at midnight two years ago — all of it lives on one small piece of flash. When it dies, you rebuild from memory.
This guide is for anyone with a working Pi they'd rather not rebuild: a home server, a retro-gaming build, a camera, or — as in our case — Pis quietly running inside installations and show kit. The goal is simple: a known-good image on your Mac that you can write to a fresh card in minutes.
02 /The Terminal route
Method 1 — dd and gzip, free and built in.
macOS already ships everything you need to clone an SD card: diskutil to find and unmount it, dd to copy it sector by sector, and gzip to compress the result on the way through. It costs nothing, it's scriptable — and it is completely unforgiving. Here's the whole job:
| Step | Command | What it does |
|---|---|---|
| 1 | diskutil list | Find the card. Look for an external, physical disk matching the card's size — usually a small FAT32 boot partition plus a Linux partition. Note the identifier; we'll use /dev/disk4 below. |
| 2 | diskutil unmountDisk /dev/disk4 | Unmount the card's volumes without ejecting it, so the raw device stays available. |
| 3 | sudo dd if=/dev/rdisk4 bs=1m | gzip > ~/pi-backup.img.gz | Read the entire card and compress it into one file. Note rdisk4, not disk4 — the raw device is dramatically faster. |
| 4 | Ctrl+T | dd prints nothing while it works. Press Ctrl+T in Terminal to make it report how far it has got. |
| 5 | gunzip -c ~/pi-backup.img.gz | sudo dd of=/dev/rdisk4 bs=1m | Restore: unmount the target card as in step 2, then write the image back. |
The caveats are real. First, the disk number. dd does exactly what you tell it, instantly, with no confirmation — point of= at the wrong disk and it will overwrite your backup drive without a murmur, and there is no undo. Run diskutil list with the card out, again with it in, and be certain which number appeared before you type sudo.
It images the whole card, not your data. dd has no idea what a filesystem is, so a 64 GB card means reading 64 GB — the time scales with the card's size, not with how full it is, and the image only compresses as well as the free space allows.
Restores need a card at least as big as the original — and thanks to manufacturing tolerances, "the same size" often isn't (see the FAQ).
And nothing is verified. You find out whether the image was good the day you try to boot from it.
03 /Raspberry Pi Imager
Method 2 — Raspberry Pi Imager: great at writing, no backup.
Raspberry Pi Imager is the official tool, it's free, and at its actual job — writing OS images to cards — it's excellent: pick an OS, pick a card, preconfigure Wi-Fi, SSH and your user before first boot. If you're setting up a fresh card, use it.
What it doesn't have is a backup function. There is no card-to-image option; it only writes. The realistic pairing is dd to create the image and Imager's "Use custom" option to write it back later — which works, but leaves you with all of dd's caveats at the moment that actually matters.
It's worth saying that the Mac answer to this used to be ApplePi-Baker, which did read cards to images — but it hasn't seen updates in years, which is a large part of why this guide exists.
04 /The shrinking problem
Shrinking images: PiShrink is brilliant — on Linux.
The standard fix for card-sized dd images is PiShrink, a shell script that trims an .img down to just above its used space and sets the filesystem to expand again on next boot. On Linux it's the classic companion to dd.
On a Mac it's a genuine pain. PiShrink depends on Linux tooling — parted, e2fsck, resize2fs, loop devices — none of which macOS has, so you need a Linux machine, a VM, or a privileged Docker container to run it. And because it modifies the image in place, you'll want to work on a copy, which means doubling up multi-gigabyte files while you're at it.
The underlying issue is that macOS can't read ext4, the Linux filesystem the Pi actually lives on. Your Mac can see the little boot partition and nothing else — which is why most Mac-native approaches stop at dumb, full-card copies.
05 /Pi SD Manager
Method 3 — Pi SD Manager: built for exactly this.
We run Raspberry Pis inside installations and show kit, and we got tired of every one of the workarounds above. Pi SD Manager is our free, native Mac app that does the whole job properly, with the ext4 tools built in — nothing else to install, no Homebrew, no Terminal.
Compact backups. It images only the space actually in use and shrinks the filesystem as it goes, so a mostly-empty 32 GB card becomes a file of a couple of gigabytes — and because the filesystem is genuinely smaller, that backup restores onto a smaller card, as long as the data fits. Each backup is a single, dated .pisd file.
Verified restores. After writing a card it reads the data straight back off it and checks it landed correctly — so a bad card or a bad write shows up at your desk, not on site when the Pi won't boot. Restore onto a bigger card and the root filesystem auto-expands to fill it on first boot.
Safe by design. The app can't see your Mac's system disk at all, so the dd nightmare — wiping the wrong drive — simply isn't possible. It asks for your password only when it's actually imaging, and ejects the card when it's done. It'll even reset a forgotten Pi login password directly on the card.
It's free, signed and notarised, 1.6 MB, and needs macOS 14 or later. If you use Homebrew: brew install --cask halfgreybear/tap/pi-sd-manager.
06 /Which should you use
Which should you use?
| Route | Cost | Backup size | Restore to smaller card | Verified restore |
|---|---|---|---|---|
| dd + gzip | Free | Full card, compressed | No | No |
| dd + PiShrink | Free | Trimmed to used space | Yes, if the data fits | No |
| Raspberry Pi Imager | Free | No backup function | — | — |
| Pi SD Manager | Free | Used space only | Yes, if the data fits | Yes, every restore |
If you're comfortable in Terminal, only need the odd one-off image and have spare cards the same size or bigger, dd costs nothing — triple-check the disk number and accept the full-size images. If you already keep a Linux box around, dd plus PiShrink is the classic pipeline. For writing downloaded OS images to fresh cards, Raspberry Pi Imager remains exactly the right tool.
If you're on a Mac and you want backups you'll actually take — compact, verified, restorable onto whatever card is in the drawer — that's the gap Pi SD Manager was built to fill.
07 /FAQ
Frequently asked questions
Can I restore a Raspberry Pi image onto a smaller SD card?
dd. A dd image is exactly the size of the source card, and it will only restore onto a card at least that big. Worse, two cards both sold as 32 GB often differ by a few hundred megabytes, so a dd image of one 32 GB card will regularly refuse to fit another. Pi SD Manager's compact backups shrink the filesystem as they image, so a backup restores onto any card the actual data fits on — including a genuinely smaller one.Why is my backup image as big as the whole card?
dd copies every sector, free space included — a 64 GB card produces a 64 GB image whether it holds 2 GB or 60 GB of data. Compressing with gzip claws some of that back, but the real fix is a tool that understands the filesystem and skips the empty space: PiShrink on Linux, or Pi SD Manager on a Mac, which images only the used space in the first place.Can I back up the SD card while the Pi is running?
sudo shutdown -h now, wait for it to power off, then pull the card and image it.How often should I back up a Pi's SD card?
Do SD cards really wear out?
08 /Get the app
Back your Pi up today, not the day after it dies.
Pi SD Manager is free, and the first backup takes a couple of clicks: open the app, choose your card, go. Everything else — the compacting, the verification, the auto-expand — it handles for you. There's more detail on the Pi SD Manager page.
Free · notarised & signed · checks for updates in-app.
Pis in your show rig? You might also want our guides to test patterns for projectors and LED walls and running a stage timer on a Mac.