File SLE12-SP1-btrfs-example.conf of Package rear1172a.32115
# Begin example setup for SLE12-SP1 with default btrfs subvolumes.
# On SLE12-SP1 what is mounted at '/' is a btrfs snapshot subvolume
# see https://github.com/rear/rear/issues/556
# You must adapt "your.NFS.server.IP/path/to/your/rear/backup" at BACKUP_URL.
# You must decide whether or not you want to have /home/* in the backup.
# It depends on the size of your harddisk whether or not /home is by default
# a btrfs subvolume or a separated xfs filesystem on a separated partition.
# You may activate SSH_ROOT_PASSWORD and adapt the "password_on_the_rear_recovery_system".
# For basic information see the SLE12-SP1 manuals.
# Also see the support database article "SDB:Disaster Recovery"
# at http://en.opensuse.org/SDB:Disaster_Recovery
# In particular note:
# There is no such thing as a disaster recovery solution that "just works".
# Regarding btrfs snapshots:
# Recovery of btrfs snapshot subvolumes is not possible.
# Only recovery of "normal" btrfs subvolumes is possible.
# On SLE12-SP1 the only exception is the btrfs snapshot subvolume
# that is mounted at '/' but that one is not recreated but instead
# it is created anew from scratch during the recovery installation with the
# default first btrfs snapper snapshot subvolume path "@/.snapshots/1/snapshot"
# by the SUSE tool "installation-helper --step 1" (cf. below).
# Other snapshots like "@/.snapshots/234/snapshot" are not recreated.
# Create rear rescue media as ISO image:
OUTPUT=ISO
# Store the backup file via NFS on a NFS server:
BACKUP=NETFS
# BACKUP_OPTIONS variable contains the NFS mount options and
# with 'mount -o nolock' no rpc.statd (plus rpcbind) are needed:
BACKUP_OPTIONS="nfsvers=3,nolock"
# If the NFS server is not an IP address but a hostname,
# DNS must work in the rear recovery system when the backup is restored.
BACKUP_URL=nfs://your.NFS.server.IP/path/to/your/rear/backup
# Keep an older copy of the backup in a HOSTNAME.old directory
# provided there is no '.lockfile' in the HOSTNAME directory:
NETFS_KEEP_OLD_BACKUP_COPY=yes
# Have all modules of the original system in the recovery system with the
# same module loading ordering as in the original system by using the output of
# lsmod | tail -n +2 | cut -d ' ' -f 1 | tac | tr -s '[:space:]' ' '
# as value for MODULES_LOAD (cf. https://github.com/rear/rear/issues/626):
#MODULES_LOAD=( )
# On SLE12-SP1 with default btrfs subvolumes what is mounted at '/' is a btrfs snapshot subvolume
# that is controlled by snapper so that snapper is needed in the recovery system.
# In SLE12-SP1 some btrfs subvolume directories (/var/lib/pgsql /var/lib/libvirt/images /var/lib/mariadb)
# have the "no copy on write (C)" file attribute set so that chattr is required in the recovery system
# and accordingly also lsattr is useful to have in the recovery system (but not strictly required):
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" snapper chattr lsattr )
# Snapper setup by the recovery system uses /usr/lib/snapper/installation-helper
# that is linked to all libraries where snapper is linked to
# (except libdbus that is only needed by snapper).
# "installation-helper --step 1" creates a snapper config based on /etc/snapper/config-templates/default
COPY_AS_IS=( "${COPY_AS_IS[@]}" /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
# Files in btrfs subvolumes are excluded by 'tar --one-file-system'
# so that such files must be explictly included to be in the backup.
# Files in the following SLE12-SP1 default btrfs subvolumes are
# in the below example not included to be in the backup
# /.snapshots/* /var/crash/*
# but files in /home/* are included to be in the backup.
# Note that not having '/tmp/*' in BACKUP_PROG_INCLUDE when there are
# matching entries in EXCLUDE_RECREATE like "fs:/tmp" would result
# that during restore a /tmp/rear.*/tmp/restore-exclude-list.txt file
# would contain the tar exclude patterns 'tmp' and 'tmp/*' so that
# also other files and directories that match those tar exclude patterns
# would not be restored (e.g. '/usr/tmp').
# You may use a command like
# findmnt -t btrfs | cut -d ' ' -f 1 | cut -s -d '-' -f2 | egrep -v 'snapshots|crash' | sed -e "s/$/\/*'/" -e "s/^/'/" | tr '\n' ' '
# to generate the values:
BACKUP_PROG_INCLUDE=( '/var/tmp/*' '/srv/*' '/var/lib/pgsql/*' '/var/spool/*' '/var/lib/libvirt/images/*' '/var/opt/*' '/tmp/*' '/var/lib/named/*' '/var/log/*' '/boot/grub2/i386/*' '/var/lib/mariadb/*' '/home/*' '/var/lib/mailman/*' '/opt/*' '/usr/local/*' '/boot/grub2/x86_64/*' )
# Also for every mounted btrfs subvolume exclude the mountpoint
# of the mounted btrfs subvolumes from component recreation
# see /usr/share/doc/packages/rear/user-guide/06-layout-configuration.txt
# and /usr/share/rear/conf/default.conf
# When /home is a separated filesystem remove "fs:/home" from the list below.
# You may use a command like
# findmnt -t btrfs | cut -d ' ' -f 1 | cut -s -d '-' -f2 | sed -e "s/$/'/" -e "s/^/'fs:/" | tr '\n' ' '
# to generate the values:
EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" 'fs:/var/tmp' 'fs:/srv' 'fs:/var/lib/pgsql' 'fs:/var/spool' 'fs:/var/lib/libvirt/images' 'fs:/var/opt' 'fs:/tmp' 'fs:/.snapshots' 'fs:/var/lib/named' 'fs:/var/log' 'fs:/boot/grub2/i386' 'fs:/var/lib/mariadb' 'fs:/home' 'fs:/var/crash' 'fs:/var/lib/mailman' 'fs:/opt' 'fs:/usr/local' 'fs:/boot/grub2/x86_64' )
# This option defines a root password to allow SSH connection
# whithout a public/private key pair
#SSH_ROOT_PASSWORD="password_on_the_rear_recovery_system"
# Let the rear recovery system run dhclient to get an IP address
# instead of using the same IP address as the original system:
#USE_DHCLIENT="yes"
# End example setup for SLE12-SP1 with default btrfs subvolumes.