Skip to main content
Share Your Experience: Take the 2024 Developer Survey
25 votes

How to clone Raspberry Pi SD Card on Windows, Linux, and macOS?

On Linux or OSX I use dd to make a backup from SD card. Reverse if and of (i.e. to where they point - source and destination) afterwards to restore, but be careful not to restore to a wrong disk. It ...
zarvox's user avatar
  • 361
18 votes
Accepted

Can I backup my SD card with Disk Utility on OSX?

Unix dd I'm boring and use the ancient dd command in OS X. Plug your sdcard into your Mac Open Disk Utility Select your sdcard and take note of its Device name (Mine is usually /dev/disk2) Open ...
Hydraxan14's user avatar
  • 1,846
14 votes
Accepted

"No such file or directory" while backing up the SD card using dd on Mac

If you are using sudo i.e. running with root permission you DO NOT have ~ as shortcut for your home directory. Use FULL PATHS or cd to the target directory.
Milliways's user avatar
  • 60.3k
13 votes
Accepted

How to clone Raspberry Pi SD Card on Windows, Linux, and macOS?

I recently had to make a backup image for my Raspberry Pi 3 Model B and found an incredibly helpful guide from Beebom. The guide outlines the process for cloning and restoring a Pi SD image for all ...
ob1's user avatar
  • 459
12 votes
Accepted

Easy backups and snapshots of a running system with LVM

You can move the installation of the Raspberry Pi OS to a LVM volume. But what does it help me? You can take snapshots from your running system. You can install software and if you don't like it you ...
Ingo's user avatar
  • 42.2k
11 votes

How to shrink an image file after allocating full space

The exists a nice tool called pishrink which reduces the size of a dd image as much as possible by shrinking the root partition. If you start up the restored image the first time the partition is ...
framp's user avatar
  • 900
9 votes

Can a Raspberry Pi be used to create a backup of itself?

It's now 2022; the original question here, and some of the answers, are about 9 years old now. I'm adding this answer to provide an update, and to connect this question, and its answers, with a more ...
Seamus's user avatar
  • 22.2k
9 votes
Accepted

Restore PI from Pi itself

Not quite. You would overwrite the partition tables when you re-image it and replace said tables with the ones from the image. After your imaging program is done, it would release the file handle to ...
Aloha's user avatar
  • 7,156
6 votes
Accepted

Copy multiple partitions to one .img file

There is no magic in the image file. It's simply a bit-for-bit copy of a chunk of the sd card. What you want to do is figure out exactly where the second partition ends, and copy from the device file ...
JayEye's user avatar
  • 1,898
6 votes

Create a Raspberry pi backup without dd

There are at least two options to create bootable mSD clones, depending on whether you prefer a UI or the terminal: pi clone which gets installed alongside with the Pixel desktop. the rpi-clone ...
TheDiveO's user avatar
  • 1,591
6 votes

Is there a way to compress a backup of the RPi because the backup has empty space?

Already answered here dd-on-entire-disk-but-do-not-want-empty-portion Assuming you want to save /dev/sdXN to /tgtfs/image.raw and you are root: mkdir /srcfs && mount /dev/sdXN /srcfs Use ...
MatsK's user avatar
  • 2,811
6 votes

How to backup a Raspberry Pi over SSH?

You will (sooner or later) run into problems with the approach you're taking. Running dd to back up a running system (or even a mounted drive) is rolling the dice. It's been said of one who follows ...
Seamus's user avatar
  • 22.2k
5 votes

Backup Raspberry Pi automatically, with incremental backups

If you consider these 2 facts it will open you up to other options: You can mount the same device in multiple directories simultaneously. You can create tmpfs mounts anywhere you want to mask a ...
Bruno Bronosky's user avatar
5 votes

Backing up SD card generates a huge .img file

Surprise! creating an image of a 16GiB SD Card creates a 16GiB image. There are 2 options; only backup files can-a-raspberry-pi-be-used-to-create-a-backup-of-itself or compress the image https://...
Milliways's user avatar
  • 60.3k
5 votes

Is there a way to compress a backup of the RPi because the backup has empty space?

https://www.raspberrypi.org/documentation/linux/filesystem/backup.md explains backup and restoration. You don't indicate what OS you are using but it is simple on any 'NIX system. I use the following ...
Milliways's user avatar
  • 60.3k
