robot TL;DR:

To safely clone a Raspberry Pi SD card, use Wondershare UBackit for a Windows-based graphical workflow, the built-in SD Card Copier for directly cloning on Raspberry Pi OS 12, Win32 Disk Imager to generate stored .img backup files, or the dd command for the fastest bit-for-bit duplication on Linux and macOS.
    ● After booting the cloned card, you must rewrite the hostname, update the loopback address in /etc/hosts, and regenerate the SSH host key to prevent mDNS network collisions and SSH warnings if the original device remains online.
    ● The destination microSD card must possess a capacity equal to or greater than the source, and active database services like PostgreSQL or InfluxDB must be temporarily stopped prior to cloning to prevent inconsistent file system writes.
    ● If the original SD card has a corrupted partition table and fails to mount cleanly, standard cloning methods will read partial data, requiring a sector-level scan with Wondershare Recoverit to extract the raw FAT32 boot files and ext4 configurations.


Ask AI for a summary

Quick answer: To clone a Raspberry Pi SD card, pick one of four workflows: Wondershare UBackit on a Windows PC (one-click GUI for non-technical users), Raspberry Pi's built-in SD Card Copier when the Pi itself is accessible (free, no PC needed), Win32 Disk Imager when the cloning happens from a Windows desktop but you want a stored .img file on disk and a free tool, or the dd / rpi-clone command-line workflow on Linux / macOS for power users. Each method produces a working copy, but only UBackit and Win32 write a Windows-native image (.img) you can re-flash later; SD Card Copier and dd clone sector-by-sector to a second card. The post-clone steps below — hostname, /etc/hosts, and SSH host key — apply to all four and are the steps most tutorials skip.

Cloning a Raspberry Pi SD card is the cheapest insurance you can buy for any Pi deployment. The microSD card holds the boot partition, the ext4 root filesystem, your installed packages, the configuration you have spent hours tuning, and the application data you are collecting. After a card corruption, a power loss during apt dist-upgrade, or a "static IP lost" debugging session, bringing the Pi back from a clone is an order of magnitude faster than re-flashing and re-configuring from scratch. Cloning is also the routine upgrade path for users moving from a Raspberry Pi 4 to a Raspberry Pi 5 without losing the working Home Assistant, Pi-hole, Frigate, or MQTT broker setup.

Free Download
Free Download
In This Article
    1. Clone vs. Backup vs. Image: Pick the Right Workflow
    2. Why Pi Cards Fail More Often Than Phones or Cameras
    1. Method 1. Wondershare UBackit (Recommended, Windows)
    2. Method 2. Raspberry Pi's SD Card Copier (Free, On-Pi)
    3. Method 3. Win32 Disk Imager (Free, Windows)
    4. Method 4. dd / rpi-clone (Linux / macOS Command Line)
    1. Hostname, /etc/hosts, and the SSH Host Key
    2. Expanding the Filesystem When the Target Card Is Larger
    1. Sector-Level Recovery When the Source Card Won't Mount
    2. 3-Step Recovery Workflow for the Source Card

Part 1. Why Clone Your Raspberry Pi SD Card

The Raspberry Pi's tiny size, low power draw, and easy GPIO access have made it the standard platform for home automation, retro game emulation, network-attached storage, kiosk signage, and edge-AI projects. None of those characteristics protect the card. The Pi's lack of on-board storage means the microSD card holds the entire operating system, the persistent configuration, and the user data; lose the card and you lose the deployment.

Clone vs. Backup vs. Image: Pick the Right Workflow

The word "clone" gets used four ways in the Pi ecosystem. Sector clone pulls every byte of the source card, including unallocated space, into a destination card that boots identically. Image backup pulls the same byte stream into a file you save on a hard drive (.img on Windows, .iso on macOS, .dd on Linux). Live filesystem clone copies only the live files (with rsync or cp -a) to a destination card, leaving behind swap, logs, and unallocated space; this needs the Pi to be running and the source partitions unmounted or frozen. Selective backup exports a tarball or rsync snapshot of /home and key configs for off-Pi storage.

Format Output Restores to Best when
Sector clone Bootable second card immediately A second card today You want a hot spare on the shelf
Image backup .img / .iso / .dd file Any card later via flashing tool You want a file on a NAS or PC
Live filesystem clone Bootable second card (smaller) A second card Source sectors are healthy; you want a faster, smaller clone
Selective backup tarball / rsync snapshot Same Pi, same user You only need your files and configs and the OS is recoverable from Imager

