Skip to main content
26 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
  • 371
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
  • 61k
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.4k
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.6k
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,802
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.6k
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
  • 61k
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
  • 61k
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,353
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

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,789
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
  • 61k
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.5k
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

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,214
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
3 votes

Restoring backup of /etc on new disk image and best practices

I doubt that this question can be definitively answered. Here is my opinion. The /etc directory is used for configuration data. The files and their contents are likely to change on a release by ...
joan's user avatar
  • 71.5k
3 votes

Restore backup failed (using rsync)

I specifically reactivated my never used account to answer this question, because I was having the same problems last week and felt like other people will too./rant About the actual problem, using ...
binki's user avatar
  • 61
3 votes

Backup RPI to a Linux Machine via ssh

There is an inherent problem with your live backup approach: you need the entire file system to remain stable during the backup process, otherwise there is no way to guarantee that the backup will ...
Dmitry Grigoryev's user avatar
3 votes
Accepted

Cloning the Raspberry Pi SD Card as a balenaEtcher-ready instal-able image

See https://raspberrypi.stackexchange.com/a/72047/8697 which lists the script I use to backup my Pi on the Mac. This includes checks to prevent accidentally overwriting the wrong thing (I learnt the ...
Milliways's user avatar
  • 61k
3 votes

can I backup pi3 to a image file remotely to macbook?

You can do a disk backup on a running system by reading /dev/sda, or whatever the name of your disk is. However, a disk backup will not necessarily be consistent, and it will occupy space for blocks ...
RalfFriedl's user avatar
  • 2,184

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