5 votes

Backing up entire Raspberry Pi's state

Best option is a complete clone of your SDCard as a bootable backup. There's a tool in Raspbian to do that, all you need is a USB reader and a second SDCard that's the same size or bigger than your ...
Dougie's user avatar
  • 5,321
4 votes

Can I perform a total backup of my system on an image file?

I faced a similar issue and therefore wrote a tool just for my private use. I decided to call it raspiBackup and made it open source when I thought it may be valuable for the community also. It took ...
framp's user avatar
  • 900
4 votes

Restore PI from Pi itself

With a big enough SD card, you could have 2 usable boot options - and manipulate the one not in use, which is fine, then update grub & reboot to the new OS. You can't write to the currently ...
Mark Williams's user avatar
4 votes

Can I backup my SD card with Disk Utility on OSX?

If you are using OS X with the dd command, use /dev/rdiskX instead of /dev/diskX and also bs=16m instead of bs=1m it should speed things up a lot.
Justin Lee's user avatar
4 votes
Accepted

How to setup a simple No-brainer 'TimeMachine' like backups for Raspbian

I use rsnapshot for incremental backups. It's extremely lightweight and can be controlled via the conf file and run using cron on a user controlled basis. Here is a "How-to" post for the pi. As far ...
Ron K.'s user avatar
  • 320
4 votes

Why can't Pi 4B read a copied back-up micro-sd card in a usb card reader?

I don't think the Pi model is a factor here. When you made your backup, did you select New partition UUIDs? If not, that's likely the problem. SD Card Copier help says this: Under Raspbian ...
Botspot's user avatar
  • 1,779
4 votes

Periodic backup of Rpi3 Stretch SD card

There are many questions on this site asking how to backup a Raspberry Pi. The most important thing is to actually perform backups, and the faster and easier the process the better. I have used the ...
Milliways's user avatar
  • 60.3k
4 votes
Accepted

copy sd card through terminal

You can use dd, this applies also for creating an image of an SDD, USB, ... and restoring it It's best to unmount the drive you're going to copy. In case of the SD-card, remove the SD-card from the ...
Swedgin's user avatar
  • 264
4 votes
Accepted

Are backups using dd if=/dev/mmcblk0 safe and consistent?

Pi documentation, repeated many times by others, seems to state that this dd approach is not only acceptable but indeed recommended. This is because many of the people who got in earlier with the Pi ...
goldilocks's user avatar
  • 59.1k
4 votes

Are backups using dd if=/dev/mmcblk0 safe and consistent?

Your "conventional wisdom" is right. The fact that someone managed to copy an image from a mounted device and it worked doesn't mean it will work every single time. Actually, it doesn't even ...
Dmitry Grigoryev's user avatar
3 votes

Can I use 'dd' to clone the Raspbian image on the Pi itself?

Yes you can, ... but it will almost certainly be inconsistent and not work as intended. Any subsequent change to a sector already written will be lost which will leave the underlying file system in ...
joan's user avatar
  • 71.1k
3 votes

Backup Raspberry Pi automatically, with incremental backups

I had the same issue with my Raspis @ home. That's why I wrote raspiBackup which allows to create dd, tar and rsync backups on a regular base without user invention. Just give it a try.
framp's user avatar
  • 900
3 votes

Backing up SD card generates a huge .img file

It's worse than you think == chances are your '16Gb' .img WONT WRITE BACK to another '16Gb' SD card ! 1) The stupid Pi system autoexpands to every last block of the SD card on FIRST BOOT !! This is ...
steveb4pi's user avatar
3 votes

How to shrink the size of your sd card before using dd to backup your sd card

Working with Raspberry Pi SD cards is painful on Windows. I suggest using a gparted Live CD (based on Linux) to modify RPi partitions. You can boot from such a disk without touching your Windows ...
flakeshake's user avatar
  • 6,213
3 votes
Accepted

Create a Raspberry pi backup without dd

I was not satisfied with any of the previous answer, but I have now found a way that gives me entire satisfaction, using Clonezilla : On another computer running Linux (in my case Ubuntu 18.04), I ...
Pierre HUBERT's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible