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

0) Where does raspiBackup come from?

I run three Raspberries at home. Two of them run 7/24 all the time as LAN servers. It's common practice to backup a server on a regular base just in case there are any failures. In particular the SD card of the Raspberry tends to fail after some time. That's why I wrote a small script which creates a dd backup. Then a tar backup was possible to create because the dd backup saves the whole SD card all the time even there is only a subset of the space used. Finally a rsync backup was introduced to use hardlinks and save backupspace. raspiBackup helped me multiple times to revover from a broken SD card so I thought the script may also be helpful for other people running Raspberries and decided to publish raspiBackup.

1) Does it work to create a backup from a running system? Shouldn't the system be stopped first?

The most reliable backup is a backup from a stopped system. Unfortunately this cannot be done on a regular base with cron automatically. If you stop all active services as mysql, samba, nfs, seafile, Owncloud, Webserver and all other active services before starting the backup in order to keep all the data consistent the backup can be used to restore the system. If these services are not stopped there is a high probability that the backup will become inconsistent. Parameter -a and -o help to achieve for this. See also FAQ 18. As an alternative a sample wrapper script can be used and extended .

2) How can I restore a backup?

raspiBackup can restore all created backups (See this page for details). raspiBackup runs on Linux only. Windows user can use windisk32imager to restore a dd backup. For all other backup types a Linux system is required.

Fortunately your Raspberry can be used to restore the backup with raspiBackup. Install a Linux OS (e.g. raspbian) on a second SD card, start it and install raspiBackup.  Now connect an external SD card reader and the drive with the backup and use raspiBackup to restore the backup to the external SD card. Shutdown the system, insert the external SD card with the restored backup and start your Raspberry again.

3) What will be saved and restored by raspiBackup?

raspiBackup can save two partitionens via tar or rsync in the normal backup mode: The boot and the rootpartition of the SD card. If the rootpartition was moved to an external partition this external partition is also saved.The dd backup will save the whole SD card but no external root partition will be saved.

An unlimited number of partitions on the SD card will be saved in the partition oriented mode. Additional external partitions will not be saved in this mode. This mode is usefull for NOOBs images. If a restore with win32diskimager should be possible you can use the dd backup in the normal backup mode.

4) Which Linux methods can be used to create backups?

You can use dd, tar and rsync to backup the data. dd and tar backups can be zipped also. See the following page for pros and cons of the different backup methods.

5) Can the backup created by raspiBackup be used to restore the backup manually?

That was a requirement for raspiBackup: It should be possible to restore the backup with Linux means only.

raspiBackup creates readable files of the output of the Linux commands sfdisk, blkid and fdisk of the SD card. This allows to restore the partition layout of the original SD card with Linux means. Then the partition backups can be restored into these partition using the corresponding linux backup tools.

6) Can a backup be restored on a smaller or larger SD card than the original SD card?

That works perfectly for larger SD cards. But the additional space will not be used. To use the additional space a Linux repartitioning tool has to be used when the backup was restored.

Starting with version 0.6.1.3 this works perfectly for smaller and larger SD cards if backup mode tar or rsync and the normal backup mode is used. The root partition size is either truncated if the SD card is smaller than the original SD card or expanded to use the whole SD card size if it's larger. But the used space on the backup SD card has to be smaller than the restore SD card size. Otherwise the restore will fail.

Option -0 (zero) allows to use the existing partitioning of the target SD card for restore. That way you have full control about the size the partitions should have on the restored SD card. So it's possible to restore partition oriented backups also on a smaller SD card.

There is no way to restore a dd backupon a smaller SD card. The inmage has to be shrinked first. See this link how to get it done. Or use pishrink

7) How can I control the partitioning of the target SD card?

There exist two options which give you full control of the way the new SD card is partitioned. Option -1 (one) forces raspiBackup to create the same partitioning on the target SD card even the partitions are smaller or larger than the size of the target SD card. Option -0 (zero) disables partitioning by raspBackup. This allows to create the partitioning and formating on the target SD card upfront and these paritions are used as is by raspiBackup during restore.

8) On which devices can raspiBackup save the backup?

In general on every device which can be mounted on Linux:

  • External USB Stick
  • External USB disk
  • Synology
  • cifs/samba networking disk
  • nfs networking disk
  • sshfs networking disk
  • webdav networking disk
  • ftpfs networking disk

