User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

Following pages describe different usage scenarios and configurations. They should help to find the right usage configuration out of the various configuration options of raspiBackup. Later on these usage scenarios can be customized further. An overview of all option is available here. The different ways to restore a backup are described here.

All configurations which don't use a dd backup save an external rootfilesystem together with the SD boot partition. If the USB bootmode is used and no SD card is used any more the whole rootpartition is also saved.

 

Usage scenarios described:

1a. A Windows user wants to backup his Raspberry and restore it with windisk32imager on Windows.

1b. A Windows user has a 32GB SD card but uses only 12GB and 12GB should be saved only.

1c. A Windows user wants to use pishrink to create a minimal backup image.

2. Raspberry should be saved very fast. Backuppartition is a nfs mounted EXT4 partition which is provided by a Synology.

3. Raspberry should be saved on a Samba mounted filesystem, which is provided by a Windows box.

4. A snapshot should be saved because there are some major changes planned and it should be possible to revert quickly.

5. A USB boot system backup should include an additional partition.

6. Raspberry should be saved on a local USB stick or a local USB disk.

 

 

raspiBackup - Usage- and configuration examples

 

1a. A Windows user wan't to backup his Raspberry and restore it with windisk32imager on Windows.

Just create a dd Image with raspiBackup. This one can be restored with windisk32imager.

DEFAULT_BACKUPTYPE=dd

DEFAULT_KEEPBACKUPS=n

 

1b. A Windows user has a 32GB SD card but uses only 12GB and 12GB should be saved only.

In addition to option mentioned in 1a use following option:

DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=1

But you also have to reduce the size of your rootpartition because otherwise the whole SD card will be saved. You have to use Linux tools like gparted or resize2fs to shrink your rootfilesystem.


1c. A Windows user wants to use pishrink to create a minimal backup image.

A minimal dd image can be created with pishrink. Use raspiBackupWrapper.sh which will shrink the dd image at the end. You also can use option

DEFAULT_ZIP_BACKUP=1

to reduce the image but this compressed dd image cannot be used by windisk32imager directly. Uncompress it first and then use win32diskimager for a restore.


2. Raspberry should be saved very fast. Backuppartition is a nfs mounted EXT4 partition which is provided by a Synology.

Mount your Synology first. Define in /etc/fstab the nfs partition and mount it on /backup.

DEFAULT_BACKUPTYPE=rsync

DEFAULT_KEEPBACKUPS=n

Because the filesystem is EXT4 formatted raspiBackup can use hardlinks which speeds up the backup process because only changed files are saved.

A sample entry in /etc/fstab may look like:

asterix:/backup    /backup    nfs    users,rw,sync,hard,intr,noauto,user    0    0
asterix is the hostname of the Synology and /backup is the exported nfs mount. Additional information about Synology specific configuration and any issues with Synology configuration is available here

 

3. Raspberry should be saved on a Samba mounted filesystem, which is provided by a Windows box.

DEFAULT_BACKUPTYPE=tar

DEFAULT_KEEPBACKUPS=n

Define the remote Windows backupfilesystem in /etc/fstab definiert and mount it on /backup. Every backup is a full backup. Note the filesystem on the samba driver has to support file sizes  > 4GB because tar files usually are > 4GB. Don't use FAT32 for this.

A sample entry in /etc/fstab may look like:

//asterix/backup/ /backup    cifs    noauto,noatime,user,utf8,umask=000,uid=1000,gid=1000,credentials=/etc/samba/auth.asterix.cifsuser 0 0

4. A snapshot should be saved because there are some major changes planned and it should be possible to revert quickly.

Use one of the previous configurations. Than call raspiBackup with option

-m "This is my snapshot just before upgrading my OS"

and you will get a backup in /backup which has exactly this name.

5. An USB boot system backup should include an additional partition.

USB boot systems require to use the partition oriented backup. In addition the number of partitions to backup has to be defined. In the example below it's partition 5 which also should be included in the backup.

DEFAULT_PARTITIONBASED_BACKUP=1

DEFAULT_BACKUPTYPE=rsync

DEFAULT_KEEPBACKUPS=n

DEFAULT_PARTITIONS_TO_BACKUP="1 2 5"

 

6. Raspberry should be saved on a local USB stick or a local USB disk.

DEFAULT_BACKUPTYPE=rsync

DEFAULT_KEEPBACKUPS=n

DEFAULT_BACKUPPATH="/USBStick"

Hardlinks are used onyl if the partition is formatted with ext3/4 and thus the backup will be very fast. If the partition was formatted with Windows use tar. But then it takes much longer to save the Raspberry and the backup will use much more backup space.

A sample entry in /etc/fstab may look like:

LABEL=usb    /USBStick    ext4     defaults,noatime,nofail        0    2

Add comment

*** Note ***

Comments are welcome. But in order to reject spam posts please consider following rules:
  1. Comments with string http are rejected with message You have no rights to use this tag
  2. All comments are reviewed by hand and thus it usually takes one day until a comment will be published.