The purpose of this page is to explain step by step how to install and configure raspiBackup in 5 minutes to create a backup of your Raspberry very quick. This page describes for different platforms (Linux, Mac or Windows) how to restore the backup. After testing the backup and restore the next step should be to check which services have to be stopped before the backup starts. Finally cron should be configured to start raspiBackup on a regular base. Later on when you have some spare time read this page carefully to check which additional features of raspiBackup are useful for you and update the raspiBackup configuration accordingly. In any case it's strongly recommended to read the FAQ.

I just wanted to get nfs up and running on my Raspberry Jessie and got the uggly error message. Root cause is the nfs-server starts before rpcbind. If you restart the nfs-server after boot it will work. But will not work again after reboot. Following page describes how to get this fixed.

Following enviroment variations exist for raspiBackup in next release 0.6.2 which supports Raspi3. For all new features available in this beta see this page. Resource constraints limited the number of variations tested. Please add a comment when you successfully tested a variation which is not marked as tested. If you don't know for sure whether your scenario was already covered in the table don't hesitate to ask. We'll figure this out.

There are various reasons (performance, space, ..) why you want to move your root partition from your Raspberry sd card to an external device like an USB disk or USB stick. You can do it manually or use a small script to achieve this.

If you want to clone a SD image which was created on a Raspberry Pi and use the cloned SD on another Raspberry you have to execute one important additional step. Otherwise the Raspberry starting with the cloned SD card will not get a network connection.

To learn to use threading in Python you have to have a concrete problem to solve. Just use Raspberry Pi to connet 6 LEDs and manage them via GIO. On the following pages I describe how to customize my sample program to simulate tarffic lights. You also find a video which shows the program in action and a download link for the sample program.


Frequent asked questions about raspiBackup. Every new user of raspiBackup should read all questions and answers.

So many people from the community helped to improve raspiBackup with their comments, improvement requests and beta- and fix test support and execution. It's time to mention them now.  I unfortunately don't remember everybody - sorry about this.

It's possible to add custom code which is executed before and after the backup process via two script extensions. They are useful if modification of the backup script is required to extent the script capabilities and will be lost and thus have to be merged again and again every time when raspiBackup will be updated.

Three extensions are available and can be used as samples for extensions. The first two report the CPU temperature and memory utilization pre and post a backup run. The third one is called at the end of the backup and can be used to execute different actions depending on the success or failure of raspiBackup.

If you create your own extension please share it with the community and announce it's availability in a comment. If there is any function missing for the extensions please write a comment and I'll check whether it's possible to provide the missing function.

Seq Nr Requests Status Comment


 Restore writes following message

"WARNING: GPT (GUID Partition Table) detected on '/dev/mmcblk0'! The util fdisk doesn't support GPT. Use GNU Parted."

This message can be ignored but should not be written any more

done  available with version 0.5.14


Write more progressing messages during backup

done available with version 0.5.12


Don't use /mnt for restore any more

done available with version 0.5.13


Unpartitioned SD cards create issues during restore (See

done available with version 0.5.13


Use a new flag (e.g. -z) to enable zip function for tar and dd. Backuptypes ddz and tgz should be removed

done available with version 0.5.10


Create a website which lists all changes and enhancements

done see


Notify in eMail (if there was one defined) when there is a new script version available

done available with version 0.5.11


Keep documentation current (see also #6)



Save more than 2 partitions (includes NOOBs support for backuptype tar and rsync)

done available with version 0.6.1





Date Version Changes and new features
    1) Starting with sfdisk 2.27.1 the messages format changed. They are now supported

1) Change: rsync does not save xattrs any more.

2) Bugfix: dd backup cannot be restored because raspiBackup complaints about a missing .sfdisk file


1) Extension: Support for PARTUUID

2) Bugfix: If raspiBackup is active another instance will terminate immediately with an error message.

3) Bugfix: Restore initializes fake HW clock correctly

 5/17/2017  0.6.2

1) Bugfix: RBK0077E: Restore failed. Check previous error messages. RC: 109

2) Bugfix: Restorelogs are not truncated any more

3) Bugfix: Restore is possible again as it was in on a Linux not running on a Raspberry

4/8/2017 0.6.2

1) Enhancement: Support of Raspi3 if it's not using a SD any more (normal backup only - no partition oriented backup)