9) There is some data on my system which raspiBackup doesn't save. How can I include this data in the backup?

Use one of the following approaches:

a) Use a wrapper script  (see here) and write your own code which is executed before and after raspiBackup and saves additional data

b) Use extension points which are called before and after the backup function to save the data. There exist two sample extensions (see here) which report the CPU temperature before and after a backup run and the used memory. An eMailExtension can be used to plug in your own eMailClient.

10) Which eMailClients are supported by raspiBackup?

mailx, sendEmail and ssmtp are supported. The eMailExtension plugpoint can be used to plugin every other eMailClient (Details see here).

11) My mailProgram is not supported by raspiBackup. How can I now get eMails from raspiBackup?

Use the eMalExtension plugpoint to write a small extension which will be used to send the emails from raspiBackup. The existing extensionsamples include one sample code for the mailx eMailClient.

12) Ich have a question about raspiBackup. How do I get an answer?

At the bottom of every webspage you can create comments. Just ask your question there. To eliminate spam the comments are checked manually and that's why it usually takes one day until the comment is published and will be answered. The eMailAdress which is optional, will not be published. It's required to get update notifications about new comments and may also be used to get in contact offline.

13) I found a bug in raspiBackup. How can I report the bug and when do I get a fix?

Every software can have bugs and raspiBackup is no exception. Please report the bug on https://github.com/framps/raspiBackup/issues

and provide detailed information about your environment. In particular a log from raspiBackup which will be created with additional options

-l debug -L current

is required.

Registration on github is for free. If you don't want to create a github account or have any issues with gihub just create a comment on this website.

14) Do I get any notification if there is a new version available?

raspiBackup checks in every invocation whether there exist a new version. A message will be written and the notification eMail will have a smiley ;-) in it's mail title. Now you can check on this page what's new in the new version and update raspiBackup with parameter -U.

15) How can I revert to the previous raspiBackup version if I detect the new version doesn't work as expected when I upgraded?

raspiBackup creates a backup copy every time an upgrade is done with parameter -U. Option -V can be used to revert to a previous version. A list of all saved raspiBackup versions will be presented and the version to restore can be selected.

16) I have a 32GB SD card but need only 8GB. The dd backup uses 32GB instead of 8GB.

dd backup backups the whole SD card Starting with version 0.6.1.3 there is a configuration parameter

DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY which causes raspiBackup to save only the space used by defined partitions. So you just have to resize the 32GB partition to 8GB with gparted or other repartitiontools and the backup will only use 8GB. Current partiton sizes can be checked with lsblk command.

17) How can I check whether rsync backup uses hardlinks and backup space is saved?

From time to time raspiBackup users report they cannot use rsync backup because raspiBackup complaints the backupspace doesn't support hardlinks. Hardlinks are used successfully by raspiBackup with rsync if a local attached USB stick or a local attached USB disk formatted with ext3/ext4 or a remote disk mounted via nfs is used. samba and sshfs don't support hardlinks.

Command du -sh * displays the used backup space and du -shl * displays how much space would be used if no hardlinks are used.

Example:

root@raspberrypi:/media/nas-backup/raspberrypi# du -sh *
4,5G raspberrypi-rsync-backup-20160822-184617
4,5M raspberrypi-rsync-backup-20160822-190436
5,2M raspberrypi-rsync-backup-20160822-195250
5,7M raspberrypi-rsync-backup-20160822-201610

root@raspberrypi:/media/nas-backup/raspberrypi# du -shl *
4,7G raspberrypi-rsync-backup-20160822-184617
4,7G raspberrypi-rsync-backup-20160822-190436
4,7G raspberrypi-rsync-backup-20160822-195250
4,7G raspberrypi-rsync-backup-20160822-201610

18) Which services should be stopped before starting the backup and started again afterwards?

All services which keep any states in databases or in memory or on filesystemhave to be stopped. Otherwise inconsistent data will be saved and this will be detected when the backup is restored and the backup is unusable. raspiBackup offers option -o to stop services before starting the backup and option -a to start the services afterwards.

At least following services should be stopped with option -o:

Service Stop command
nfs service nfs-kernel-serv er stop
Samba service samba stop
Pilight service pilight stop
Cups service cups stop
Minidlna service minidlna stop
Apache service apache2 stop
Wordpress service wordpress stop
nginx service nginx stop
seafile service seafile stop
Owncloud see Apache
mysql service mysql stop
FHEM /etc/init.d/fhem stop
cron service cron stop

 