Sector and live filesystem cloning give you a bootable copy right now. Image and selective backups sit on a drive until you need them. The four methods below cover sector-clone (UBackit), live-filesystem-on-Pi clone (SD Card Copier), image backup (Win32 Disk Imager), and sector clone on Linux / macOS (dd / rpi-clone). Selective backup with raspiBackup, restic, or rsync lives outside the scope of "clone SD card" and gets its own guide.

Why Pi Cards Fail More Often Than Phones or Cameras

Pi cards fail more often than phones or cameras for four overlapping reasons. Unclean shutdown. Pi deployments are frequently powered off at the wall without sudo shutdown -h now, leaving the ext4 journal mid-write. Counterfeit cards. The economy microSD market is full of unbranded cards that report 64 GB but actually have 8 GB of usable NAND; once the OS writes past the real capacity, the controller returns garbage reads on the next mount. Read/write amplification. Logs, swap, and frequently-written databases (Docker, InfluxDB, Prometheus, Pi-hole's long-term query log, Frigate's recording DB) hammer the card's flash, and Pi cards usually lack the over-provisioning that smartphones apply. Power-supply brown-outs. A 5 V / 2.5 A Pi that briefly drops to 4.5 V during a relay trip can produce an I/O fault that the card translates into a partial read on next boot.

These four failure modes are why Part 5 below focuses on what to do when cloning fails: the file system on the source card can be corrupt enough that UBackit, Win32, and dd refuse to read it cleanly, and the remaining option is a sector-level recovery scan with Wondershare Recoverit.

Part 2. 4 Methods to Clone a Raspberry Pi SD Card in 2026

These four methods cover every combination that comes up on Raspberry Pi stack-exchange, the official Raspberry Pi forums, and the dietPi community in 2026. They are in order from least technical to most technical.

Method 1. Wondershare UBackit (Recommended, Windows)

UBackit is Wondershare's disk-cloning utility: it reads the source card's partition table, copies each partition in order, and lays down a bootable copy on the destination. The whole workflow runs through a Windows GUI, so users who have never opened a command prompt can do it. Unlike dd, UBackit can produce both a working second card and a stored .img file in the same pass.

Step 1. Install UBackit on the Windows PC. Launch the installer; the application asks for admin access. Once installed, insert the source Pi microSD card into the PC's USB card reader and wait for Windows to detect it.

install and launch ubackit on windows

Step 2. Open the Disk Clone module. In UBackit's home tab, click Disk Clone. The application shows the source and destination cards in a side-by-side view. Pick the source Pi microSD from the source list and the second card (target) from the destination list. Care here matters — making a wrong selection overwrites the original card instead of the empty target.

ubackit disk clone source and destination sd card

Step 3. Set the clone options. Tick "Clone sector by sector" only when the destination card is the exact same model and capacity as the source. For different-capacity targets, leave the default and let UBackit adjust partition sizes automatically.

ubackit disk clone sector by sector options

Step 4. Confirm and run the clone. Double-check the source and destination labels. The interface shows the exact card model and size for each, which is the safety check you want a clone tool to expose. Click Start to begin. Expect 8 to 20 minutes for a 32 GB card over a USB 3 reader; faster cards land closer to 8, slower Class 10 cards approach 20.

ubackit disk clone start progress

Step 5. Verify and eject. When UBackit reports the clone complete, click Done. Eject both cards safely through Windows before removing them, then move the destination card to the Pi.

ubackit disk clone finished verify bootable

UBackit also stores an image backup separately when you point the output destination at a folder on the PC instead of a second card. That makes Method 1 the most flexible of the four: it produces a working clone and a stored .img backup in a single workflow.

Method 2. Raspberry Pi's SD Card Copier (Free, On-Pi)

Raspberry Pi OS 12 (Bookworm) and later ship with a built-in SD Card Copier under Accessories → SD Card Copier. It clones the running Pi's card to a second card in an attached USB reader. It is free, requires no PC, runs on the Pi itself, and produces a working second card — the most direct interpretation of "clone a Raspberry Pi SD card."

Step 1. Boot Raspberry Pi OS 12 (Bookworm) or later. SD Card Copier ships pre-installed on Bookworm. If you are on Bullseye or older, install it with sudo apt update && sudo apt install piclone.

Step 2. Insert the destination in a USB microSD reader. The destination must be at least the same size as the source. SD Card Copier refuses to clone to a smaller card.

Step 3. Open SD Card Copier. Click Accessories → SD Card Copier. Pick the source device — usually /dev/mmcblk0, the internal slot — and the destination device, which is the USB reader entry. The interface shows partition size for each pick so you can sanity-check before clicking through.

raspberry pi sd card copier source destination pick

