How to Clone/Backup Raspberry Pi SD Card on Windows, Linux, and MacOSMandip
It’s an important thing to take a backup of your all-important data whether it is on your PC or stored on an external storage device. Today, I will guide you on how to clone a Raspberry Pi SD card on Windows, Linux and Mac OS.
How to Backup Raspberry Pi SD Card on Windows
Back up or clone Raspberry Pi SD card means you will create a duplicate copy of the contents stored on the card and use if the original memory card corrupts. Check the steps below to copy the data from one SD card to another with the help of Windows OS.
Step-1: Insert the SD card in your PC. You can use the USB port or a built-in card reader of your system if it is available
Step-2: Download the latest version of software Win32DiskImager from the official resource and install it
Step-3: Open the app when the installation is done
Step-4: At the right corner, you will see an option of choosing the device. Click on it and select the drive in which you inserted the SD card
Step-5: Choose the folder location where you want to save the image file of the data
Step-6: Name the file as per your choice but remember to add the .img extension. For example, raspberry_clone.img
Step-7: Now select ‘Read’ button
Step-8: Wait when the data is being copied to the specified location. Don’t shut down your PC
Step-9: When you get the message of ‘Read Successful,’ attach the card back into your Pi to use it
Step-10: Now, it’s time to insert the SD card into your PC on which you want to make the copy of your original SD memory card
Step-11: Open the Win32DiskImager software and choose the image location that you have made
Step-12: Select the drive of your inserted SD card and choose ‘Write’ button
Step-13: Wait until the process is finished. It can take a while to duplicate the data
Step-14: Remove the memory card and keep it at safe place for future use
How to Clone a Raspberry Pi SD Card on Linux
If you are a fan of Linux and want to clone your Pi SD card using some command lines, then follow the process below:
1) Open the command terminal and enter ‘sudo fdisk –l.’
2) Look for your memory card name indicating with a little less memory space than originally mentioned by the manufacturer (that’s obvious). It may look like /dev/sda followed by the storage size of your SD card
3) Now, enter the command below in the terminal. It will start cloning the data off your memory card to the specified folder name with .img extension
sudo dd if=/dev/sda of=~/raspberry_clone.img
4) You will see a message displayed on the terminal windows with the total records of in/out and the size of data copied in the file
5) Now, remove the original SD card and insert the card on which you want to create the backup. Make sure that the partitions are unmounted on the memory card
6) Enter the command below to write the copied data to the SD card which is to be cloned
sudo dd if=~/raspberry_clone.img of=/dev/sda2
Make sure to follow the right path. Otherwise, you may lose all your content from the system, and the SD may be corrupted. A message will be displayed after the writing process is done.
Clone Raspberry Pi SD Card on Mac OS
At last, I will describe how you can duplicate the content of a Pi SD card on your Mac system. It is the similar process that we have seen for the Linux OS but has some different command names. So, let’s check the methods below:
Method-1: Using Command Terminal
- Insert the SD memory card in your Mac OS system
- Go to terminal, write ‘diskutil last’ and then press Enter
- Check your device name. You can easily recognize the SD card by its size and name mentioned
- Now, enter the below command where we replace the file extension from the Linux OS. Here we will use .dmg extension for Mac
sudo dd if=/dev/disk of=~/raspberry_clone.dmg
- Sit back for a while until the process completes. Unmount the memory card after the terminal window displays the message of reading finished
- Unmount the SD card and insert the card which you want to make a clone for your Raspberry Pi data. Again, make sure for the unmount partition on the memory device
- Go to the terminal and write the below command
sudo dd if=~/raspberry_clone.dmg of=/dev/disk
- Wait till the writing process is finished and then remove the card from the system
Method-2: Using Disk Utility
Disk Utility is an inbuilt app for the Mac Operating Systems. It helps to make many significant changes and perform actions to ease your tasks. One of them is backing up Raspberry SD card by duplicating its data.
- Insert the SD card in your Mac system
- Open ‘Disk Utility’ app and choose the partition you want to clone
- Go to file menu, select ‘New Image,’ and then click on ‘Image from “boot”’
- Now, from the format menu, choose DVD/CD master
An iso file will be created in the form of cdr. That’s it. The backup is done for your Raspberry Pi SD card. With the help of some external Mac supported applications like Etcher app, you can restore the data of the SD card.
So, here I have described methods to clone the Raspberry Pi SD card on Windows, Linux, and Mac Operating Systems. If you have any doubt or query, then use the comment section below to ask. Also, if you know any other better and reliable method to do the process, then you can freely share your thoughts here.
Backup is always good!