2) Bugfix: Partitionoriented mode will not save for tar backup the directories /tmp, /proc/ dev, etc any more

3) Bugfix: Partitionoriented mode will not save for rsync backup the directories /tmp, /proc/ dev, etc any more3) Enhancement: Partitionsoriented mode supports in addition to fat16/32 and ext234 also swap and btrfs partitions

4) Enhancement: Partitionoriented mode now supports to backup fat16/32, ext234 and swap and btrfs partitions

5) Enhancement: For Rsync backup it's tested whether hardlinks can be created.

6) Bugfix: Extension which are called when raspiBackup finished now get the return value from raspiBackup. Until now also a failure was reported as success.

7) New Option -M allows to define the name of the backup directory. That way it's possible to create a backup with a meaningful name. Useful when you want to create a quick backup in addition to the normal regular backup

8) Enhancement: Error messages and -handling was improved

9) Enhancement: raspiBackup cannot be started any more in parallel

10/8/2016 1) Bugfix: "RBK0027E: No external device mounted on /backup. SD card would be used for backup" is reported and the backup path passed as last parameter is not used.

1) Bugfix: Backup creation of .img and .mbr files is checked for successful completion. Otherwise backup terminates.

2) Improvement: Rootpartitionadaptation during  restor is done by Linux tools parted and no longer by a home grown algorithm

3) Bugfix: If a restore detects no partition on the target SD card there is a info message written instead of a cryptic error message create by the used tools parted


1) Improvement: If there are any runtime errors detected during raspiBackup startup these errors are reported via eMail if the eMailConfiguration is OK

2) Improvement: For dd backups only the space used by all defined partitions is saved. That way a 16GB SD card which uses only 4GB will be saved much faster and the backup image will be much smaller. Configurationvariable: DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY

3) Improvement: Boot partitionen backup will be saved by hardlinks if the backup space supports hardlinks so there exists only one boot partition backup if it's identidal to previous backups. That way 60MB per backup is saved on the backup partition. Configurationvariable: DEFAULT_LINK_BOOTPARTITIONFILES

4) Improvement: Optionparameters can be specified as text for options -l, -L and -m (e.g. -m detailed -L syslog -l debug)

5) Improvement:  Restore to any SD card (mmcblk0, mmcblk1, ...) is possible. Until now mmcblk0 was supported only.

6) Bugfix: Logfiles which are created in the backup directory will be saved in the home directory if the backup fails just before the incomplete backup directory is removed

7) Improvement: If there are any incompatible changes in a new version of raspiBackup this will be reported in a message.

8) Improvement: Errormessage of backuptools dd, tar and rsync are written in a message and are no longer visible only in the debug log

9) Bugfix: Option -u to exclude directories during backup creation didn't work since version any more.

10) Bugfix: Cleanup not executed at the end of restore

11) Bugfix: No error reported if restore failed

12) Improvement: If the restore SD card is either smaller or larger than the source SD card used for the backup the second partition is adapted accordingly. Works for tar and rsync backup in normal backup mode only.

13) Bugfix: Two error messages are not displayed

14) Parameters -a and -o are mandatory


1) Improvement: All backups are saved in dedicated subdirectories

2) Improvement: If raspiBackup fails the services stopped with -o will be started in any case

3) Improvement: -0 option forces during restore ignore of partition layout creation errors (Use with care!)

4) Improvement: -1 option does not create a partition layout during restore and restore uses the existing partition layout. (Use with care!)

5) Improvement: It's possible to configure to send a notification email only on failured

6) Improvement: Path- and filenames now can be relative

7) Improvement: Services will be started even a failure accoured (-a parameter argument)

8) Improvement: SSMTP eMail uses also -E argument

9) Deprecation: -p and -r parameters are deprecated and will be removed in a furure version. Pass the backupDirectory or backupFile as the last invocation parameter from now on

10) Improvement: rsync and tar tool invocationparameters can be modified (Use with care!)

11) Various minor enhancements

 Finally from a quality point of view there is another major improvement: The regessiontestsuite for raspiBackup now tests all possible 5 backup variations


1) Bugfix: Existing dd backups are deleted by tar or rsync backups if they are saved in the same backup directory

2) Improvement: raspiBackup will be updated immediately if there is a known serious bug in the current script version

