Raspberry Pi: Clone Your Raspberry Pi SD Card: 3 Simple Methods

More Tips & Tricks

how to clone raspberry pi sd card

Clone Your Raspberry Pi SD Card: 3 Simple Methods

Having extra copies of your Raspberry Pi SD card can be useful in many situations. Maybe you want to make a backup or migrate your whole system. This procedure may sound quite complex, but it’s not that difficult. In this article, I’ll give you a comprehensive guide on how to clone your Raspberry Pi SD card.

There are three main ways to clone the Raspberry Pi SD card:
– Using the SD Card Copier utility available on Raspberry Pi OS.
– Using Win32 Disk Imager for Windows users.
– Using the DD command for macOS and Linux systems.

Although these tools are often pre-installed, they can be quite tricky to use. Disk cloning requires a great deal of care to avoid accidentally formatting drives or partitions. So in this article, I will show you how to use each of the tools listed above.

Table of Contents

Why Do You Need to Clone Your Raspberry Pi?

But before we get started, let’s have a quick look at some of the reasons why you might need to clone your Raspberry Pi SD card.

Below are some of the reasons why you might need to clone your SD card.

Easy System Transfer

Thinking of upgrading to a new Raspberry Pi model on another SD card? Cloning makes the process a breeze! You can simply clone your current SD card onto a new one and voila! Everything – from your OS to your files and configurations – is transferred over to the new SD card.

You Want to Make a Backup

Have you ever had your Raspberry Pi crash or suddenly stop working? It’s quite frustrating, right? Well, by cloning your SD card, you create a backup of your entire Raspberry Pi setup. So, if something goes wrong, you can quickly insert the working SD card and get going.

Experimentation Without Risk

I love tinkering with my Raspberry Pi and trying out new stuff. Cloning your SD card allows me to do just that without the fear of messing up my current setup.

If you are like me, you can create a clone, play around with different configurations, and test out new software, and if things don’t work out, no worries – just revert to your original setup with the clone.

Sharing Projects

Do you have an awesome Raspberry Pi project you want to share with a friend or colleague? Instead of explaining every step they need to take to set it up, just hand them a cloned SD card! They can pop it into their Raspberry Pi, and they’re good to go – no fuss, no muss.

Wait, I have some recommendations for you!

Before you go any further, I want you to take a look at some of the recommendations I’ve handpicked for you. I think these are essential items you should have for your Raspberry Pi. You can check them out and buy them directly from Amazon.

Hardware Requirements to Clone Your SD card

Below are some of the hardware you’ll need for this project:

  • A reliable spare SD card: Since you want to clone the existing SD card, you’ll need an additional SD card which will be the destination for your clone. Also, this SD card must not be smaller than the SD card you want to clone. In my case, I always opt for a larger SD card. Alternatively, you can also opt for a USB drive.
  • A USB reader/adapter: If you’re using Raspberry Pi OS to clone, you will need an SD card reader to connect your other SD card via the USB ports. However, if you’re on a laptop, you might need two SD card readers to hold both SD cards.

    You can find cheap USB to SD card adapters on Amazon if your computer doesn’t have one.

Clone SD Card on Raspberry Pi OS

If you already have your Raspberry Pi up and running, there’s no need to look for a laptop to clone the SD card. Just follow the steps below:

  • Insert the spare SD card into the Raspberry Pi.
    The Raspberry Pi has only one SD card slot; therefore, you’ll need an adapter to connect the other SD card to one of the USB ports. You can also use a USB drive as the clone, but remember that you’ll need to enable “boot from USB” on the Pi if you want to load it.
  • Launch the SD Card Copier program.
    SD Card Copier is a tool the Raspberry Pi team developed to clone the SD card to another bootable USB drive or SD card.

    On Raspberry Pi OS desktop, it’s under the main menu > Accessories > SD Card Copier.
    sd card copier menu entry on raspberry pi os
  • Select which SD cards.
    You’ll see two entries in the SD Card Copier app. The first is “Copy From Device.” This should point to your existing SD card that you want to clone. Most of the time, it will be automatically selected. The second box is “Copy To Device.” This should point to the spare SD card or USB drive that you want to make the clone on.
    sd card copier on raspberry pi os select devices
  • Clone the SD card.
    You will see the option “New Partition UUIDs.” Leave that unchecked and click “Start” to begin the cloning process. You will see a warning prompt: “All the data in the destination SD card will be erased.” Click “Yes” to start.

    Once cloning is complete, you can now use the new SD card in another Raspberry Pi.

