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



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.


Invocationsyntax and -options

raspiBackup has to be executes as root or with sudo.

raspiBackup.sh Option1 Option2 Option3 ... [backupdirectory or backupfile]

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.

Parameter Function Default
-d SD card device. Example: e.g. /dev/sda. Starting with version the size of the root partition will be adjusted if the SD card is larger or smaller than the backup SD card. No

Defines the partition which will be used to restore the root partition. Example: /dev/sdb1

Attention: This partition will be formatted. Double check that this partition is the right one!

This option allows to restore backups taken on systems which use an external root file system on USB or disk.

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.

-0 No partition layout will be created on SD card and the existing layout will be reused. See FAQ #6 for details. No



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 raspiBackup.sh -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 raspiBackup.sh -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
eMail is hidden and not visible to the public. It's used to inform you about new comments.