12/26/15 1) Bugfix: Existing dd backups are deleted (introduced with
12/21/15 1) Bugfix: Old bootbackups are deleted when there don't exist corresponding rootbackups
12/15/15 1) Extension: Backward compatibility to version Restore of a pre backup uses the shared pre bootpartitionbackup for restore
12/10/15 1) Bugfix: rsync backup sometimes doesn't use hardlinks
12/3/15 1) Bugfix: If there is no bc installed an error message will be displayed

1) Bugfix: emailBody sometimes not displayed when using ssmtp

2) Bugfix: Backups of boot partitions with deleted root partition backups were not deleted

3) Enhancement: During restore it's no longer the absolut sd card size which is used to check whether the backup can be restored on a target sd card. The sum of all partition sizes is used instead.


1) Bugfix: ssmtp and sendEmail didn't work any more

2) Bugfix: force option used by sfdisk was removed in order to detect partitionioning errors


1) Improvement: Support for an eMailExtension to support other eMailClients

2) Improvement: Bootpartition data is saved for every backup run

11/11/15 0.6.1

1) Major improvement: More than two partitionen can be saved from the SD card. That way it's possible to save NOOBS images. (New parameter -P and -T).

2) Improvement: -V allows to restore versions updated with -U

3) Improvement: -y allows to quickly publish the current script version to a bunch of Raspberries

4) Improvement: Missing quotes in parameter arguments are detected and reported and no parameters are ignored any more

5) Directories and filenames can be relative. There is no need any more to use absolute names.

6) Not supported any more: xmbc Backup

7) Not supported any more: rsync backup only possible on ext3/ext4 formated partitions

8) Various minor improvements (Changed and new messages, message whether a config file is used,  much more log statements to improve debug capabilities, ...)


Small bugfixes and improvements:

1) Bugfix: File- and directorynames can have spaces

2) Improvement: Config parameters are checked for validity

3) Improvement: Script update check done only once a day

4) Bugfix: Parameter -G changes language used in eMail subject also

5) Improvement: Chek whether bash is used as interpreter

6) Improvement: Message tells whether a configuration file is used and which one


Small bugfixes and improvements:

1) Improvement: If there exist a new script vesrion the eMail will have a link to this version page so make the lookup of changes/new features more convenient

2) Bugfix: If a hostname uses a dash the restore doesn't work

3) Improvement: If it's not possible to write on the backup path (-p parameter) an error message is written

4) Improvement: /mnt and /media are now also saved

5) Improvement: It's now possible to keep up to 365 backups (Parameter -k)

6) Improvement: Select the message language if it should be different than the system language used on Raspi which is the default (new Parameter -G)

7) Bugfix:  -t rsync and -L 2 doesn't create a logfile

8) Improvement: Extensions get the returncode of the backup process as parameter

05/25/15 0.5.15

An extensions will be called by the script pre and post backup process. Two sample extensions  report the CPU temperature and the memory utilization. See


Backup of sd card with a boot partition only and an external root partition is now possible


Messageformat for the start/stop message was changed. In addition now an error in start/stop of services (-a/-o parameter) will terminate the script again. The doc was updated that && instead of ; has to be used as a separator in -a/-o parameters if multiple commands are used.


An update of the script will create a backup copy of the old file by using the version of the old script.

In addition error messages written if there are invalid invocation parameters used are now written in German and English depending on the locale used on the Pi


Additional parameterchecks were added

02/26/15 0.5.14

fdisk replaced with parted. Now there are no error messages written when a gpt instead of mbr is used.  Fixed some bugs in the restore messaging.

In addition a bug introduced in 0.5.12 is fixed, which caused the script update with parameter -U to fail.

02/24/15 0.5.13

/mnt is not used during restore any more. Restore on an empty SD Card works now. 

02/23/15 0.5.12

More backup progress messages are written when -m 1 is used. In addition some messages were rephrased

02/22/15 0.5.11

A notification will be generated if there exist a new script version (parameter -u)

02/22/15 0.5.10

Zip of tar and dd backups now has to be enabled with flag -z

02/20/15  0.5.9

Switched to GIT instead of CVS as code repository and the updatecheck -U doesn't download the actual script  any more and uses a dedicated version file to check.

That way the download counter of the script will not be modified any more if a check is executed


For coding commit details see coding change logs