Need a reliable backup of your Raspberry Pi SSD? This quick guide shows how to create a reusable .img file from your SSD so you can flash it anytime using Raspberry Pi Imager.
1. Goal
- Create a
pi-os-backup.imgfile (or compressed.img.xz) - Use it to flash onto a new SSD as a ready-to-use OS image
- Preserve your OS and all data
2. Requirements
- macOS or Linux
- SSD connected via USB/SATA
- Enough free space for the image (≥ SSD size)
- Know the correct disk ID (e.g.,
/dev/disk2,/dev/sda)
3. How to create backup file
Step 1: Identify the Raspberry Pi SSD
Plug in the SSD and run:
bash
diskutil list
Find the correct external disk (e.g., /dev/disk2).
Step 2: Unmount the Disk
bash
diskutil unmountDisk /dev/disk2
Step 3: Create the .img File
bash
sudo dd if=/dev/disk2 of=~/Desktop/pi-os-backup.img bs=4m status=progress
You can adjust the bs (Block Size) value to increase speed:
| Purpose | Recommended Value |
|---|---|
| Backing up small SD cards (≤32GB) | bs=4M or bs=8M |
| SSD / USB 3.0 drives | bs=16M or bs=32M |
| High-speed hard drives | bs=64M or higher |
| Cloning large systems on fast machines | bs=128M or bs=256M (optional to try) |
This may take 15 - 45 minutes depending on the SSD size.
Step 4: (Optional) Compress the Image
bash
xz -z ~/Desktop/pi-os-backup.img
Creates a .img.xz file for Raspberry Pi Imager.
3. Flash the Image
Open Raspberry Pi Imager, choose "Use custom image", and select your .img.xz file.
4. Backup Tips
Store your image file in:
- External hard drive
- NAS
- Cloud (Google Drive, Dropbox, etc.)
5. Conclusion
With a few simple steps, you can back up your Raspberry Pi OS SSD and restore it anytime using Raspberry Pi Imager.