-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
235 lines (172 loc) · 8.35 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
Relax-and-Recover
=================
Relax-and-Recover is the leading Open Source bare metal disaster recovery
and system migration 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 straightforward 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.
For more detailed information about Relax-and-Recover, please read the
Relax-and-Recover User Guide.
REQUIREMENTS
------------
Relax-and-Recover is written entirely in Bash and does not require any
external programs. However, the rescue system that is created by
Relax-and-Recover requires some programs that are needed to make our
rescue system work:
- mingetty
- sfdisk
All other required programs (like sort, dd, grep, etc.) are so common, that
we don't list them as requirements. In case your specific workflow requires
additional tools, Relax-and-Recover will tell you.
INSTALLATION
------------
On RPM based systems you should use the rear RPM package. Either obtain it
from the Relax-and-Recover homepage or build it yourself from the source
tree with:
make rpm
This will create an RPM for your distribution. The RPM is not platform-
dependant and should work also on other RPM based distributions.
On DEB based systems you can execute the command:
make deb
QUICK START GUIDE
-----------------
This quick start guide will show you how to run Relax-and-Recover from the git
checkout and create a bootable USB backup.
Start by cloning the Relax-and-Recover sources from Github:
git clone https://github.com/rear/rear.git
Move into the rear/ directory:
cd rear/
Prepare your USB media. Change /dev/sdb to the correct device in your situation.
Relax-and-Recover will 'own' the device in this example.
***This will destroy all data on that device.***
sudo usr/sbin/rear format /dev/sdb
Relax-and-recover asks you to confirm that you want to format the device:
Yes
The device has been labeled REAR-000 by the 'format' workflow.
Now edit the 'etc/rear/local.conf' configuration file:
----
cat > etc/rear/local.conf <<EOF
### write the rescue initramfs to USB and update the USB bootloader
OUTPUT=USB
### create a backup using the internal NETFS method, using 'tar'
BACKUP=NETFS
### write both rescue image and backup to the device labeled REAR-000
BACKUP_URL=usb:///dev/disk/by-label/REAR-000
EOF
----
Please make sure you have at least defined an +OUTPUT+, +BACKUP+ and a
+BACKUP_URL+ variable.
Now you are ready to create a rescue image. We want verbose output (-v option).
sudo usr/sbin/rear -v mkrescue
The output I get is:
----
Relax-and-Recover 1.13.0 / $Date$
Using log file: /home/jeroen/tmp/quickstart/rear/var/log/rear/rear-fireflash.log
Creating disk layout
Creating root filesystem layout
TIP: To login as root via ssh you need to set up /root/.ssh/authorized_keys
Copying files and directories
Copying binaries and libraries
Copying kernel modules
Creating initramfs
Writing MBR to /dev/sdb
Copying resulting files to usb location
----
You might want to check the log file for possible errors or see what
Relax-and-Recover is doing.
Now reboot your system and try to boot from the USB device.
If that worked, you can dive into the advanced Relax-and-Recover options and
start creating full backups. If your USB device has enough space, initiate a
backup using:
sudo usr/sbin/rear -v mkbackup
That is it. You are now better prepared for failure !
CONFIGURATION
-------------
To configure Relax-and-Recover you have to edit the configuration files in
'/etc/rear/'. All '*.conf' files there are part of the configuration, but
only 'site.conf' and 'local.conf' are intended for the user configuration.
All other configuration files hold defaults for various distributions and
should not be changed.
In '/etc/rear/templates/' there are also some template files which are use by
Relax-and-Recover to create configuration files (mostly for the boot
environment). You can use these templates to prepend your own configurations
to the configuration files created by Relax-and-Recover, for example you can
edit 'PXE_pxelinux.cfg' to add some general pxelinux configuration you use
(I put there stuff to install Linux over the network).
In almost all circumstances you have to configure two main settings and their
parameters: The +BACKUP+ method and the +OUTPUT+ method.
The backup method defines, how your data was saved and whether Relax-and-Recover
should backup your data as part of the mkrescue process or whether you use an
external application, e.g. backup software to archive your data.
The output method defines how the rescue system is written to disk and how you
plan to boot the failed computer from the rescue system.
See '/usr/share/rear/conf/default.conf' for an overview of the possible methods
and their options. An example to use TSM for backup and PXE for output and
would be to add these lines to '/etc/rear/local.conf':
----
BACKUP=TSM
OUTPUT=PXE
----
And since all your computers use NTP for time synchronisation, you should also
add these lines to '/etc/rear/site.conf':
----
TIMESYNC=NTP
----
Don't forget to distribute the 'site.conf' to all your systems.
The resulting PXE files (kernel, initrd and pxelinux configuration) will be
written to files in '/var/lib/rear/output/'. You can now modify the behaviour
by copying the appropriate configuration variables from 'default.conf' to
'local.conf' and changing them to suit your environment.
USAGE
-----
To use Relax-and-Recover you always call the main script '/usr/sbin/rear':
----
# rear help
Usage: rear [-d] [-D] [-r KERNEL] [-s] [-S] [-v] [-V] COMMAND [ARGS...]
Relax-and-Recover comes with ABSOLUTELY NO WARRANTY; for details see
the GNU General Public License at: http://www.gnu.org/licenses/gpl.html
Available options:
-d debug mode; log debug messages
-D debugscript mode; log every function call
-r KERNEL kernel version to use; current: '2.6.32-131.2.1.el6.x86_64'
-s simulation mode; show what scripts rear would include
-S step-by-step mode; acknowledge each script individually
-v verbose mode; show more output
-V version information
List of commands:
checklayout check if the disk layout has changed
dump dump configuration and system information
format format and label media for use with rear
mkbackup create rescue media and backup system
mkbackuponly backup system without creating rescue media
mkrescue create rescue media only
validate submit validation information
Use 'rear -v help' for more advanced commands.
----
To view/verify your configuration, run +rear dump+. It will print out the
current settings for +BACKUP+ and +OUTPUT+ methods and some system information.
To create a new rescue environment, simply call +rear mkrescue+. Do not forget
to copy the resulting rescue system away so that you can use it in the case of
a system failure. Use +rear mkbackup+ instead if you are using the builtin
backup functions (like +BACKUP=NETFS+)
To recover your system, start the computer from the rescue system and run
+rear recover+. Your system will be recovered and you can restart it and
continue to use it normally.