Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

With raspiBackup you can create regular backups of your Raspberry. In addition you can restore a backup to any SD card. A new partition table is created on the target SD card and the backup data is restored on the partitions. If an external root filesystem was saved with raspiBackup this filesystem will also be restored to an external device.



  • Simple restore of backups for windows, mac or linux users by using the Raspberry Pi
  • Messages in English and German
  • External rootfilesystem will be restored if the normal backup mode was used during backup and tar or rsync backup mode was used
  • Can be used to clone Raspberry Pis
  • Simple update to the latest version (-U parameter)



Invocationsyntax and -options

Restorescenario for Windows- or Macusers

Restorescenario for Linuxusers

Restore command examples

  1. Restore boot and root partition to SD card
  2. Restore the boot partition to SD card and the root partition to an external partition


Every backup should be tested on a regular base to check whether a restore still works and still contains all required data. It's ugly if you detect at the time you want to restore the backup that the backup is corrupt or there is data missing. A restore test is quite simple: Just insert a new SD card, restore a backup and boot the restored backup.

If the restore fails for any reasons with raspiBackup the backup can also be restored with the standard Linux tools used to create the backups - dd, tar or rsync - but will not as convenient as a restore executed with raspiBackup.



Use the same operating system for restore which was used to create the backup. There are incompatible output format changes which cause the restore to fail. As of now it's the sfdisk output format which changed between Wheezy and Jessie and cause the repartitioning to fail.


Invocationsyntax and -options

raspiBackup has to be executes as root or with sudo. Option1 Option2 Option3 ... backupdirectory

Option -R defines, whether a single SD card restore will be executed or an external root partition will also be restored to an external partition.

Starting with version all options which turn something on or off can be influenced by a trailing + or -. Example: Option -z and option -z+ turn on the backupcompression. Option -z- turns off the backupcompression and ignores the definition DEFAULT_ZIP_BACKUP in the configuration file. That way it's possible to turn off options in the commandline even they are turned on in the configuration file.


Parameter Function Default
-C Format of the restore partition will check for bad blocks by using option -c to mkfs.ext4. Note: This will slow down the restore (Starting with V0.6.3.2) Off

SD card device or USB stick. Example: e.g. /dev/sda. The size of the root partition will be adjusted if the SD card or USB stick is larger or smaller than the backup SD card.

Note: A partition, e.g. /dev/sda1 will be rejected.

Attention: This device will be formatted and all existing data will be deleted. Make sure this device is the right one!

Note: This SD card should not be the SD card currently used by the operating system. Use a second SD card connected via USB card reader.


This option allows to restore backups taken on systems which use an external root file system on USB or disk. Parameter defines the partition which will be used to restore the root partition. Example: /dev/sdb1

Attention: This option should be used only if an SD card and an external root partition on USB stick is used. Otherwise option -d is sufficient.

Attention: This partition will be formatted. Make sure this partition is the right one and it's large enough to receive the restored root partition !

Note: This option works only for tar and rsync backups and if the backup was created in the normal backup modus. If option -P was used no external root filesystem will be available.




Starting with version

During restore the root filesystem can be resized to use the whole SD card or external partition.

-0 No partition layout will be created on SD card and the existing layout will be reused. See FAQ #6 for details. Off
-1 Partition layout will be created on SD card by by using the layout of the original SD card and ignoring any errors reported including SD size incompatibilities. See FAQ #6 for details.
Note: This may cause unexpected results. Use only if you know what you're doing.




Restorescenario for Windows- and Macusers

For DD backups the Windows32DiskImager can be used to restore the backup. As an alternative every backup can be restored with Raspberry Pi. TAR or RSYNC backups have to be restored with Raspberry Pi. Following steps are required:

1) Start raspbian on Raspberry

2) Connect the SD cardreader with the SD card

3) Connect the device which holds the backup (e.g. a disk) and mount it or mount a network drive which holds the backup

4) If there is a root partition to restore connact another disk which will get the restored root partition.

Usually the SD card becomes /dev/sda, the backup partition becomes /dev/sdbx and the rootpartition becomes /dev/sdcx. If there is a network device used the root parition usually becomes /dev/sdbx

The actual device allocation may be different and should be checked all the time with

sudo parted -l 

to make sure there will be no other partition overwritten by error.


Restorescenario for Linuxusers

That's in general the same as for Windows- and Macusers. In contrast there is no Raspberry Pi required. Just connect the SD card reader on the Linux system together with the backup partition and an optional external root filesystempartition.

Examples for restore commands

Required hardware for restore:

1) Running Raspberry Pi running raspbian or another Linux operatingsystem or another LInux system with installed raspiBackup

2) Connected card reader with a new SD card

3) Connected device which keeps the backup (USB or net)

4) If an external rootpartition should be restored there has to be another USB disk or SD card connected


Restore boot and root partition to SD card

  1. Name of system to restore is raspberrypi
  2. SD card which will get the restored boot- and root partition is available in the sample command as sdf. The whole SD card will be repartitioned and all old data will be deleted.
  3. Backup to restore is available on /remote/raspifix/disks/backup/rsync/raspberrypi/aspberrypi-rsync-backup-20141230-213032/
  4. Here you will find instruction how to identify the parameters for -d.
sudo -d /dev/sdf /remote/raspifix/disks/backup/rsync/raspberrypi/raspberrypi-rsync-backup-20141230-213032/


Restore the boot partition to SD card and the root partition to an external partition 

  1. Name of system to restore is raspberrypi
  2. A partition /dev/sda1 on /dev/sda was already created. It's not required to format the partition.
  3. SD card which will get the restored boot partition is available as sdf in the sample command. Note: All data on the SD card will be deleted.
  4. The root partition will be restored in the sample command to /dev/sda1. Note: All data on the partition will be deleted.
  5. Backup to restore is available on /remote/raspifix/disks/backup/rsync/raspberrypi/raspberrypi/-rsync-backup-20141230-213032/
  6. Here you will find instruction  how to identify the parameters for -d and -R

sudo -d /dev/sdf -R /dev/sda1 /remote/raspifix/disks/backup/rsync/raspberrypi/raspberrypi-rsync-backup-20141230-213032/ 




How do identify the devicenames used by the external SD card and external disk?

Type following command on Raspberry:

fdisk -l | egrep "^Disk /|^/dev"

The output will look similar to

pi@raspberrypi:~# sudo fdisk -l | egrep "^Disk /|^/dev"
Disk /dev/mmcblk0: 8011 MB, 8011120640 bytes
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880    15646719     7761920   83  Linux
Disk /dev/sda: 15.5 GB, 15548284928 bytes
Disk /dev/sdb: 300.1 GB, 300069052416 bytes
/dev/sdb1               1   586072367   293036183+  ee  GPT

You now can see the internal SD card /dev/mmcblk0 with 8GB, the new external SD card /dev/sda with 16GB and the external disk /dev/sdb with 300 GB which has one partition /dev/sdb1 for the external rootpartition.

Given this use -d /dev/sda (External SD card). If the backup also has an external root partition use in addition -R /dev/sdb1 (External rootpartition). Adapt these parameters to your local environment.

Add comment

*** Note ***

Comments are welcome. But in order to reject spam posts please consider following rules:
  1. All comments are reviewed manually and it usually takes one day until a comment will be published.
  2. Comments with string http are rejected with message You have no rights to use this tag.
  3. You have to wait at least one hour until you can post another comment.