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.



So many people from the community helped to improve the raspiBackup script with their comments and beta- and fix tests. It's time to mention them now.  I may have forgotten somebody given the amount of contacts I had. Please send an email to me (email see contact page) and remind me and I will add you to the list.

A lot of development and time consuming beta test was spent to get the new script release 0.6.1 of raspiBackup available. Ther are minor improvements (Details see versionshistorie) and in addition support for more than two partitions in the partitionoriented backup mode. Now it's possible to save and restore NOOBS images. Details of the differences between the two modes are describe here. Webpages describing the Backup and Restore are updated accordingly.

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.

Two extensions are available and can be used as samples for extensions. They report the CPU temperature and memory utilization pre and post a backup run.

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) Enhancement: Support of Raspi3 if it's not using a SD any more
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

The Raspberry Pi is a nice system which is used a lot of time to provide server services to be accessible from worldwirde. That's Owncloud, a HTTP server, seafile or other servcies..

A VPN ist the right way to access the server in a secure way. But if you want to give a lot of people access there is no way other than to allow access driect from the internet. Usually you use a DMZ for this but that's a feature a normal home router doesn't have. But now you should protect the pi from internet access as far as you can and also protect your home network from access from the pi server when an intruder managed to get access to the pi. But if an the intruder managed to get root access then the iptables firewall will be turned off very quickly. So it's very important so get SW updates on a regular base and to protect root access with w secure password.

Following article describes how to configure an iptables firewall to protect it from unauthorized access from the internet and to protect a local home network to be attacked from the server - just in case.

Owncloud has a very poor performance on Raspberry Pi. But seafile runs very fast if running on nginx. There exist already a lot of instructions how to install seafile on raspberry so you will find links to these website on the following page which I used to install seafile. In addition I wrote down the sequence of steps I executed. It's primaily a combination of the various installation instructions which I found. My config files of seafile running with nginx can be downloaded as sample config files for your convenience. In addition there is a startscript for /etc/init.d available which starts seafile all the time when Linux ist started and and stops it when it's shut down. 

Characteristics of the seafileserver: is used as external dns name, nginx (no apache), runs on secure https port and offers webdav services.