As of May 31, 2023, we have updated our Code of Conduct.

Hot answers tagged

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,796
14 votes
Accepted

How to shrink an image file after allocating full space

So the best way I have found is to use GParted (you can either use a Linux-based OS, or boot from a GParted Live USB). It is simple enough to find detailed instructions on how to do each of these ...
Mike Roberts's user avatar
13 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
  • 57.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

Backup Raspberry Pi automatically, with incremental backups

Rsnapshot fulfills those criteria:1 Can be used locally or remotely. Can be automated/scheduled. Uses numbered incremental backups. I don't have much personal experience with it beyond the fact that ...
goldilocks's user avatar
  • 57.9k
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
  • 41.5k
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
  • 902
9 votes

Self healing SD Card partitions

If you have problems with SD-cards you should try (in order): Use another (bigger) power supply. Connect a powered hub in between the Raspberry and any USB peripheral you may have. Use SD-cards ...
Ronny Nilsson's user avatar
9 votes
Accepted

Clone Raspberry Pi SDCard to file on Mac OS X?

I use the following script to backup SD cards on OS X:- #!/bin/bash # script to backup Pi SD card # 2017-06-05 # 2018-11-29 optional name # DSK='disk4' # manual set disk OUTDIR=~/temp/Pi # Find ...
Milliways's user avatar
  • 57.3k
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,106
7 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
  • 20.3k
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,878
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,571
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
  • 20.3k
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
  • 57.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
  • 57.3k
5 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,635
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,170
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
  • 902
4 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
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

Clone Raspberry Pi SDCard to file on Mac OS X?

You can use dd to backup the drive. The trick is to use the device as the input, not its partitions. Taking an example from the RPi forum, you can backup and even auto compress the information in one ...
Jacobm001's user avatar
  • 11.9k
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
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,749
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
  • 57.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
  • 57.9k
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

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