Step 4. Confirm and clone. Confirm one final time; SD Card Copier warns that the destination card's contents will be erased. Click Start to begin. The progress bar runs 10 to 30 minutes depending on card size and USB speed.

raspberry pi sd card copier running clone progress

Step 5. Verify by booting from the destination. Power off. Swap the new card into the Pi's microSD slot and boot. If the Pi boots, SSH answers, and your services start, the clone is good. If it doesn't, the original card is still untouched — recover by re-inserting it.

Method 2 is the cleanest of the four for users who already have the Pi running Bullseye or Bookworm, no PC to spare, and a spare USB card reader. Its single limitation: it cannot create a stored .img file on a remote drive.

Method 3. Win32 Disk Imager (Free, Windows)

Win32 Disk Imager is the pre-Raspberry-Pi-Imager tool the Pi community used for years to flash SD cards. It still does the simplest read-to-file workflow, which is exactly what you want when the goal is an image backup instead of a working second card.

Step 1. Install Win32 Disk Imager. The official source is the SourceForge page. Run the installer and accept the default paths.

win32 disk imager interface

Step 2. Pick a drive letter. In the top-right device dropdown, pick the microSD card's drive letter. The interface shows only the volume label, so cross-check the size before continuing.

win32 disk imager drive letter sd card

Step 3. Choose an output file. Click the folder icon, pick a path on the PC (a folder with plenty of free space — a 32 GB card produces a 32 GB .img file), give the image a name ending in .img. Leave "Read Only Allocation" ticked.

win32 disk imager output image file

Step 4. Read. Click Read (the button is on the right, opposite the standard Write button). Win32 reads the card sector by sector and writes it to the .img file. Expect 10 to 40 minutes for a 32 GB card.

win32 disk imager reading to image file progress

Step 5. Compress (optional) and store. The .img file is uncompressed and roughly the size of the source card. Compress with gzip pi-backup.img from a Bash prompt, or use 7-Zip / WinRAR on Windows.

win32 disk imager write image to destination

To restore the image later, open Win32 Disk Imager, pick the destination drive letter, point to the .img file, and click Write. Win32 overwrites the destination. Win32's main drawbacks compared to UBackit are the lack of a built-in clone-to-another-card GUI (you must read first, then write) and no image-shrinking step.

Method 4. dd / rpi-clone (Linux / macOS Command Line)

For Linux and macOS users comfortable at the command line, dd writes a perfect bit-for-bit copy at maximum read speed. rpi-clone is a wrapper that handles partition resizing automatically — useful when the destination card is a different size from the source.