Clone SD Card Using the DD Command (Linux and macOS)

Another option you can use to clone the SD card is the DD command available on macOS and most Linux distributions.

The DD (disk dump) command is used for copying and converting files and data on Unix-like operating systems. Essentially, DD reads data from a source and writes it to a destination, allowing you to create backups, clone disks, or manipulate data at a low level.

The DD command comes in handy in various situations.

  • Maybe you have installed a different Linux distribution or OS on your Raspberry Pi (Kali Linux, Kodi, Windows 10 IoT Core, etc.), and it doesn’t come with the SD Card Copier app. In my case, I had set up Windows 10 IoT Core and needed to run the project on another Pi.
  • You don’t have a Raspberry Pi board nearby, but you have the SD card with you and your laptop.

Clone Raspberry Pi SD Card on Linux (Ubuntu)

Even though I am using Ubuntu for this tutorial, these steps will work for any other distribution including DebianCentOSArch Linux, etc.

  • Insert the two SD cards into your PC:
    Here you may need to use an SD card reader or adapter since most laptops don’t come with an SD card slot.
  • Identify SD Card:
    From this step, you will need to get a little bit techy. Don’t worry if you aren’t well-versed with the Linux command line as I will keep everything plain and simple.

    Launch the Terminal from the applications menu and execute the command below:
    sudo lsblk


    The lsblk command lists all the devices connected to your PC, including the SD cards. Scroll to the bottom and you will see devices with the label /dev/sdb or /dev/sdc and so on depending on the number of external drives connected.

    In my case, /dev/sdb is the SD card we want to clone and /dev/sdc is my spare SD card.
  • Unmount SD Cards:
    Before proceeding, unmount any partitions on both the source and target SD cards. You can do this using the umount command followed by the device names of the partitions. For example:
    sudo umount /dev/sdb1 /dev/sdb2 /dev/sdc1

    Replace /dev/sdb1 /dev/sdb2 and /dev/sdc1 with the appropriate partition device names if necessary.
  • Clone SD Card:
    Once the SD cards are unmounted, you can use the DD command to clone the entire contents of the source SD card to the target SD card.

    Execute the following command, replacing /dev/sdb /dev/sdc with the device names of the source and target SD cards.
    sudo dd if=/dev/sdb of=/dev/sdc bs=4M status=progress

    Here is a brief explanation of the parameters I used in the command above:
    if= specifies the input file (source), which is the source SD card (/dev/sdb).
    of= specifies the output file (destination), the target SD card (/dev/sdc).
    bs= sets the block size to improve performance. In this example, it’s set to 4 MB.
    status=progress shows the progress of the dd command.
  • Wait for Completion:
    Depending on the size of your source SD card, the cloning process may take some time. Be patient and wait for the DD command to complete.
  • Eject SD Cards:
    Once the cloning process is finished, you can safely eject both the source and target SD cards from your Ubuntu machine.

You now have a clone of your Raspberry Pi SD card on the target SD card. You can insert the target SD card into another Raspberry Pi and boot from it as you would with the original SD card.

Clone Raspberry Pi SD Card on macOS