To start the services again use option -a and use the reverse service sequence used with -o. If you are dead certain you don't need to stop and start services use ":" as parameter for option -a and -o.

Example for -o:

-o "service pilight stop && service samba stop && service nfs-kernel-server stop"

Example for -a:

-a "service nfs-kernel-server start && service samba start && service pilight start"

19) Which format should be used on the backup partition?

In general every filesystem can be used which can be mounted on LInux. But there are following constraints:

- rsync backup requires support for hardlinks which is available with ext3/4. If an ext4 filesystem is exported via samba there is no support for hardlinks. NFS is an alternative.

- FAT32 can store files with max 4GB only. A dd backup will become as large as the SD card is (Configuration option DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY can reduce the size) and is in general larger than 4GB. It's similar for tar backups which become larger than 4GB quite quickly. An alternative may be NTFS on windows.

General suggestion: Use ext3/4 if possible. On Linux use NFS for remote drives and on windows use NTFS for exported samba network drives. Use FAT32 only if you are sure the backup files will not become larger than 4GB,

20) I have issues to save my backups on Synology. How can I fix them?

There are various raspiBackup users who successfully save their backups on Synology via nfs. Unfortunately I don't have a Synology and cannot help much on this. But there exists a dedicated page for Synology where raspiBackup users told me what they configured on their Synology in order to save their backups successfully.

21) The bootpartition doesn't change. Why is the bootpartition nevertheless saved in every backup again?

In about 98% situations this is true. But a firmware update can change the bootpartition. There is a configuration parameter DEFAULT_LINK_BOOTPARTITIONFILES which causes raspiBackup to link the bootpartition backups with hardlinks if they are supported. That way every backup is 60MB smaller. But the bootpartition is nevertheless saved all the time to check whether there are changes to the previous backup and then replaced with a hardlink. This option is useful only if you use a very small backup device.

22) Different ways to configure raspiBackup

raspiBackup looks up different places to retrieve its options. The priority goes from low to high:

1) /usr/local/etc/raspiBackup.conf

2) ./.raspiBackup.conf (current Verzeichnis)

3) ~/.raspiBackup.conf (home Verzeichnis)

4) Configuration file specified with option -f

5) Invocation options

23) I want to see the backup or restore progress. Is there any option to enable a progress bar?

Starting with version 0.6.3 option -g enables a progress bar.

24) raspiBackup reports  an error ACL_TYPE_ACCESS, Operation not supported when using rsync backuptype

The errormessage looks like

??? RBK0024E: Backup tool rsync received an error
rsync: set_acl: sys_acl_set_file(media/pi, ACL_TYPE_ACCESS): Operation not supported (95)
 
Root cause is that rsync doesn't support ACLs. They are not needed in 99% of all backups. In /etc/mke2fs.conf following statement
default_mntopts = acl,user_xattr
enables ACLs when a partition is mounted which also affects the backup path /backup of raspiBackup. Therefore rsync tries to save ACL data which is not supported.
 
Solution:
Remove acl from default_mntopts in /etc/mke2fs.conf
 
25) Error dev/... has unsupported feature(s): metadata_csum E2FSCK: Get a newer version of e2fsck

Solution:
Edit /etc/mke2fs.conf and change both ext4 options and remove metadata_csum. Now  restore the backup with raspiBackup.
 
26) Why do I get ??? RBK0160E: Target /dev/sda withxx GiB is smaller than backup source with yy GiB even the SD cards have the same size ?
SD Karten which have the same size (e.g. 16GB) do have a different number of free bytes. Command sudo fdisk -l /dev/mmcblk0
lists the true free space

sudo fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 15.5 GB, 15548284928 bytes

Another card with the same size of 16GB delivers for example
Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
So you can copy the first image to the second SD card but not vice versa.
 
Solution:
1) Use a larger SD card
2) Squeeze the source image. pishrink is a nice tool for this.
3) Create the backup with parameter DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY (See also FAQ16)
 
27) I have a tar or rsync backup and want to create a dd backup
There exists a script raspiBackupRestore2Image.sh which can be found here. It's creating a dd backup from a tar or rsync backup.
 
Add comment
Note
eMail is hidden and not visible to the public. It's used to inform you about new comments.