Step 1. Identify the source and destination disks. Run lsblk and confirm which disk is which. A common mistake is to clone the system drive by accident. The destination card is usually /dev/sdX (where X is the USB reader's OS letter) on Linux, or /dev/diskN on macOS.

Step 2. Clone with dd. The exact command needs no flags beyond input and output:

sudo dd if=/dev/sdX of=/dev/sdY bs=4M status=progress conv=fsync

Replace /dev/sdX with the source device and /dev/sdY with the destination. The status=progress flag writes the byte count to stderr as it runs. conv=fsync flushes the buffer at the end so the card is ready to eject when dd returns.

Step 3. Resize the destination partition (if the cards differ in size). If the destination card is larger, the destination's second partition still holds the source size. Open parted or use the Pi's raspi-config Advanced Options → Expand Filesystem after the new card boots to claim the unused space.

Step 4. With rpi-clone, most of the above is automated. Clone the rpi-clone script to the running Pi and run sudo ./rpi-clone sda (assuming sda is the USB reader). The wrapper unmounts, clones, resizes, and re-mounts, with less risk of picking the wrong /dev/sdX.

dd is the fastest of the four methods on macOS and Linux, often beating UBackit by 20 to 30 percent on identical hardware. It also produces the largest image at full card size; pipe to gzip or xz for storage on a NAS or a cloud bucket.

Free Download
Free Download

Part 3. Match the Method to Your Setup

Not every method fits every situation. The table below matches the four methods to typical Pi owner setups.

Setup Best method Why
Pi owner who wants one click from a Windows PC Method 1 — UBackit Single GUI workflow, image + clone in one pass
Pi owner running Bookworm with a spare USB reader Method 2 — SD Card Copier Free, no PC, fanless, on-Pi tool
Pi owner on Windows who wants a stored .img file Method 3 — Win32 Disk Imager Free, recognised .img, easy to re-flash later
Linux / macOS user comfortable at the terminal Method 4 — dd / rpi-clone Fastest sector clone, full scripted control
Headless deployment backed up by cron Method 4 — dd piped to remote image Scripts can run unattended on cron
Pi owner cloning to a larger card after wear Method 1 or Method 4 (with resize) Both auto-expand; UBackit in GUI, rpi-clone in script
Pi owner whose card won't mount cleanly Method 1 — UBackit (or scan-source → Recoverit) UBackit reads partially-corrupt cards; Recoverit scans raw sectors

Most Pi owners in the home / hobby category fall in the first three rows. Users running production deployments — Kubernetes nodes, multi-Pi clusters, edge-AI rigs — usually sit in row 4 or row 5, where Method 4 is part of a scripted backup-and-restore pipeline that snaps the clone to a NAS bucket on a cron schedule.

Part 4. Post-Clone Steps Every Pi Owner Misses

A successful clone is bootable. A successful clone that is safe to put online needs three more steps: hostname, /etc/hosts, and SSH host key. Chris Dzombak's 2024 cloning guide lays them out, and they apply regardless of which of the four methods you used.

Hostname, /etc/hosts, and the SSH Host Key

Pis get their network identity from three places: the hostname (which advertises raspberrypi.local over mDNS), /etc/hosts (which maps the hostname to the loopback IP), and the SSH host key (which proves the Pi is the Pi when you SSH in). A clone copies all three. A second Pi powered up with the same hostname advertises the same name, the same loopback mapping, and the same SSH fingerprint; on a network that already had the source Pi, SSH warns "host key has changed" and mDNS collisions start.

Rewrite these three steps on the cloned Pi before bringing it online:

sudo hostnamectl set-hostname newpi.lan
sudo nano /etc/hosts # replace the old hostname on the loopback line
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server

Step 1. hostnamectl sets both the transient and static hostname. Step 2. Edit /etc/hosts to replace the old hostname on the 127.0.1.1 line. Step 3. Removing the three ssh_host_* files and re-running dpkg-reconfigure regenerates the keypair so the new Pi presents a unique fingerprint.

If you cloned the IP configuration (static IP, custom DNS), reconfigure those too. The most common "I can't talk to my Pi after clone" complaint on the Raspberry Pi forums comes from skipping step 2 and leaving the new Pi with the old hostname on the loopback entry.

Expanding the Filesystem When the Target Card Is Larger

When the destination card is larger than the source, the FAT32 boot partition is the right size but the ext4 root partition still holds the source size. The Pi boots, but the new space is unmapped. Run sudo raspi-config and pick Advanced Options → Expand Filesystem, then reboot. UBackit, rpi-clone, and SD Card Copier resize as part of the clone; Win32 users need to run gparted on the destination partition manually after the .img is written back to the card.

Verify with df -h: the root partition should show the larger card's capacity minus the FAT32 boot partition.

Part 5. When the Clone Fails — Recover With Wondershare Recoverit

Sector cloning and image backups read the source card as a flat block device. When the source card's partition table is corrupted, the FAT32 boot partition is partially overwritten, or the controller refuses to serve some sectors, the four methods above read partial data — the clone boots but is missing files, or the clone won't boot at all. That is the path that brings Pi owners to Wondershare Recoverit.

Sector-Level Recovery When the Source Card Won't Mount

recoverit logo
Wondershare Recoverit
Your Safe & Reliable Data Recovery Expert
Download Download

Easily recover deleted or lost files in 500+ data loss situations, such as deletion, formatting, and disk corruption. The software confidently retrieves all data types, regardless of how they went missing.

Recoverit operates one layer below a cloning tool. It scans every sector on the source card, parses the file system signatures it finds, and rebuilds the directory tree even when the source card cannot be mounted as a regular volume. On a Pi card that has been through a file-system corruption, a mid-write power loss, or an unsafe yank, Recoverit typically finds:

  • The boot partition (FAT32 with kernel, cmdline.txt, config.txt): recover these as raw files, then re-flash to a new card or use them to repair a clone that boots but will not proceed past the splash screen.
  • Root filesystem ext4 BINs and config snapshots: Recoverit pulls /etc/hostname, /etc/hosts, /etc/wpa_supplicant/wpa_supplicant.conf, .bashrc, the SSH host key files when still readable — the "I only lost the configs" scenario.
  • User data: scripts, Python virtualenvs, Node projects, stored databases, downloaded datasets, GPIO pinout memories saved to disk — the "I lost the project I spent weeks building" scenario.

3-Step Recovery Workflow for the Source Card

The same three-step workflow that works for cameras and drones applies to Pi cards: insert the card through a USB reader, point Recoverit at the External Drive, let the scan finish, preview the recovered files by file type or path, and save to a separate drive.

Step 1. Select the SD card as the source. Open Recoverit on the Windows PC. Under Hard Drives and Locations, pick the SD card from the external drive list. The card appears by its bare size.

recoverit select external sd card under hard drives and locations

Step 2. Scan. Click Scan. Recoverit reads the card's raw sectors and rebuilds file signatures. On a 32 GB Pi card that boots but reports "kernel panic not syncing", the scan usually recovers the missing config files and the SSH host key in 10 to 15 minutes.

recoverit sd card scan progress recovered file count

Step 3. Preview and recover. Preview the recovered files (configs and key files appear as text and YAML), pick the ones you want, click Recover, and save to a separate PC folder.

recoverit preview recovered file before saving
Try Wondershare Recoverit to Perform Data Recovery

article-safe-itemSecurity Verified. Over 7,302,189 people have downloaded it.

Drop the recovered configs into a fresh Raspberry Pi Imager install to bring back the working state. Save the recovered files to a separate host drive — never back to the same card from which you are recovering, or the recovered blocks will overwrite the missing ones as soon as you mount.

Conclusion

To clone a Raspberry Pi SD card in 2026, pick the four-method workflow that fits your setup: UBackit for one-click cloning from Windows, SD Card Copier for free on-Pi cloning on Bookworm, Win32 Disk Imager for free Windows-based .img backups, or dd / rpi-clone when you are at the Linux or macOS command line. After the clone succeeds, always rewrite the hostname, edit /etc/hosts, and regenerate the SSH host key before the new Pi goes onto the same network as the source, and run Expand Filesystem when the destination card is larger. When the source card is corrupt enough that cloning reads partial data, run Wondershare Recoverit's sector-level scan against the card to recover the boot partition contents, the configs, and the user data the cloning tools could not copy cleanly.

FAQ

  • Is cloning the same as imaging an SD card?
    Not exactly. Cloning writes a working copy of the card's data to a second card. Imaging pulls the same data into a file on disk (.img, .iso, .dd) that you re-flash later. Win32 Disk Imager with the Read button produces an image; UBackit produces both a clone and an image in the same pass. The end result boots identically, but the workflow and the re-flash step differ.
  • Do I need to clone to a card of the same size?
    Not necessarily — UBackit, SD Card Copier, and rpi-clone resize the rootfs partition to fit a larger destination. The destination does need to be at least as large as the source. Cloning to a smaller destination card is rejected by SD Card Copier, fails midway in UBackit / rpi-clone, because the partition table cannot be cleanly shrunk.
  • Can I clone a Raspberry Pi SD card on macOS?
    Yes. BalenaEtcher (cross-platform) reads card to file then writes file to card; the macOS dd terminal tool does direct sector cloning; ApplePi-Baker is a third option with a Pi-flavoured UI. Method 4 above covers dd.
  • Will the cloned Pi boot identically to the source?
    Yes for boot and package state. No for network identity — clones reuse the source's hostname, /etc/hosts, and SSH host key, which collide with the source if both are online at once. Rewrite hostname, /etc/hosts, and regenerate the SSH host key before bringing the new Pi onto the same network as the old one.
  • How long does cloning a 32 GB Pi card typically take?
    UBackit and SD Card Copier: 8 to 20 minutes through a USB 3 reader. Win32 Disk Imager: 10 to 40 minutes. dd / rpi-clone: 5 to 15 minutes on macOS / Linux. Speed depends on the source card class and the reader's USB protocol. V30 UHS-I cards land in 8 to 12 minutes on USB 3; older Class 10 cards approach 40.
  • Do I need Raspberry Pi Imager instead of any of these methods?
    Raspberry Pi Imager is for flashing a fresh OS image, not cloning an existing card. Imager downloads Bookworm, Ubuntu, RetroPie, Home Assistant, and writes it to the card; it does not read from a source card. To clone an existing Pi installation, use one of the four methods above.
  • What is the safest way to back up a Pi running a database?
    Stop the database service before cloning. Cloning a live PostgreSQL, MongoDB, or InfluxDB produces an inconsistent image because the file system will not coalesce writes on first non-allocated sectors. If you cannot stop the service, run the database's native snapshot tool (pg_basebackup, mongodump, influx backup) first, then clone. The clone then captures both the snapshot files and the running OS.
  • My cloned Pi boots to a rainbow screen — what happened?
    A rainbow screen with the OS logo means kernel.img loaded but the kernel could not read the SD card's rootfs partition. Pull the new card back into a reader and check whether the second partition is intact with parted; resize if the partition is smaller than expected. If the partition fails to mount on the PC, the cloned card is corrupt — scan the source card with Wondershare Recoverit before trying again.
Selena Lee
Selena Lee Aug 28, 26
Share article:
Get Recoverit Get Recoverit