If you are on a macOS, follow the steps below.

  • Insert SD Cards:
    Insert both the source (original) SD card and the target (new) SD card into your Mac. Note the device names assigned to both SD cards. You can use thediskutil listcommand to identify the device names.
    Here, I have /dev/disk2 (16GB) as the source drive and /dev/disk3 (32GB) as my new SD card.
  • Unmount SD Cards:
    Before proceeding, unmount any partitions on both the source and target SD cards. You can do this using the diskutil unmount Disk command followed by the device names of the disks. For example:
    diskutil unmountDisk /dev/disk2
    diskutil unmountDisk /dev/disk3


    Replace /dev/disk2 and /dev/disk3 with the appropriate disk identifiers for your source and target SD cards.
  • Clone SD Card:
    Once the SD cards are unmounted, you can use the dd command to clone the entire contents of the source SD card to the target SD card. Execute the following command, replacing/dev/diskxwith the device names of the source and target SD cards.
    sudo dd if=/dev/disk2 of=/dev/disk3 bs=4m

    Here:
    if= specifies the input file (source), which is the source SD card (/dev/disk2).
    of= specifies the output file (destination), the target SD card (/dev/disk3).
    bs= sets the block size to improve performance. In this example, it’s set to 4 MB.
  • Wait for Completion:
    Depending on the size of your source SD card, the cloning process may take some time. Be patient and wait for the dd command to complete.
  • Eject SD Cards:
    Once the cloning process is finished, you can safely eject both the source and target SD cards from your Mac.

Clone SD Card Using Win32 Disk Imager (Windows)

Are you a Windows user, well, I have you covered. I will show you how to use a tool called Win32 Disk Imager to clone the Raspberry Pi SD card.

Follow the steps below to get started:

  • Download and install Win32 Disk Imager.
    Win32 Disk Imager is available for download for free on most sites, but I highly recommend downloading it from their official website. You all know about viruses and ransomware. It’s best to download genuine software.
  • Open Win32 Disk Imager.
    After a successful installation, proceed to launch Win32DiskImager. You should see a window similar to the image below.
  • Create an image file:
    Unlike on Raspberry Pi OS, Linux or macOS where you can directly clone your SD card to another, you will first need to create a disk image and then write it to the target SD card on Windows.

    On the Win32DiskImager window, click on the file icon next to the “Image File” field. Select the destination folder where you want to place the image file and ensure you add a name with a “.img” extension. In my case, I like placing the image file in the Documents folder with a name like “CloneImageOne.img.”

    In the Device section, select the SD card that you want to clone. It should be the boot partition. To avoid confusion, I always first remove all connected USB drives and use the file manager to verify which letter is assigned to the “boot” partition.

    Also don’t forget to tick the checkbox next to “Read Only Allocated Partitions.” That will enable Win32DiskImager to only copy the portions of the disk that are actively being used and have data stored on them. Otherwise, you will have an image of the same size as the SD card.

  • Create a disk image:
    After setting up everything correctly, click the “Read” button. Win32DiskImager will immediately start creating a disk image out of the SD card. This process might take a few minutes.


    Once done, you will get a “Success” message and you can find the image file in the destination folder you selected.
  • Write the cloned image to an SD card:
    Now that you have the disk image file, you can proceed to write it to your new SD card. You can use various tools like Raspberry Pi Imager or Balena Etcher. However, for this post, I will just stick to Win32DiskImager.

    Launch the app. In the image file section, use the “file” icon to select the image you just created. In the “Device” dropdown menu, select your new SD card. Click “Write” to get started.

    Once done you can eject the SD card and use it to boot your Raspberry Pi.

That’s it! I believe you now have a working spare SD card you can use to boot your Raspberry Pi.
If you need a video to see the steps involved, There is one here:

Cloning comes in handy especially when working with complex Raspberry IoT projects. If your SD card gets worn out or corrupted, you won’t have to imagine losing all your progress and starting from scratch.

More Tips & Tricks

DistroSea.com site image
Check out different Linux distros in your web browser with nothing to download at DistroSea.com
Quick Ref Site image
Here are some cheatsheets and quick references from QuickRef.ME.
edX Site image
Learn Linux from MIT for FREE edX.
Linux Basics YouTube Series Site image
Linux Basics YouTube Series
Watch the Series.
“Linux Command Line Tutorial For Beginners" will teach you everything you need to know about Linux Command Line in easy-to-understand language.
Watch the Series.