UBC Physics & Astronomy

ReaR - Relax and Recover


Relax-andrRecover Website

Notes:

ReaR on the PHAS servers is configured by default to save the OUTPUT as an ISO and to do the BACKUP using RSYNC.
The files are all saved to borg:/tank2/ReaR/
phasor is saves OUTPUT to usb. See /etc/rear files on phasor for USB/RSYNC setups.

Hosts with ReaR Installed

Using a USB key with ReaR

If you previously formated the USB for use with ReaR but the USB is not listed by label, ie.
/dev/disk/by-label/REAR-000 doesn't exist

see where usb is mounted:
# dmesg | grep -i usb
(probably /dev/sdg)
# /usr/bin/gnome-disks&
- turn on automounting, and mount it
USB should now be mounted, eg mount | grep -i usb command shows:
/dev/sdg1 on /mnt/usb-Kingston_DT_Rubber_3.0_60A44C426596BD51D2130014-0:0-part1 type ext3 (rw,nosuid,nodev,relatime)

If this USB was previously formated for ReaR, then just redo the label:
# e2label /dev/sdg1 REAR-000

Should now be good to go.

If disk was not previously formated, run:
# rear format /dev/sdg

Install ReaR

Install cfg2html Now install ReaR
$ yum install rear

$ vim /etc/rear/local.conf
(see local.conf below)
$ rear -v mkrescue
$ rear -v mkbackuponly
$ rear -v mkbackup
$ cat /etc/rear/local.conf
# Default is to create Relax-and-Recover rescue media as ISO image
# set OUTPUT to change that
# set BACKUP to activate an automated (backup and) restore of your data
# Possible configuration values can be found in /usr/share/rear/conf/default.conf
#
# This file (local.conf) is intended for manual configuration. For configuration
# through packages and other automated means we recommend creating a new
# file named site.conf next to this file and to leave the local.conf as it is.
# Our packages will never ship with a site.conf.
#
##------------------------------------------------------------------------------------------------
# Create a bootable USB disk (using extlinux). Specify the USB storage device by using USB_DEVICE.
# NOTE: "USB" means any local block-storage device and includes also eSATA and other external disks
#OUTPUT=USB
#USB_DEVICE=/dev/disk/by-label/REAR-000
#BACKUP_URL=usb:///dev/sdg

##------------------------------------------------------------------------------------------------
OUTPUT=ISO
BACKUP=RSYNC
##
# RSYNC backup method uses rsync (using ssh or rsync) to make a backup to a remote network server
# prefix directory to create on the remote network filesystem
# default prefix is the short hostname
RSYNC_PREFIX="$HOSTNAME"
# RSYNC_PROTOCOL_VERSION=29 when rsync version <3.0, or 30 for newer releases (is auto-detected,
# but if you move from one rsync server to another it might become handy to known about this var)
RSYNC_PROTOCOL_VERSION=
BACKUP_URL=rsync://borg.phas.ubc.ca::ReaR           # using rsync
#
# The default rsync options passed (more can/will be added according workflow)
# You can use this variable to add your own options, e.g.
# BACKUP_RSYNC_OPTIONS=( "${BACKUP_RSYNC_OPTIONS[@]}" --devices --acls )
BACKUP_RSYNC_OPTIONS=(--sparse --archive --hard-links --numeric-ids --stats)
############

##
# How to exclude something ----- EXCLUDES -------
#
# You cannot exclude a device (e.g. /dev/sdg) directly. Instead you have to exclude everything
# ON that device and then the dependancy tracker will automatically exclude the device from the
# recovery (because there won't be any recovery information for that "unnecessary" device).
#
# Furthermore, you have to exclude MD devices and LVM2 volume groups separately as there is no
# automatic detection of these dependancies (yet, please write and submit it !)

# Exclude filesystems by specifying their mountpoints. Will be automatically added to the
# $BACKUP_PROG_EXCLUDE array during backup to prevent the excluded filesystems' data to
# be backed up
# examples: /tmp
#           /media/bigdisk
EXCLUDE_MOUNTPOINTS=( /mail /MailIndexes /unused )

# Exclude MD devices
# examples: /dev/md0
#           /dev/md/0
EXCLUDE_MD=()

# Exclude LVM2 volume groups. This will automatically exclude also the creation of the corresponding
# physical and logical volumes that belong to the excluded volume group.
#
# NOTE: YOU MUST ALSO EXCLUDE THE CORRESPONDING MOUNTPOINTS IN EXCLUDE_MOUNTPOINTS (see above)
#       OTHERWISE THE RECOVERY ***WILL*** TRY TO RECREATE THE FILESYSTEMS ONTO NON-EXISTING LVs
#
#       Y O U   H A V E   B E E N   W A R N E D  ! ! !
EXCLUDE_VG=()

### New Style include/excludes
## Exclude components from being backed up, recreation information is active
## rdp - this did not work for me, had to use EXCLUDE_MOUNTPOINTS
#EXCLUDE_BACKUP=( /mail /MailIndexes )