Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 5 commits
  • 24 files changed
  • 0 commit comments
  • 1 contributor
View
26 Makefile
@@ -19,7 +19,7 @@ datadir = $(prefix)/share
mandir = $(datadir)/man
localstatedir = /var
-specfile = contrib/$(name).spec
+specfile = contrib/rpm/$(name).spec
DESTDIR =
OFFICIAL =
@@ -78,7 +78,7 @@ ifneq ($(git_date),)
rewrite:
@echo -e "\033[1m== Rewriting $(specfile) and $(rearbin) ==\033[0;0m"
sed -i.orig \
- -e 's#^Source:.*#Source: $(name)-$(distversion).tar.bz2#' \
+ -e 's#^Source:.*#Source: $(name)-$(distversion).tar.gz#' \
-e 's#^Version:.*#Version: $(version)#' \
-e 's#^%define rpmrelease.*#%define rpmrelease $(rpmrelease)#' \
$(specfile)
@@ -145,32 +145,36 @@ uninstall:
# rm -rv $(DESTDIR)$(sysconfdir)/rear/
# rm -rv $(DESTDIR)$(localstatedir)/lib/rear/
-dist: clean validate man rewrite $(name)-$(distversion).tar.bz2 restore
+dist: clean validate man rewrite $(name)-$(distversion).tar.gz restore
-$(name)-$(distversion).tar.bz2:
+$(name)-$(distversion).tar.gz:
@echo -e "\033[1m== Building archive $(name)-$(distversion) ==\033[0;0m"
git ls-tree -r --name-only --full-tree $(git_branch) | \
- tar -cjf $(name)-$(distversion).tar.bz2 --transform='s,^,$(name)-$(version)/,S' --files-from=-
+ tar -czf $(name)-$(distversion).tar.gz --transform='s,^,$(name)-$(version)/,S' --files-from=-
rpm: dist
@echo -e "\033[1m== Building RPM package $(name)-$(distversion)==\033[0;0m"
rpmbuild -tb --clean \
--define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
--define "debug_package %{nil}" \
- --define "_rpmdir %(pwd)" $(name)-$(distversion).tar.bz2
+ --define "_rpmdir %(pwd)" $(name)-$(distversion).tar.gz
+
+deb: dist
+ @echo -e "\033[1m== Building DEB package $(name)-$(distversion)==\033[0;0m"
+ @echo -e "Not implemented yet."
obs: BUILD_DIR = /tmp/rear-$(distversion)
-obs: obsname = $(shell osc ls $(obsproject) $(obspackage) | awk '/.tar.bz2$$/ { gsub(".tar.bz2$$","",$$1); print }')
+obs: obsname = $(shell osc ls $(obsproject) $(obspackage) | awk '/.tar.gz$$/ { gsub(".tar.gz$$","",$$1); print }')
obs: dist
@echo -e "\033[1m== Updating OBS from $(obsname) to $(name)-$(distversion)==\033[0;0m"
ifneq ($(obsname),$(name)-$(distversion))
-rm -rf $(BUILD_DIR)
mkdir -p $(BUILD_DIR)
osc co -c $(obsproject) $(obspackage) -o $(BUILD_DIR)
- -osc del $(BUILD_DIR)/*.tar.bz2
- cp $(name)-$(distversion).tar.bz2 $(BUILD_DIR)
- tar -xOjf $(name)-$(distversion).tar.bz2 -C $(BUILD_DIR) $(name)-$(version)/$(specfile) >$(BUILD_DIR)/$(name).spec
- osc add $(BUILD_DIR)/$(name)-$(distversion).tar.bz2
+ -osc del $(BUILD_DIR)/*.tar.bz2 $(BUILD_DIR)/*.tar.gz
+ cp $(name)-$(distversion).tar.gz $(BUILD_DIR)
+ tar -xOzf $(name)-$(distversion).tar.gz -C $(BUILD_DIR) $(name)-$(version)/$(specfile) >$(BUILD_DIR)/$(name).spec
+ osc add $(BUILD_DIR)/$(name)-$(distversion).tar.gz
osc ci -m "Update to $(name)-$(distversion)" $(BUILD_DIR)
rm -rf $(BUILD_DIR)
endif
View
0 contrib/PKGBUILD → contrib/arch/PKGBUILD
File renamed without changes.
View
50 contrib/debian/changelog
@@ -0,0 +1,50 @@
+rear (1.13.0-1) stable; urgency=low
+
+ * new features
+ * bugfixes
+
+ -- Dag Wieers <dag@wieers.com> Mon, Jun 25 2012 12:46:21 +0100
+
+rear (1.12.0-1) stable; urgency=low
+
+ * new features
+ * bugfixes
+ * see http://sourceforge.net/projects/rear/files/rear/1.12/1.12.0/rear-release-notes.txt/download for details
+
+ -- Schlomo Schapiro <rear-buildservice@schlomo.schapiro.org> Wed, 15 Feb 2012 11:02:03 +0100
+rear (1.11.0-11) stable; urgency=low
+
+ * new features
+ * bugfixes
+
+ -- Schlomo Schapiro <rear-buildservice@schlomo.schapiro.org> Sun, 23 May 2011 17:47:47 +0100
+rear (1.10.0-1) stable; urgency=low
+
+ * new features
+ * bugfixes
+
+ -- Schlomo Schapiro <rear-buildservice@schlomo.schapiro.org> Sun, 20 Mar 2011 11:55:54 +0100
+rear (1.7.23-1) stable; urgency=low
+
+ * bugfixes, mostly for x86_64
+ * openSUSE 11.2 validation
+ * no tests on Debian done :-(
+
+ -- Schlomo Schapiro <rear-buildservice@schlomo.schapiro.org> Fri, 09 Dec 2009 09:25:04 +0100
+rear (1.7.22-5) stable; urgency=low
+
+ * many bugfixes
+ * SLES11 validation
+ * no tests on Debian done :-(
+
+ -- Schlomo Schapiro <rear-buildservice@schlomo.schapiro.org> Wed, 02 Dec 2009 15:23:04 +0100
+rear (1.7.21-5) stable; urgency=low
+
+ * Update for openSUSE 11.2
+
+ -- Schlomo Schapiro <rear-buildservice@schlomo.schapiro.org> Sun, 28 Jun 2009 20:05:04 +0100
+rear (1.7.20-5) stable; urgency=low
+
+ * Initial Release
+
+ -- Schlomo Schapiro <rear-buildservice@schlomo.schapiro.org> Sun, 28 Jun 2009 20:05:04 +0100
View
10 contrib/debian/conffiles
@@ -0,0 +1,10 @@
+/etc/rear/local.conf
+/etc/rear/templates/RESULT_mailbody.txt
+/etc/rear/templates/rear.help
+/etc/rear/templates/EFI_readme.txt
+/etc/rear/templates/RESULT_usage_USB.txt
+/etc/rear/templates/PXE_pxelinux.cfg
+/etc/rear/templates/RESULT_usage_PXE.txt
+/etc/rear/templates/RESULT_usage_ISO.txt
+/etc/rear/templates/ISO_isolinux.cfg
+/etc/rear/site.conf
View
18 contrib/debian/control
@@ -0,0 +1,18 @@
+Package: rear
+Source: rear
+Section: misc
+Priority: optional
+Essential: no
+Maintainer: Dag Wieers <dag@wieers.com>
+Homepage: http://relax-and-recover.org/
+
+Architecture: all
+Provides: rear
+Build-Depends: debhelper (>= 4.1.16)
+Depends: mingetty, syslinux, ethtool, libc6, lsb-release, portmap, genisoimage, iproute, iputils-ping, nfs-client, binutils, parted
+
+Description: Relax and Recover is a bare metal disaster recovery and system
+ migration framework. See http://relax-and-recover.org/ for all the details.
+ We are still looking for a Debian package maintainer who would write better
+ packages. Please contact us to volunteer for maintaining Relax-and-Recover
+ in Debian and Ubuntu.
View
1 contrib/debian/copyright
View
10 contrib/debian/rear.dsc
@@ -0,0 +1,10 @@
+Format: 1.0
+Source: rear
+Version: 1.13.0
+Binary: rear
+Maintainer: Dag Wieers <dag@wieers.com>
+Architecture: all
+Build-Depends: debhelper (>= 4.1.16)
+Files:
+ 0d953ed2a2f1fec084a19dcebe560516 580929 rear_1.11.0.orig.tar.gz
+ 1234567890abcdef1234567890abcdef 123456 rear_1.11.0-7.diff.tar.gz
View
75 contrib/debian/rules
@@ -0,0 +1,75 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=4
+
+build: build-stamp
+build-stamp:
+ dh_testdir
+ # noop
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+ # noop
+ dh_clean
+
+# Build architecture-independent files here.
+binary-indep: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # The DESTDIR Has To Be Exactly debian/rear
+ mkdir -vp \
+ debian/rear/usr/share/man/man8/ \
+ debian/rear/usr/share/ \
+ debian/rear/etc/ \
+ debian/rear/usr/sbin/ \
+ debian/rear/var/log/rear/
+ debian/rear/var/lib/rear/
+
+ # copy rear components into directories
+ cp -av usr/share/rear debian/rear/usr/share/
+ cp -av usr/sbin/rear debian/rear/usr/sbin/
+ cp -av etc/rear debian/rear/etc/
+
+ # patch rear main script with correct locations for rear components
+ sed -i \
+ -e 's#^CONFIG_DIR=.*#CONFIG_DIR="/etc/rear"#' \
+ -e 's#^SHARE_DIR=.*#SHARE_DIR="/usr/share/rear"#' \
+ -e 's#^VAR_DIR=.*#VAR_DIR="/var/lib/rear"#' \
+ debian/rear/usr/sbin/rear
+
+ # update man page with correct locations
+ install -Dp -m0644 doc/rear.8 debian/rear/usr/share/man/man8/rear.8
+ sed -i \
+ -e 's#/usr/share/doc/packages#/usr/share/doc#' \
+ debian/rear/usr/share/man/man8/rear.8
+
+ # --- end custom part for installing
+
+ dh_installdocs README doc
+ dh_installchangelogs
+ dh_installman usr/share/rear/doc/rear.8
+ dh_link
+ dh_strip
+ dh_fixperms
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary
View
43 contrib/gentoo/rear.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+DESCRIPTION="Fully automated disaster recovery supporting a broad variety of backup strategies and scenarios"
+HOMEPAGE="http://relax-and-recover.org/"
+SRC_URI="mirror://github/downloads/rear/rear/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="udev"
+
+RDEPEND="net-dialup/mingetty
+ net-fs/nfs-utils
+ sys-apps/iproute2
+ sys-apps/lsb-release
+ sys-apps/util-linux
+ sys-block/parted
+ sys-boot/syslinux
+ virtual/cdrtools
+ udev? ( sys-fs/udev )
+"
+
+src_install () {
+ if use udev; then
+ insinto /lib/udev/rules.d
+ doins etc/udev/rules.d/62-rear-usb.rules
+ fi
+
+ insinto /etc
+ doins -r etc/rear/
+
+ # copy main script-file and docs
+ dosbin usr/sbin/rear
+ doman usr/share/rear/doc/rear.8
+ dodoc README
+
+ insinto /usr/share/
+ doins -r usr/share/rear/
+}
View
31 contrib/pidoftest.sh
@@ -1,31 +0,0 @@
-#!/bin/bash
-ME="$(type -p "$0" || readlink -f "$0")"
-
-p="$(type -p pidof)"
-
-if ! test "$p" ; then
- echo "ERROR: pidof is not installed on your system:"
- lsb_release -a || echo "ERROR: lsb_release not found!"
- exit 1
-fi
-
-# do not run if another instance is running. pidof -x will always report at least $$
-if [ $$ != "$("$p" -x "$ME")" ] ; then
- echo "$ME is already running, not starting again"
- exit 0
-else
- echo "Starting instance of $ME (sleeping 10sec)"
- if package=$(dpkg -S "$p" 2>/dev/null) ; then
- package="${package%%:*}"
- elif package=$(rpm -qf "$p" 2>/dev/null) ; then
- : noop
- else
- package="unknown packaging source"
- fi
- echo "pidof is '$p' and comes from '$package'"
- lsb_release -a 2>/dev/null || echo "ERROR: lsb_release not found!"
- # finish sleeping till this program ran 10 seconds
- while let "SECONDS<10" ; do sleep 1 ; done
-fi
-
-
View
2 contrib/rear.spec → contrib/rpm/rear.spec
@@ -95,7 +95,7 @@ removes any excuse for not having a disaster recovery solution implemented.
Professional services and support are available.
%prep
-%setup
+%setup -q
echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >rear.cron
View
3 doc/Makefile
@@ -5,13 +5,14 @@ mandir = $(datadir)/man
txttargets = $(shell echo *.txt)
htmltargets = $(patsubst %.txt, %.html, $(txttargets))
-all:
+all: docs
dist: docs
man: rear.8
docs: rear.8 $(htmltargets)
+ make -C user-guide docs
install: rear.8
install -Dp -m0644 rear.8 $(DESTDIR)$(mandir)/man8/rear.8
View
124 doc/user-guide/01-introduction.txt
@@ -0,0 +1,124 @@
+= Introduction
+
+Relax-and-Recover is the leading Open Source disaster recovery solution. It
+is a modular framework with many ready-to-go workflows for common situations.
+
+Relax-and-Recover produces a bootable image. This image can repartition the
+system. Once that is done it initiates a restore from backup. Restores to
+different hardware are possible. Relax-and-Recover can therefore be used as a
+migration tool as well.
+
+Currently Relax-and-Recover supports various boot media (incl. ISO, PXE,
+OBDR tape, USB or eSATA storage), a variety of network protocols (incl.
+sftp, ftp, http, nfs, cifs) as well as a multitude of backup strategies
+(incl. IBM TSM, HP DataProtector, Symantec NetBackup, Bacula, rsync).
+
+Relax-and-Recover was designed to be easy to set up, requires no maintenance
+and is there to assist when disaster strikes. Its setup-and-forget nature
+removes any excuse for not having a disaster recovery solution implemented.
+
+Recovering from disaster is made very straight-forward by a 2-step recovery
+process so that it can be executed by operational teams when required.
+When used interactively (e.g. when used for migrating systems), menus help
+make decisions to restore to a new (hardware) environment.
+
+Extending and integrating Relax-and-Recover into complex environments is made
+possible by its modular framework. Consistent logging and optionally extended
+output help understand the concepts behind Relax-and-Recover, troubleshoot
+during initial configuration and help debug during integration.
+
+Professional services and support are available.
+
+
+== Relax-and-Recover project
+The support and development of the Relax-and-Recover project takes place
+on Github:
+
+Relax-and-Recover website::
+ http://relax-and-recover.org/
+
+Github project::
+ http://github.com/rear/rear/
+
+In case you have questions, ideas or feedback about this document, you
+can contact the development team on the Relax-and-Recover mailinglist at:
+rear-users@lists.relax-and-recover.org.
+
+NOTE: Note that you have to be subscribed to be able to send mails to the
+Relax-and-Recover mailinglist ! You can subscribe to the list at:
+http://lists.relax-and-recover.org/mailman/listinfo/rear-users
+
+
+== Design concepts
+At the start of the project a set of groundrules were defined and over time
+improved:
+
+ - Focus on Disaster Recovery
+ - Modular design
+ - For Linux (and possibly other Unix-like operating systems)
+ - Few external dependencies (Bash and standard Unix tools)
+ - Easy to use and easy to extend
+
+The aim is to make Relax-and-Recover as least demanding as possible, it will
+require only the applications neccessary to fulfill the job Relax-and-Recover
+is configured for.
+
+Furthermore, Relax-and-Recover should be platform independant and ideally
+install just as a set of scripts that utilizes everything that the Linux OS
+provides.
+
+
+== Features and functionality
+Relax-and-Recover has a wide range of features:
+
+// FIXME: Insert the various features from the Release Notes +
+// include the information from the presentations +
+// and optionally the rescue creation and recovery workflow
+// FIXME: Get rid of the below list when everything is in the feature set
+
+ - Improvements to HP SmartArray and CCISS driver integration
+ - Improvements to software RAID integration
+ - Disk layout change detection for monitoring
+ - One-Button-Disaster-Recovery (OBDR) tape support
+ - DRBD filesystem support
+ - Bacula tape support
+ - Multiple DR images per system on single USB storage device
+ - USB ext3/ext4 support
+ - GRUB bootloader re-implementation
+ - Add Relax-and-Recover entry to local GRUB configuration
+ - Nagios and webmin integration
+ - Syslinux boot menu
+ - Storing rescue/backup logfile on rescue media
+ - Restoring to different hardware
+ - RHEL4, RHEL5 and RHEL6 support
+ - Various usability improvements
+ - Serial console support auto-detected
+ - Lockless workflows
+ - USB udev integration to trigger mkrescue on inserting USB device
+ - Beep/UID led/USB suspend integration
+
+== Use-cases
+
+=== Transforming a system to use LUKS partitions
+=== Recreate a system for optimal partition alignment
+=== Transforming a system to move from SWRAID to HWRAID
+=== Transforming a system to move from SWRAID to LVM mirroring
+=== Recreate a system on a new RAID hardware backend (replace all disks to enlarge limited storage)
+=== Create a single snapshot for offsite troubleshooting
+
+== Tested configurations
+During development we have tested Relax-and-Recover with the following
+configurations:
+
+ - With USB storage as rescue and Bacula backup on tape
+ - With USB storage as rescue and backup on same USB storage
+ - With OBDR tape as rescue and Bacula backup on separate tape
+ - With OBDR tape as rescue and backup on same tape
+
+And in the following ways:
+
+ - Booting from second disk in SW RAID1 setup
+ - Restoring to different storage configuration
+ - Restoring to different hardware
+ - Restoring to bad HP SmartArray config
+
View
81 doc/user-guide/02-getting-started.txt
@@ -0,0 +1,81 @@
+// FIXME: Make this part more generic and add distribution information
+
+= Getting started
+
+== Software requirements
+Relax-and-Recover can be installed from a native RPM package. Since it is
+mostly a collection of Bash scripts, there is no need to make RPM packages
+for each Red Hat release. For the supported RHEL distributions it is mostly
+version-agnostic.
+
+Relax-and-Recover has few dependencies:
+
+ - recent syslinux (tested with 4.0)
+
+For OBDR tape mode you need the following packages:
+
+ - lsscsi
+ - mkisofs
+ - sg3_utils
+
+Relax-and-Recover at this time has only been tested on RHEL4, RHEL5 and RHEL6.
+
+
+== Limitations
+Relax-and-Recover offers a lot of flexibility in various use-cases, however it
+does have some limitations under certain circumstances:
+
+ - Relax-and-Recover depends on the software of the running system. When
+ recovering this system to newer hardware, it is possible that the hardware
+ support of the original system does not support the newer hardware.
++
+This problem has been seen when restoring an older RHEL4 with an older HP
+Proliant Support Pack (PSP) to more recent hardware. This PSP did not detect
+the newer HP SmartArray controller or its firmware.
+
+ - Relax-and-Recover supports recovering to different hardware, but it cannot
+ always automatically adapt to this new environment. In such cases it
+ requires a manual intervention to eg.
+
+ * modify the _disklayout.conf_ to indicate the number of controller, disks
+ or specific custom desires during restore
+
+ * reduce the partition-sizes/LV-sizes when restoring to smaller storage
+
+ * pull network-media or configure the network interfaces manually
+
+ - Depending on your back-up strategy you may have to perform actions, like:
+
+ * insert the required tape(s)
+
+ * perform commands to restore the backup
+
+
+== Installation
+
+=== From RPM packages
+Simply install (or update) the provided packages using
+the command: +rpm -Uhv rear-1.12.0svn497-0.1.noarch.rpm+
+
+You can test your installation by running +rear dump+:
+
+----
+[root@system ~]# rear dump
+Relax-and-Recover 1.12.0svn497 / 2011-07-11
+Dumping out configuration and system information
+System definition:
+ ARCH = Linux-x86_64
+ OS = GNU/Linux
+ OS_VENDOR = RedHatEnterpriseServer
+ OS_VERSION = 5.6
+...
+----
+
+=== From DEB packages
+
+
+=== From source
+
+== File locations
+
+== Quick demo
View
140 doc/user-guide/03-configuration.txt
@@ -0,0 +1,140 @@
+= Configuration
+The configuration is performed by changing _/etc/rear/local.conf_ or
+_/etc/rear/site.conf_.
+
+There are two important variables that influence Relax-and-Recover and
+the rescue image. Set +OUTPUT+ to your preferred boot method and define
++BACKUP+ for your favorite +BACKUP+ strategy.
+
+In most cases only these two settings are required.
+
+
+== Rescue media (OUTPUT)
+The +OUTPUT+ variable defines where the rescue image should be send to.
+Possible +OUTPUT+ setting are:
+
+OUTPUT=RAMDISK::
+Copy the kernel and the initramfs containing the rescue system to a selected
+location.
+
+OUTPUT=ISO::
+Create a bootable ISO9660 image on disk as _rear-$(hostname).iso_
+
+OUTPUT=PXE::
+Create on a remote PXE/NFS server the required files (such as configuration
+file, kernel and initrd image
+
+OUTPUT=OBDR::
+Create a bootable OBDR tape including the backup archive. Specify the OBDR
+tape device by using +TAPE_DEVICE+.
+
+OUTPUT=USB::
+Create a bootable USB disk (using extlinux). Specify the USB storage device by
+using +USB_DEVICE+.
+
+=== Using ISO as output method
+When using +OUTPUT=ISO+ or +OUTPUT=RAMDISK+ you should provide the backup target
+location through the +OUTPUT_URL+ variable. Possible +OUTPUT_URL+ settings are:
+
+OUTPUT_URL=file://::
+Write the ISO image to disk. The default is in _/var/lib/rear/output/_.
+
+OUTPUT_URL=fish//::
+Write the ISO image using +lftp+ and the FISH protocol.
+
+OUTPUT_URL=ftp://::
+Write the ISO image using +lftp+ and the FTP protocol.
+
+OUTPUT_URL=ftps://::
+Write the ISO image using +lftp+ and the FTPS protocol.
+
+OUTPUT_URL=hftp://::
+Write the ISO image using +lftp+ and the HFTP protocol.
+
+OUTPUT_URL=http://::
+Write the ISO image using +lftp+ and the HTTP (PUT) procotol.
+
+OUTPUT_URL=https://::
+Write the ISO image using +lftp+ and the HTTPS (PUT) protocol.
+
+OUTPUT_URL=sftp://::
+Write the ISO image using +lftp+ and the secure FTP (SFTP) protocol.
+
+OUTPUT_URL=rsync://::
+Write the ISO image using +rsync+ and the RSYNC protocol.
+
+
+== Backup/Restore strategy (BACKUP)
+The +BACKUP+ setting defines our backup/restore strategy.
+Possible +BACKUP+ settings are:
+
+BACKUP=TSM::
+Use IBM Tivoli Storage Manager programs
+
+BACKUP=DP::
+Use HP DataProtector programs
+
+BACKUP=NBU::
+Use Symantec NetBackup programs
+
+BACKUP=BACULA::
+Use Bacula programs
+
+BACKUP=GALAXY::
+Use CommVault Galaxy (5, probably 6)
+
+BACKUP=GALAXY7::
+Use CommVault Galaxy (7 and probably newer)
+
+BACKUP=NETFS::
+Use Relax-and-Recover internal backup with tar or rsync (or similar)
+
+BACKUP=REQUESTRESTORE::
+No backup, just ask user to somehow restore the filesystems
+
+BACKUP=EXTERNAL::
+Use a custom strategy by providing backup and restore commands
+
+== Using NETFS as backup strategy
+When using +BACKUP=NETFS+ you should provide the backup target location through
+the +BACKUP_URL+ variable. Possible +BACKUP_URL+ settings are:
+
+BACKUP_URL=file://::
+To backup to local disk, use +BACKUP_URL=file:///directory/path/+
+
+BACKUP_URL=nfs://::
+To backup to NFS disk, use +BACKUP_URL=nfs://nfs-server-name/share/path+
+
+BACKUP_URL=tape://::
+To backup to tape device, use +BACKUP_URL=tape:///dev/nst0+ or alternatively,
+simply define +TAPE_DEVICE=/dev/nst0+
+
+BACKUP_URL=cifs://::
+To backup to a Samba share (CIFS), use
++BACKUP_URL=cifs://cifs-server-name/share/path+. To provide credentials for
+CIFS mounting use a _/etc/rear/.cifs_ credentials file and define
++BACKUP_OPTIONS="cred=/etc/rear/.cifs"+ and pass along:
++
+----
+username=_username_
+password=_secret password_
+domain=_domain_
+----
+
+BACKUP_URL=usb://::
+To backup to USB storage device, use +NETFS=usb:///dev/disk/by-label/REAR-000+
+or use a real device node or a specific filesystem label. Alternatively, you
+can specify the device using +USB_DEVICE=/dev/disk/by-label/REAR-000+.
++
+If you combine this with +OUTPUT=USB+ you will end up with a bootable USB device.
+
+Optional settings:
+
+BACKUP_PROG=rsync::
+if you want to use rsync instead of tar
+
+NETFS_KEEP_OLD_BACKUP_COPY=y::
+if you want to keep the previous backup archive
+
+NOTE: With +USB+ we refer to all kinds of external storage devices, like USB
+keys, USB disks, eSATA disks, ZIP drives, etc...
View
633 doc/rear-documentation.txt → doc/user-guide/04-scenarios.txt
@@ -1,339 +1,11 @@
-= Relax-and-Recover: User guide
-:author: Dag Wieers and Jeroen Hoekx
-:version: 0.4 draft
-:data-uri:
-:doctype: book
-:encoding: UTF-8
-:numbered:
-:toc:
-:toclevels: 2
-
-This document describes everything there is to know regarding
-Relax-and-Recover, an Open Source bare-metal disaster recovery and system
-migration solution designed for Linux.
-
-
-== Introduction
-Relax-and-Recover is the leading Open Source disaster recovery solution. It
-is a modular framework with many ready-to-go workflows for common situations.
-
-Relax-and-Recover produces a bootable image. This image can repartition the
-system. Once that is done it initiates a restore from backup. Restores to
-different hardware are possible. Relax-and-Recover can therefore be used as a
-migration tool as well.
-
-Currently Relax-and-Recover supports various boot media (incl. ISO, PXE,
-OBDR tape, USB or eSATA storage), a variety of network protocols (incl.
-sftp, ftp, http, nfs, cifs) as well as a multitude of backup strategies
-(incl. IBM TSM, HP DataProtector, Symantec NetBackup, Bacula, rsync).
-
-Relax-and-Recover was designed to be easy to set up, requires no maintenance
-and is there to assist when disaster strikes. Its setup-and-forget nature
-removes any excuse for not having a disaster recovery solution implemented.
-
-Recovering from disaster is made very straight-forward by a 2-step recovery
-process so that it can be executed by operational teams when required.
-When used interactively (e.g. when used for migrating systems), menus help
-make decisions to restore to a new (hardware) environment.
-
-Extending and integrating Relax-and-Recover into complex environments is made
-possible by its modular framework. Consistent logging and optionally extended
-output help understand the concepts behind Relax-and-Recover, troubleshoot
-during initial configuration and help debug during integration.
-
-Professional services and support are available.
-
-
-== Relax-and-Recover project
-The support and development of the Relax-and-Recover project takes place
-on Github:
-
-Relax-and-Recover website::
- http://relax-and-recover.org/
-
-Github project::
- http://github.com/rear/rear/
-
-In case you have questions, ideas or feedback about this document, you
-can contact the development team on the Relax-and-Recover mailinglist at:
-rear-users@lists.relax-and-recover.org.
-
-NOTE: Note that you have to be subscribed to be able to send mails to the
-Relax-and-Recover mailinglist ! You can subscribe to the list at:
-http://lists.relax-and-recover.org/mailman/listinfo/rear-users
-
-
-== Design concepts
-At the start of the project a set of groundrules were defined and over time
-improved:
-
- - Focus on Disaster Recovery
- - Modular design
- - For Linux (and possibly other Unix-like operating systems)
- - Few external dependencies (Bash and standard Unix tools)
- - Easy to use and easy to extend
-
-The aim is to make Relax-and-Recover as least demanding as possible, it will
-require only the applications neccessary to fulfill the job Relax-and-Recover
-is configured for.
-
-Furthermore, Relax-and-Recover should be platform independant and ideally
-install just as a set of scripts that utilizes everything that the Linux OS
-provides.
-
-
-== Features and functionality
-Relax-and-Recover has a wide range of features:
-
-// FIXME: Insert the various features from the Release Notes +
-// include the information from the presentations +
-// and optionally the rescue creation and recovery workflow
-// FIXME: Get rid of the below list when everything is in the feature set
-
- - Improvements to HP SmartArray and CCISS driver integration
- - Improvements to software RAID integration
- - Disk layout change detection for monitoring
- - One-Button-Disaster-Recovery (OBDR) tape support
- - DRBD filesystem support
- - Bacula tape support
- - Multiple DR images per system on single USB storage device
- - USB ext3/ext4 support
- - GRUB bootloader re-implementation
- - Add Relax-and-Recover entry to local GRUB configuration
- - Nagios and webmin integration
- - Syslinux boot menu
- - Storing rescue/backup logfile on rescue media
- - Restoring to different hardware
- - RHEL4, RHEL5 and RHEL6 support
- - Various usability improvements
- - Serial console support auto-detected
- - Lockless workflows
- - USB udev integration to trigger mkrescue on inserting USB device
- - Beep/UID led/USB suspend integration
-
-
-== Installing Relax-and-Recover
-
-
-// FIXME: Make this part more generic and add distribution information
-
-=== Software requirements
-Relax-and-Recover can be installed from a native RPM package. Since it is
-mostly a collection of Bash scripts, there is no need to make RPM packages
-for each Red Hat release. For the supported RHEL distributions it is mostly
-version-agnostic.
-
-Relax-and-Recover has few dependencies:
-
- - recent syslinux (tested with 4.0)
-
-For OBDR tape mode you need the following packages:
-
- - lsscsi
- - mkisofs
- - sg3_utils
-
-Relax-and-Recover at this time has only been tested on RHEL4, RHEL5 and RHEL6.
-
-
-=== Limitations
-Relax-and-Recover offers a lot of flexibility in various use-cases, however it
-does have some limitations under certain circumstances:
-
- - Relax-and-Recover depends on the software of the running system. When
- recovering this system to newer hardware, it is possible that the hardware
- support of the original system does not support the newer hardware.
-+
-This problem has been seen when restoring an older RHEL4 with an older HP
-Proliant Support Pack (PSP) to more recent hardware. This PSP did not detect
-the newer HP SmartArray controller or its firmware.
-
- - Relax-and-Recover supports recovering to different hardware, but it cannot
- always automatically adapt to this new environment. In such cases it
- requires a manual intervention to eg.
-
- * modify the _disklayout.conf_ to indicate the number of controller, disks
- or specific custom desires during restore
-
- * reduce the partition-sizes/LV-sizes when restoring to smaller storage
-
- * pull network-media or configure the network interfaces manually
-
- - Depending on your back-up strategy you may have to perform actions, like:
-
- * insert the required tape(s)
-
- * perform commands to restore the backup
-
-
-=== RPM installation
-Simply install (or update) the provided packages using
-the command: +rpm -Uhv rear-1.12.0svn497-0.1.noarch.rpm+
-
-You can test your installation by running +rear dump+:
-
-----
-[root@system ~]# rear dump
-Relax-and-Recover 1.12.0svn497 / 2011-07-11
-Dumping out configuration and system information
-System definition:
- ARCH = Linux-x86_64
- OS = GNU/Linux
- OS_VENDOR = RedHatEnterpriseServer
- OS_VERSION = 5.6
-...
-----
-
-
-== Overview
-// FIXME: Describe the concept behind Relax-and-Recoverar +
-// - Creating a rescue environment (bootable media and optionally backup) +
-// - Restoring from booted media
-
-
-== Configuration
-The configuration is performed by changing _/etc/rear/local.conf_ or
-_/etc/rear/site.conf_.
-
-There are two important variables that influence Relax-and-Recover and
-the rescue image. Set +OUTPUT+ to your preferred boot method and define
-+BACKUP+ for your favorite +BACKUP+ strategy.
-
-In most cases only these two settings are required.
-
-
-=== Rescue media (OUTPUT)
-The +OUTPUT+ variable defines where the rescue image should be send to.
-Possible +OUTPUT+ setting are:
-
-OUTPUT=RAMDISK::
-Copy the kernel and the initramfs containing the rescue system to a selected
-location.
-
-OUTPUT=ISO::
-Create a bootable ISO9660 image on disk as _rear-$(hostname).iso_
-
-OUTPUT=PXE::
-Create on a remote PXE/NFS server the required files (such as configuration
-file, kernel and initrd image
-
-OUTPUT=OBDR::
-Create a bootable OBDR tape including the backup archive. Specify the OBDR
-tape device by using +TAPE_DEVICE+.
-
-OUTPUT=USB::
-Create a bootable USB disk (using extlinux). Specify the USB storage device by
-using +USB_DEVICE+.
-
-==== Using ISO as output method
-When using +OUTPUT=ISO+ or +OUTPUT=RAMDISK+ you should provide the backup target
-location through the +OUTPUT_URL+ variable. Possible +OUTPUT_URL+ settings are:
-
-OUTPUT_URL=file://::
-Write the ISO image to disk. The default is in _/var/lib/rear/output/_.
-
-OUTPUT_URL=fish//::
-Write the ISO image using +lftp+ and the FISH protocol.
-
-OUTPUT_URL=ftp://::
-Write the ISO image using +lftp+ and the FTP protocol.
-
-OUTPUT_URL=ftps://::
-Write the ISO image using +lftp+ and the FTPS protocol.
-
-OUTPUT_URL=hftp://::
-Write the ISO image using +lftp+ and the HFTP protocol.
-
-OUTPUT_URL=http://::
-Write the ISO image using +lftp+ and the HTTP (PUT) procotol.
-
-OUTPUT_URL=https://::
-Write the ISO image using +lftp+ and the HTTPS (PUT) protocol.
-
-OUTPUT_URL=sftp://::
-Write the ISO image using +lftp+ and the secure FTP (SFTP) protocol.
-
-OUTPUT_URL=rsync://::
-Write the ISO image using +rsync+ and the RSYNC protocol.
-
-
-=== Backup/Restore strategy (BACKUP)
-The +BACKUP+ setting defines our backup/restore strategy.
-Possible +BACKUP+ settings are:
-
-BACKUP=TSM::
-Use IBM Tivoli Storage Manager programs
-
-BACKUP=DP::
-Use HP DataProtector programs
-
-BACKUP=NBU::
-Use Symantec NetBackup programs
-
-BACKUP=BACULA::
-Use Bacula programs
-
-BACKUP=GALAXY::
-Use CommVault Galaxy (5, probably 6)
-
-BACKUP=GALAXY7::
-Use CommVault Galaxy (7 and probably newer)
-
-BACKUP=NETFS::
-Use Relax-and-Recover internal backup with tar or rsync (or similar)
-
-BACKUP=REQUESTRESTORE::
-No backup, just ask user to somehow restore the filesystems
-
-BACKUP=EXTERNAL::
-Use a custom strategy by providing backup and restore commands
-
-==== Using NETFS as backup strategy
-When using +BACKUP=NETFS+ you should provide the backup target location through
-the +BACKUP_URL+ variable. Possible +BACKUP_URL+ settings are:
-
-BACKUP_URL=file://::
-To backup to local disk, use +BACKUP_URL=file:///directory/path/+
-
-BACKUP_URL=nfs://::
-To backup to NFS disk, use +BACKUP_URL=nfs://nfs-server-name/share/path+
-
-BACKUP_URL=tape://::
-To backup to tape device, use +BACKUP_URL=tape:///dev/nst0+ or alternatively,
-simply define +TAPE_DEVICE=/dev/nst0+
-
-BACKUP_URL=cifs://::
-To backup to a Samba share (CIFS), use
-+BACKUP_URL=cifs://cifs-server-name/share/path+. To provide credentials for
-CIFS mounting use a _/etc/rear/.cifs_ credentials file and define
-+BACKUP_OPTIONS="cred=/etc/rear/.cifs"+ and pass along:
-+
-----
-username=_username_
-password=_secret password_
-domain=_domain_
-----
-
-BACKUP_URL=usb://::
-To backup to USB storage device, use +NETFS=usb:///dev/disk/by-label/REAR-000+
-or use a real device node or a specific filesystem label. Alternatively, you
-can specify the device using +USB_DEVICE=/dev/disk/by-label/REAR-000+.
-+
-If you combine this with +OUTPUT=USB+ you will end up with a bootable USB device.
-
-Optional settings:
-
-BACKUP_PROG=rsync::
-if you want to use rsync instead of tar
-
-NETFS_KEEP_OLD_BACKUP_COPY=y::
-if you want to keep the previous backup archive
-
-NOTE: With +USB+ we refer to all kinds of external storage devices, like USB
-keys, USB disks, eSATA disks, ZIP drives, etc...
+// FIXME: Add the various scenarios, merge with configuration-examples.txt +
+// and the below content +
+// e.g. using different backup methods, +
+// using different output methods
+= Scenarios
-=== Example: Bootable ISO
+== Bootable ISO
If you simply want a bootable ISO on a central server, you would do:
----
@@ -342,7 +14,7 @@ OUTPUT_URL=http://server/path-to-push/
----
-=== Example: Bootable USB device with backup to USB
+== Bootable USB device with backup to USB
If you want a bootable USB device with a (tar) backup to USB as well, you
would use:
@@ -353,7 +25,7 @@ USB_DEVICE=/dev/disk/by-label/REAR-000
----
-=== Example: Bootable tape drive (OBDR) with backup to tape
+== Bootable tape drive (OBDR) with backup to tape
If you want an OBDR image and backup on tape, and use GNU tar for
backup/restore, you would use:
@@ -364,7 +36,7 @@ TAPE_DEVICE=/dev/nst0
----
-=== Example: Bootable tape drive (OBDR) and Bacula restore
+== Bootable tape drive (OBDR) and Bacula restore
If you want an OBDR image on tape, and the Bacula tools to recover your
backup, use:
@@ -374,13 +46,6 @@ OUTPUT=OBDR
TAPE_DEVICE=/dev/nst0
----
-
-== Scenarios
-// FIXME: Add the various scenarios, merge with configuration-examples.txt +
-// and the below content +
-// e.g. using different backup methods, +
-// using different output methods
-
== Using Relax-and-Recover with USB storage devices
Using USB devices with Relax-and-Recover can be appealing for several reasons:
@@ -1431,283 +1096,3 @@ Finished recovering your system. You can explore it under '/mnt/local'.
Finished in 361 seconds.
----
-
-== Tips and tricks using Relax-and-Recover
-Recovering a system should not be a struggle against time with poor
-tools weighing against you. Relax-and-Recover emphasizes on a relaxing
-recovery, and for this it follows three distinct rules:
-
- 1. Do what is generally expected, if possible
-
- 2. In doubt, ask the operator or allow intervention
-
- 3. Provide an environment that is as convenient as possible
-
-This results in the following useful tips and tricks:
-
-[TIP]
-====
- 1. Relax-and-Recover adds its own GRUB menu entry to your local system's
- GRUB, which is convenient to restore a system without the need for an
- additional boot media. This only works if your system can (still)
- boot from the local disk and the disaster didn't destroy that disk.
- To protect accidental recovery, you need to enter the password:
- *REAR*
-
- 2. Relax-and-Recover automatically detects and enables serial console support.
- This is extremely useful if the only way to access the console during
- disaster is a Java-based console riddled with keyboard bugs and slow screen
- refreshes.
-
- 3. Relax-and-Recover conveniently ships with a set of useful commands in its
- shell history. This makes it possible to quickly look for a command to help
- troubleshoot, or modify an important file during recovery.
-
- 4. If you have keyboard problems using a HP iLO 2 Remote Console, type the
- following command +loadkeys -d+ (or simply use the up arrow key to get
- this command from your shell history).
-
- 5. If the original system was configured to log on remotely through the use
- of SSH keys, Relax-and-Recover preserved those keys on the rescue
- environment and you can access the rescue environment from the network
- as you were used to before.
-
- 6. During recovery at any stage you can re-run Relax-and-Recovery, modify
- the layout file for recreating the structure and intervene when restoring
- the backup.
-====
-
-
-== Monitoring your system with Relax-and-Recover
-If Relax-and-Recover is not in charge of the backup, but only for creating
-a rescue environment, it can be useful to know when a change to the system
-invalidates your existing/stored rescue environment, requiring one to update
-the rescue environment.
-
-For this, Relax-and-Recover has two different targets, one to create a new
-baseline (which is automatically done when creating a new rescue environment
-successfully. And one to verify the (old) baseline to the current situation.
-
-With this, one can monitor or automate generating new rescue environments only
-when it is really needed.
-
-
-=== Creating a baseline
-Relax-and-Recover automatically creates a new baseline as soon as it
-successfully has created a new rescue environment. However if for some reason
-you want to recreate the baseline manually, use +rear savelayout+.
-
-
-=== Detecting changes to the baseline
-When you want to know if the latest rescue environment is still valid, you may
-want to use the +rear checklayout+ command instead.
-
-----
-[root@system ~]# rear checklayout
-[root@system ~]# echo $?
-0
-----
-
-If the layout has changed, the return code will indicate this by a non-zero
-return code.
-
-----
-[root@system ~]# rear checklayout
-[root@system ~]# echo $?
-1
-----
-
-
-=== Integration with Nagios and Opsview
-If having current DR rescue images is important to your organisation, but they
-cannot be automated (eg. a tape or USB device needs inserting), we provide a
-Nagios plugin that can send out a notification whenever there is a critical
-change to the system that requires updating your rescue environment.
-
-Changes to the system requiring an update are:
-
- - Changes to hardware RAID
- - Changes to software RAID
- - Changes to partitioning
- - Changes to DRBD configuration
- - Changes to LVM
- - Changes to filesystems
-
-The integration is done using our own _check_rear_ plugin for Nagios.
-
-[source,bash]
-----
-#!/bin/bash
-#
-# Purpose: Checks if disaster recovery usb stick is up to date
-
-# Check if rear is installed
-if [[ ! -x /usr/sbin/rear ]]; then
- echo "REAR IS NOT INSTALLED"
- exit 2
-fi
-
-# rear disk layout status can be identical or changed
-# returncode: 0 = ok
-if ! /usr/sbin/rear checklayout; then
- echo "Disk layout has changed. Please insert Disaster Recovery USB stick into system !"
- exit 2
-fi
-----
-
-We also monitor the _/var/log/rear/rear-system.log_ file for +ERROR:+ and +BUG BUG BUG+
-strings, so that in case of problems the operator is notified immediately.
-
-
-== Tested configurations
-During development we have tested Relax-and-Recover with the following
-configurations:
-
- - With USB storage as rescue and Bacula backup on tape
- - With USB storage as rescue and backup on same USB storage
- - With OBDR tape as rescue and Bacula backup on separate tape
- - With OBDR tape as rescue and backup on same tape
-
-And in the following ways:
-
- - Booting from second disk in SW RAID1 setup
- - Restoring to different storage configuration
- - Restoring to different hardware
- - Restoring to bad HP SmartArray config
-
-
-== Design and implementation
-// FIXME: This chapter explains the concepts and implementation details +
-// This should include the layout information from Jeroen
-
-
-== Troubleshooting Relax-and-Recover
-If you encounter a problem, you may find more information in the log file
-which is located at _/var/log/rear/rear-system.log_. During recovery the backup
-log file is also available from _/var/log/rear/_, for your convenience the
-history in rescue mode comes with useful commands for debugging, use the up
-arrow key in the shell to find those commands.
-
-There are a few options in Relax-and-Recover to help you debug the situation:
-
- - use the +-v+ option to show progress output during execution
- - use the +-d+ option to have debug information in your log file
- - use the +-s+ option to see what scripts Relax-and-Recover would be using;
- this is useful to understand how Relax-and-Recover is working internally
- - use the +-S+ option to step through each individual script when
- troubleshooting
- - use the +-D+ option to dump every function call to log file; this is very
- convenient during development or when troubleshooting Relax-and-Recover
-
-
-=== During backup
-During backup Relax-and-Recover creates a description of your system layout
-in one file (_disklayout.conf_) and stores this as part of its rescue image.
-This file describes the configuration of SmartArray RAID, parititions,
-software RAID, DRBD, logical volumes, filesystems, and possibly more.
-
-Here is a list of known issues during backup:
-
-[qanda]
-One or more HP SmartArray controllers have errors::
-+
---
-Relax-and-Recover had detected that one of your HP SmartArray controllers is
-in ERROR state and as a result it can not trust the information returned from
-that controller. This can be dangerous because we cannot guarantee that the
-disk layout is valid when recovering the system.
-
-We discovered that this problem can be caused by a controller that still
-has information in its cache that has not been flushed and the only way to
-solve it was to reboot the system and pressing F2 during the controller
-initialisation when it reports this problem.
---
-
-USB sticks disappear and re-appear with difference device name::
-+
---
-We have had issues before with a specific batch of JetFlash USB sticks
-which, during write operations, reset the USB controller because of a bug
-in the Linux kernel. The behaviour is that the device disappears (during
-write operations!) and reappears with a different device name. The result
-is that the filesystem becomes corrupt and the stick cannot be used.
-
-To verify if the USB stick has any issues like this, we recommend using
-the +f3+ tool on Linux or the +h2testw+ tool on Windows. If this tool
-succeeds in a write and verify test, the USB stick is reliable.
---
-
-
-=== During recovery
-During restore Relax-and-Recover uses the saved system layout as the basis for
-recreating a workable layout on your new system. If your new hardware is very
-different, it's advised to copy the layout file
-_/var/lib/rear/layout/disklayout.conf_ to _/etc/rear_ and modify it according
-to what is required.
-
-----
-cp /var/lib/rear/layout/disklayout.conf /etc/rear/
-vi /etc/rear/disklayout.conf
-----
-
-Then restart the recovery process: +rear recover+
-
-During the recovery process, Relax-and-Recover translates this layout file
-into a shell procedure (_/var/lib/rear/layout/diskrestore.sh_) that contains
-all the needed instructions for recreating your desired layout.
-
-If Relax-and-Recover comes across irreconcilable differences, it provides you
-with a small menu of options you have. In any case you can Abort the menu, and
-retry after cleaning up everything Relax-and-Recover may already have done, incl.
-+mdadm --stop --scan+ or +vgchange -a n+.
-
-In any case, you will have to look into the issue, see what goes wrong and
-either fix the layout file (_disklayout.conf_) and restart the recovery
-process (+rear recover+) or instead fix the shell procedure (_diskrestore.sh_)
-and choose +Retry+.
-
-WARNING: Customizations to the shell procedure (_diskrestore.sh_) get
- lost when restarting +rear recover+.
-
-
-Here is a list of known issues during recovery:
-
-[qanda]
-Failed to clear HP SmartArray controller 1::
-+
---
-This error may be caused by trying to clear an HP SmartArray controller
-that does not have a configuration or does not exist. Since we have no
-means to know whether this is a fatal condition or not we simply try to
-recreate the logical drive(s) and see what happens.
-
-This message is harmless, but may help troubleshoot the subsequent error
-message.
---
-
-An error has been detected during restore::
-+
---
-The (generated) layout restore script _/var/lib/rear/layout/diskrestore.sh_
-was not able to perform all necessary steps without error. The system will
-provide you with a menu allowing you to fix the _diskrestore.sh_ script
-manually and continue from where it left off.
-
- Cannot create array. Cannot add physical drive 2I:1:5
- Could not configure the HP SmartArray controllers
-
-When the number of physical or logical disks are different, or when other
-important system characteristics that matter to recovery are incompatible,
-this will be indicated by a multitude of possible error-messages.
-Relax-and-Recover makes it possible to recover also in these cases by hand.
-
-You can find more information about your HP SmartArray setup by running one of
-the following commands:
-
- # hpacucli ctrl all show detail
- # hpacucli ctrl all show config
- # hpacucli ctrl all show config detail
---
-
-TIP: You can find these commands as part of the history of the
-Relax-and-Recover shell.
View
81 doc/user-guide/05-integration.txt
@@ -0,0 +1,81 @@
+= Integration
+
+== Monitoring your system with Relax-and-Recover
+If Relax-and-Recover is not in charge of the backup, but only for creating
+a rescue environment, it can be useful to know when a change to the system
+invalidates your existing/stored rescue environment, requiring one to update
+the rescue environment.
+
+For this, Relax-and-Recover has two different targets, one to create a new
+baseline (which is automatically done when creating a new rescue environment
+successfully. And one to verify the (old) baseline to the current situation.
+
+With this, one can monitor or automate generating new rescue environments only
+when it is really needed.
+
+
+=== Creating a baseline
+Relax-and-Recover automatically creates a new baseline as soon as it
+successfully has created a new rescue environment. However if for some reason
+you want to recreate the baseline manually, use +rear savelayout+.
+
+
+=== Detecting changes to the baseline
+When you want to know if the latest rescue environment is still valid, you may
+want to use the +rear checklayout+ command instead.
+
+----
+[root@system ~]# rear checklayout
+[root@system ~]# echo $?
+0
+----
+
+If the layout has changed, the return code will indicate this by a non-zero
+return code.
+
+----
+[root@system ~]# rear checklayout
+[root@system ~]# echo $?
+1
+----
+
+
+=== Integration with Nagios and Opsview
+If having current DR rescue images is important to your organisation, but they
+cannot be automated (eg. a tape or USB device needs inserting), we provide a
+Nagios plugin that can send out a notification whenever there is a critical
+change to the system that requires updating your rescue environment.
+
+Changes to the system requiring an update are:
+
+ - Changes to hardware RAID
+ - Changes to software RAID
+ - Changes to partitioning
+ - Changes to DRBD configuration
+ - Changes to LVM
+ - Changes to filesystems
+
+The integration is done using our own _check_rear_ plugin for Nagios.
+
+[source,bash]
+----
+#!/bin/bash
+#
+# Purpose: Checks if disaster recovery usb stick is up to date
+
+# Check if rear is installed
+if [[ ! -x /usr/sbin/rear ]]; then
+ echo "REAR IS NOT INSTALLED"
+ exit 2
+fi
+
+# rear disk layout status can be identical or changed
+# returncode: 0 = ok
+if ! /usr/sbin/rear checklayout; then
+ echo "Disk layout has changed. Please insert Disaster Recovery USB stick into system !"
+ exit 2
+fi
+----
+
+We also monitor the _/var/log/rear/rear-system.log_ file for +ERROR:+ and +BUG BUG BUG+
+strings, so that in case of problems the operator is notified immediately.
View
24 doc/layoutman.txt → doc/user-guide/06-layout-configuration.txt
@@ -1,11 +1,11 @@
-Relax-and-Recover Layout Manual
-===============================
+// This document describes all aspects of the system disk layout generation in
+// Relax-and-Recover.
+
+= Layout configuration
Jeroen Hoekx <jeroen.hoekx@hamok.be>
2011-09-10
-This document describes all aspects of the system disk layout generation in Relax-and-Recover.
-
-== General overview ==
+== General overview
The disk layout generation code in Relax-and-Recover is responsible for the
faithful recreation of the disk layout of the original system. It gathers
information about any component in the system layout. Components supported in
@@ -28,7 +28,7 @@ information in one file. During recovery, that file is used to generate the
actual commands to recreate the components. Relax-and-Recover allows
customizations and manual editing in all these phases.
-== Layout information gathered during rescue image creation ==
+== Layout information gathered during rescue image creation
Layout information is stored in +/var/lib/rear/layout/disklayout.conf+. The term 'layout file' in this document refers to this particular file.
Consider the information from the following system as an example:
@@ -73,9 +73,9 @@ information necessary to restore is a system is listed.
It's easy to see that there are 3 disks attached to the system. +/dev/sda+ is the internal disk of the system. Its filesystems are normally mounted. The other devices are external disks. One of them has just normal partitions. The other one has a physical volume on one of the partitions.
-== Including/Excluding components ==
+== Including/Excluding components
-=== Autoexcludes ===
+=== Autoexcludes
Relax-and-Recover has reasonable defaults when creating the recovery
information. It has commented out the two external disks and any
@@ -130,7 +130,7 @@ multipath disks. Typically, they are part of the SAN disaster recovery
strategy. However, there can be cases where you want to recover them. The
information is retained in +disklayout.conf+.
-=== Manual excludes ===
+=== Manual excludes
It seems prudent to prevent the external drives from ever being backed-up or overwritten. The default configuration contains these lines:
----------------------------------
# Exclude components from being backed up, recreation information is active
@@ -192,7 +192,7 @@ Another approach would be to exclude the backup volume group. This is achieved b
EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" "/dev/backup" )
----------------------------------
-== Restore to the same hardware ==
+== Restore to the same hardware
Restoring the system to the same hardware is simple. Type +rear recover+ in
the rescue system prompt. Relax-and-Recover will detect that it's restoring to
the same system and will make sure things like UUIDs match. It also asks my
@@ -248,10 +248,10 @@ Welcome to Relax-and-Recover. Run "rear recover" to restore your system !
rear>
----------------------------------
-== Restore to different hardware ==
+== Restore to different hardware
There are two ways to deal with different hardware. One is being lazy and dealing with problems when you encounter them. The second option is to plan in advance. Both are valid approaches. The lazy approach works fine when you are in control of the restore and you have good knowledge of the components in your system. The second approach is preferable in disaster recovery situations or migrations where you know the target hardware in advance and the actual restore will be carried out by less knowledgeable people.
-=== The Ad-Hoc Way ===
+=== The Ad-Hoc Way
Relax-and-Recover will assist you somewhat in case it notices different disk
sizes. It will ask you to map each differently sized disk to a disk in the
target system. Partitions will be resized. Relax-and-Recover is careful not to
View
45 doc/user-guide/07-tips-and-tricks.txt
@@ -0,0 +1,45 @@
+= Tips and Tricks using Relax-and-Recover
+
+Recovering a system should not be a struggle against time with poor
+tools weighing against you. Relax-and-Recover emphasizes on a relaxing
+recovery, and for this it follows three distinct rules:
+
+ 1. Do what is generally expected, if possible
+
+ 2. In doubt, ask the operator or allow intervention
+
+ 3. Provide an environment that is as convenient as possible
+
+This results in the following useful tips and tricks:
+
+[TIP]
+====
+ 1. Relax-and-Recover adds its own GRUB menu entry to your local system's
+ GRUB, which is convenient to restore a system without the need for an
+ additional boot media. This only works if your system can (still)
+ boot from the local disk and the disaster didn't destroy that disk.
+ To protect accidental recovery, you need to enter the password:
+ *REAR*
+
+ 2. Relax-and-Recover automatically detects and enables serial console support.
+ This is extremely useful if the only way to access the console during
+ disaster is a Java-based console riddled with keyboard bugs and slow screen
+ refreshes.
+
+ 3. Relax-and-Recover conveniently ships with a set of useful commands in its
+ shell history. This makes it possible to quickly look for a command to help
+ troubleshoot, or modify an important file during recovery.
+
+ 4. If you have keyboard problems using a HP iLO 2 Remote Console, type the
+ following command +loadkeys -d+ (or simply use the up arrow key to get
+ this command from your shell history).
+
+ 5. If the original system was configured to log on remotely through the use
+ of SSH keys, Relax-and-Recover preserved those keys on the rescue
+ environment and you can access the rescue environment from the network
+ as you were used to before.
+
+ 6. During recovery at any stage you can re-run Relax-and-Recovery, modify
+ the layout file for recreating the structure and intervene when restoring
+ the backup.
+====
View
131 doc/user-guide/08-troubleshooting.txt
@@ -0,0 +1,131 @@
+= Troubleshooting Relax-and-Recover
+
+If you encounter a problem, you may find more information in the log file
+which is located at _/var/log/rear/rear-system.log_. During recovery the backup
+log file is also available from _/var/log/rear/_, for your convenience the
+history in rescue mode comes with useful commands for debugging, use the up
+arrow key in the shell to find those commands.
+
+There are a few options in Relax-and-Recover to help you debug the situation:
+
+ - use the +-v+ option to show progress output during execution
+ - use the +-d+ option to have debug information in your log file
+ - use the +-s+ option to see what scripts Relax-and-Recover would be using;
+ this is useful to understand how Relax-and-Recover is working internally
+ - use the +-S+ option to step through each individual script when
+ troubleshooting
+ - use the +-D+ option to dump every function call to log file; this is very
+ convenient during development or when troubleshooting Relax-and-Recover
+
+
+== During backup
+During backup Relax-and-Recover creates a description of your system layout
+in one file (_disklayout.conf_) and stores this as part of its rescue image.
+This file describes the configuration of SmartArray RAID, parititions,
+software RAID, DRBD, logical volumes, filesystems, and possibly more.
+
+Here is a list of known issues during backup:
+
+[qanda]
+One or more HP SmartArray controllers have errors::
++
+--
+Relax-and-Recover had detected that one of your HP SmartArray controllers is
+in ERROR state and as a result it can not trust the information returned from
+that controller. This can be dangerous because we cannot guarantee that the
+disk layout is valid when recovering the system.
+
+We discovered that this problem can be caused by a controller that still
+has information in its cache that has not been flushed and the only way to
+solve it was to reboot the system and pressing F2 during the controller
+initialisation when it reports this problem.
+--
+
+USB sticks disappear and re-appear with difference device name::
++
+--
+We have had issues before with a specific batch of JetFlash USB sticks
+which, during write operations, reset the USB controller because of a bug
+in the Linux kernel. The behaviour is that the device disappears (during
+write operations!) and reappears with a different device name. The result
+is that the filesystem becomes corrupt and the stick cannot be used.
+
+To verify if the USB stick has any issues like this, we recommend using
+the +f3+ tool on Linux or the +h2testw+ tool on Windows. If this tool
+succeeds in a write and verify test, the USB stick is reliable.
+--
+
+
+== During recovery
+During restore Relax-and-Recover uses the saved system layout as the basis for
+recreating a workable layout on your new system. If your new hardware is very
+different, it's advised to copy the layout file
+_/var/lib/rear/layout/disklayout.conf_ to _/etc/rear_ and modify it according
+to what is required.
+
+----
+cp /var/lib/rear/layout/disklayout.conf /etc/rear/
+vi /etc/rear/disklayout.conf
+----
+
+Then restart the recovery process: +rear recover+
+
+During the recovery process, Relax-and-Recover translates this layout file
+into a shell procedure (_/var/lib/rear/layout/diskrestore.sh_) that contains
+all the needed instructions for recreating your desired layout.
+
+If Relax-and-Recover comes across irreconcilable differences, it provides you
+with a small menu of options you have. In any case you can Abort the menu, and
+retry after cleaning up everything Relax-and-Recover may already have done, incl.
++mdadm --stop --scan+ or +vgchange -a n+.
+
+In any case, you will have to look into the issue, see what goes wrong and
+either fix the layout file (_disklayout.conf_) and restart the recovery
+process (+rear recover+) or instead fix the shell procedure (_diskrestore.sh_)
+and choose +Retry+.
+
+WARNING: Customizations to the shell procedure (_diskrestore.sh_) get
+ lost when restarting +rear recover+.
+
+
+Here is a list of known issues during recovery:
+
+[qanda]
+Failed to clear HP SmartArray controller 1::
++
+--
+This error may be caused by trying to clear an HP SmartArray controller
+that does not have a configuration or does not exist. Since we have no
+means to know whether this is a fatal condition or not we simply try to
+recreate the logical drive(s) and see what happens.
+
+This message is harmless, but may help troubleshoot the subsequent error
+message.
+--
+
+An error has been detected during restore::
++
+--
+The (generated) layout restore script _/var/lib/rear/layout/diskrestore.sh_
+was not able to perform all necessary steps without error. The system will
+provide you with a menu allowing you to fix the _diskrestore.sh_ script
+manually and continue from where it left off.
+
+ Cannot create array. Cannot add physical drive 2I:1:5
+ Could not configure the HP SmartArray controllers
+
+When the number of physical or logical disks are different, or when other
+important system characteristics that matter to recovery are incompatible,
+this will be indicated by a multitude of possible error-messages.
+Relax-and-Recover makes it possible to recover also in these cases by hand.
+
+You can find more information about your HP SmartArray setup by running one of
+the following commands:
+
+ # hpacucli ctrl all show detail
+ # hpacucli ctrl all show config
+ # hpacucli ctrl all show config detail
+--
+
+TIP: You can find these commands as part of the history of the
+Relax-and-Recover shell.
View
4 doc/relax-recover-concept.txt → doc/user-guide/09-design-concepts.txt
@@ -1,4 +1,6 @@
-= Relax-and-Recover: The Ultimate Disaster Recovery Framework
+// FIXME: Original design document needs a lot of rework
+
+= Design concepts
Schlomo Schapiro, Gratien D'haese, Dag Wieers
== The Workflow System
View
18 doc/user-guide/Makefile
@@ -0,0 +1,18 @@
+prefix = /usr
+datadir = $(prefix)/share
+mandir = $(datadir)/man
+
+txttargets = relax-and-recover-user-guide.txt
+htmltargets = $(patsubst %.txt, %.html, $(txttargets))
+
+all: docs
+
+dist: docs
+
+docs: $(htmltargets)
+
+clean:
+ rm -f *.html *.svg *.xml
+
+%.html: %.txt
+ asciidoc $<
View
24 doc/user-guide/relax-and-recover-user-guide.txt
@@ -0,0 +1,24 @@
+= Relax-and-Recover user guide
+:author: Dag Wieers and Jeroen Hoekx
+:version: 0.4 draft
+:data-uri:
+:doctype: book
+:encoding: UTF-8
+:numbered:
+:toc:
+:toclevels: 2
+
+This document describes everything there is to know regarding
+Relax-and-Recover, an Open Source bare-metal disaster recovery and system
+migration solution designed for Linux.
+
+:leveloffset: 1
+include::01-introduction.txt[]
+include::02-getting-started.txt[]
+include::03-configuration.txt[]
+include::04-scenarios.txt[]
+include::05-integration.txt[]
+include::06-layout-configuration.txt[]
+include::07-tips-and-tricks.txt[]
+include::08-troubleshooting.txt[]
+include::09-design-concepts.txt[]
View
16 usr/share/rear/backup/NETFS/default/50_make_backup.sh
@@ -142,22 +142,20 @@ case "$(basename $BACKUP_PROG)" in
(tar)
if (( $backup_prog_rc == 1 )); then
LogPrint "WARNING: $(basename $BACKUP_PROG) ended with return code $backup_prog_rc and below output:
-
+ ---snip---
$(grep '^tar: ' $LOGFILE | sed -e 's/^/ /' | tail -n3)
-
+ ----------
This means that files have been modified during the archiving
process. As a result the backup may not be completely consistent
-or may not be a perfect copy of the system.
-
-Relax-and-Recover will continue, however it is highly advisable
-to verify the backup in order to be sure to safely recover this
-system.
+or may not be a perfect copy of the system. Relax-and-Recover
+will continue, however it is highly advisable to verify the
+backup in order to be sure to safely recover this system.
"
elif (( $backup_prog_rc > 1 )); then
Error "$(basename $BACKUP_PROG) failed with return code $backup_prog_rc and below output:
-
+ ---snip---
$(grep '^tar: ' $LOGFILE | sed -e 's/^/ /' | tail -n3)
-
+ ----------
This means that the archiving process ended prematurely, or did
not even start. As a result it is unlikely you can recover this
system properly. Relax-and-Recover is therefore aborting execution.

No commit comments for this range

Something went wrong with that request. Please try again.