1REAR(8) REAR(8)
2
3
4
6 rear - bare metal disaster recovery and system migration tool
7
9 rear [-h|--help] [-V|--version] [-dsSv] [-D|--debugscripts SET] [-c
10 DIR] [-C CONFIG] [-r KERNEL] [--] COMMAND [ARGS...]
11
13 Relax-and-Recover is the leading Open Source disaster recovery
14 solution. It is a modular framework with many ready-to-go workflows for
15 common situations.
16
17 Relax-and-Recover produces a bootable image. This image can repartition
18 the system. Once that is done it initiates a restore from backup.
19 Restores to different hardware are possible. Relax-and-Recover can
20 therefore be used as a migration tool as well.
21
22 Currently Relax-and-Recover supports various boot media (incl. ISO,
23 PXE, OBDR tape, USB or eSATA storage), a variety of network protocols
24 (incl. sftp, ftp, http, nfs, cifs) for storage and backup as well as a
25 multitude of backup strategies (incl. IBM Tivoli Storage Manager, HP
26 DataProtector, Symantec NetBackup, EMC NetWorker, EMC Avamar,
27 FDR/Upstream, NovaBACKUP DC, Bareos, Bacula, rsync, rbme, Borg). This
28 results in a bootable image that is capable of booting via PXE, DVD/CD,
29 bootable tape or virtual provisioning.
30
31 Relax-and-Recover was designed to be easy to set up, requires no
32 maintenance and is there to assist when disaster strikes. Its
33 setup-and-forget nature removes any excuses for not having a disaster
34 recovery solution implemented.
35
36 Recovering from disaster is made very straight-forward by a 2-step
37 recovery process so that it can be executed by operational teams when
38 required. When used interactively (e.g. when used for migrating
39 systems), menus help make decisions to restore to a new (hardware)
40 environment.
41
42 Extending Relax-and-Recover is made possible by its modular framework.
43 Consistent logging and optionally extended output help understand the
44 concepts behind Relax-and-Recover and help debug during development.
45
46 Relax-and-Recover comes with ABSOLUTELY NO WARRANTY; for details see
47 the GNU General Public License at: http://www.gnu.org/licenses/gpl.html
48
50 GLOBAL OPTIONS
51 -h --help
52 usage information
53
54 -c DIR
55 alternative config directory; instead of /etc/rear
56
57 -C CONFIG
58 additional config file; absolute path or relative to config
59 directory
60
61 -d
62 debug mode (log debug messages to log file - also sets -v)
63
64 -D
65 debugscript mode (log executed commands via set -x - also sets -v
66 and -d)
67
68 --debugscripts SET
69 same as -d -v -D but debugscript mode with set -SET
70
71 -r KERNEL
72 kernel version to use (by default use running kernel)
73
74 -s
75 simulation mode (show what scripts are run without executing them)
76
77 -S
78 step-by-step mode (acknowledge each script individually)
79
80 -v
81 verbose mode (show more output and run many commands in verbose
82 mode)
83
84 -V --version
85 version information
86
87 COMMANDS
88 checklayout
89 check if the disk layout has changed since the last run of
90 mkbackup/mkrescue
91
92 dump
93 dump configuration and system information; please run this to
94 verify your setup
95
96 format
97 format and label USB or tape media to be used with rear;
98
99 first argument is the USB or tape device to use, eg. /dev/sdX or
100 /dev/stX
101
102 help
103 print full list of commands and options
104
105 mkbackup
106 create rescue media and backup the system (only for internal backup
107 methods)
108
109 mkbackuponly
110 backup the system (only for internal backup methods) without
111 creating rescue media
112
113 mkrescue
114 create rescue media only
115
116 recover
117 recover the system; can be used only when running from the rescue
118 media
119
120 restoreonly
121 only restore the backup; can be used only when running from the
122 rescue media
123
124 mkopalpba
125 create a pre-boot authentication (PBA) image to boot from TCG Opal
126 2-compliant self-encrypting disks
127
128 opaladmin
129 administrate TCG Opal 2-compliant self-encrypting disks
130
131 validate
132 submit validation information
133
134 Use rear -v help for more advanced commands.
135
137 The process of bare metal disaster recovery consists of two parts:
138
139 · Recreate the system layout
140
141 · Restore the data to the system
142
143 Most backup software solutions are very good at restoring data but do
144 not support recreating the system layout. Relax-and-Recover is very
145 good at recreating the system layout but works best when used together
146 with supported backup software.
147
148 In this combination Relax-and-Recover recreates the system layout and
149 calls the backup software to restore the actual data. Thus there is no
150 unnecessary duplicate data storage and the Relax-and-Recover rescue
151 media can be very small.
152
153 For demonstration and special use purposes Relax-and-Recover also
154 includes an internal backup method, NETFS, which can be used to create
155 a simple tar.gz archive of the system. For all permanent setups we
156 recommend using something more professional for backup, either a
157 traditional backup software (open source or commercial) or rsync with
158 hardlink based solutions, e.g. RSYNC BACKUP MADE EASY.
159
161 The OUTPUT variable defines from where our bootable rescue image will
162 be booted and the OUTPUT_URL variable defines where the rescue image
163 should be send to. Possible OUTPUT settings are:
164
165 OUTPUT=RAMDISK
166 Create only the Relax-and-Recover initramfs.
167
168 OUTPUT=ISO
169 (Default) Create a bootable ISO9660 image on disk as
170 rear-$(hostname).iso
171
172 OUTPUT=PXE
173 Create on a remote PXE/NFS server the required files (such as
174 configuration file, kernel and initrd image
175
176 OUTPUT=OBDR
177 Create a bootable OBDR tape (optionally including the backup
178 archive). Specify the OBDR tape device by using TAPE_DEVICE.
179
180 OUTPUT=USB
181 Create a bootable USB disk (using extlinux). Specify the USB
182 storage device by using USB_DEVICE.
183
184 OUTPUT=RAWDISK
185 Create a bootable image file named "rear-$(hostname).raw.gz", which
186
187 · supports UEFI boot if syslinux/EFI or Grub 2/EFI is installed,
188
189 · supports Legacy BIOS boot if syslinux is installed,
190
191 · supports UEFI/Legacy BIOS dual boot if syslinux and one of the
192 supported EFI bootloaders are installed.
193
194 When using OUTPUT=ISO, RAMDISK, OBDR, USB, or RAWDISK you should
195 provide the backup target location through the OUTPUT_URL variable.
196 Possible OUTPUT_URL settings are:
197
198 OUTPUT_URL=file://
199 Write the image to disk. The default is in /var/lib/rear/output/.
200
201 OUTPUT_URL=nfs://
202 Write the image by mounting the target filesystem via NFS.
203
204 OUTPUT_URL=cifs://
205 Write the image by mounting the target filesystem via CIFS.
206
207 OUTPUT_URL=fish://
208 Write the image using lftp and the FISH protocol.
209
210 OUTPUT_URL=ftp://
211 Write the image using lftp and the FTP protocol.
212
213 OUTPUT_URL=ftps://
214 Write the image using lftp and the FTPS protocol.
215
216 OUTPUT_URL=hftp://
217 Write the image using lftp and the HFTP protocol.
218
219 OUTPUT_URL=http://
220 Write the image using lftp and the HTTP (PUT) procotol.
221
222 OUTPUT_URL=https://
223 Write the image using lftp and the HTTPS (PUT) protocol.
224
225 OUTPUT_URL=sftp://
226 Write the image using lftp and the secure FTP (SFTP) protocol.
227
228 OUTPUT_URL=rsync://
229 Write the image using rsync and the RSYNC protocol.
230
231 OUTPUT_URL=sshfs://
232 Write the image using sshfs and the SSH protocol.
233
234 OUTPUT_URL=null
235 Do not copy the rescue image from /var/lib/rear/output/ to a remote
236 output location. OUTPUT_URL=null is useful when another program
237 (e.g. an external backup program) is used to save the rescue image
238 from the local system to a remote place, or with
239 BACKUP_URL=iso:///backup when the backup is included in the rescue
240 image to avoid a (big) copy of the rescue image at a remote output
241 location. In the latter case the rescue image must be manually
242 saved from the local system to a remote place. OUTPUT_URL=null is
243 only supported together with BACKUP=NETFS.
244
245 If you do not specify OUTPUT_URL variable then by default it will be
246 aligned to what was defined by variable BACKUP_URL. And, the rescue
247 image will then be copied to the same location as your backup of the
248 system disk(s).
249
250 The ISO_DEFAULT variable defines what default boot option is used on
251 the rescue image. Possible values are manual, boothd or automatic.
252 Manual will make you boot into the shell directly by default, boothd
253 will boot to the first disk (default) or automatic will automatically
254 start in recovery mode.
255
257 When booting the rescue image you can edit the kernel command line.
258 There are some Relax-and-Recover specific kernel command line options:
259
260 debug
261 The rescue system start up scripts in /etc/scripts/system-setup.d/
262 are run one by one each one after pressing Enter and the scripts
263 are run with set -x which prints commands and their arguments as
264 they are executed.
265
266 auto_recover or automatic
267 Launch rear recover automatically (without automated reboot).
268 Together with debug it runs rear recover in debug mode.
269
270 unattended
271 Launch rear recover automatically as with auto_recover plus
272 automated reboot after successful rear recover.
273
274 ip= nm= netdev= gw=
275 If IP address plus optionally netmask (default 255.255.255.0),
276 network device (default eth0), and a default gateway are specified
277 only that single network device is set up. Example:
278
279 ip=192.168.100.2 nm=255.255.255.0 netdev=eth0 gw=192.168.100.1
280
281 noip
282 Skip network devices setup by the rescue system start up scripts
283 (overrides ip= nm= netdev= gw=).
284
286 Currently Relax-and-Recover supports the following backup methods.
287 Please distinguish carefully between Relax-and-Recover support for 3rd
288 party backup software and Relax-and-Recover internal backup methods.
289 The latter also creates a backup of your data while the former will
290 only integrate Relax-and-Recover with the backup software to restore
291 the data with the help of the backup software without actually creating
292 backups. This means that for all non-internal backup software you must
293 take care of creating backups yourself (unless otherwise noted).
294
295 Especially the rear mkbackup command can be confusing as it is only
296 useful for the internal backup methods and has usually no function at
297 all with the other (external) backup methods.
298
299 The following backup methods need to be set in Relax-and-Recover with
300 the BACKUP option. As mentioned we have two types of BACKUP methods -
301 internal and external.
302
303 The following BACKUP methods are external of Relax-and-Recover meaning
304 that usually you are responsible of backups being made:
305
306 BACKUP=REQUESTRESTORE
307 (default) Not really a backup method at all, Relax-and-Recover
308 simply halts the recovery and requests that somebody will restore
309 the data to the appropriate location (e.g. via SSH). This method
310 works especially well with an rsync based backup that is pushed
311 back to the backup client.
312
313 BACKUP=EXTERNAL
314 Internal backup method that uses an arbitrary external command to
315 create a backup and restore the data.
316
317 BACKUP=DP
318 Use HP Data Protector to restore the data.
319
320 BACKUP=FDRUPSTREAM
321 Use FDR/Upstream to restore the data.
322
323 BACKUP=GALAXY
324 Use CommVault Galaxy 5 to restore the data.
325
326 BACKUP=GALAXY7
327 Use CommVault Galaxy 7 to restore the data.
328
329 BACKUP=GALAXY10
330 Use CommVault Galaxy 10 (or Simpana 10) to restore the data.
331
332 BACKUP=NBU
333 Use Symantec NetBackup to restore the data.
334
335 BACKUP=TSM
336 Use IBM Tivoli Storage Manager to restore the data. The
337 Relax-and-Recover result files (e.g. ISO image) are also saved into
338 TSM. There is a (currently experimental) first draft implementation
339 that a TSM backup is created by calling dsmc incremental during
340 rear mkbackup.
341
342 BACKUP=NSR
343 Using EMC NetWorker (Legato) to restore the data.
344
345 BACKUP=AVA
346 Using EMC Avamar to restore the data.
347
348 BACKUP=SESAM
349 Using SEP Sesam to restore the data.
350
351 BACKUP=NBKDC
352 Using Novastor NovaBACKUP DC to restore the data.
353
354 BACKUP=RBME
355 Use Rsync Backup Made Easy (rbme) to restore the data.
356
357 BACKUP=BAREOS
358 Use Open Source backup solution BAREOS (a fork a BACULA) to restore
359 the data.
360
361 BACKUP=BACULA
362 Use Open Source backup solution BACULA to restore the data.
363
364 BACKUP=DUPLICITY
365 Use encrypted bandwidth-efficient backup solution using the rsync
366 algorithm to restore the data.
367
368 BACKUP=BORG
369 Use BorgBackup (short Borg) a deduplicating backup program to
370 restore the data. Executing rear mkbackup will create a Borg
371 backup, see the section ReaR with Borg back end in the ReaR
372 user-guide Scenarios documentation.
373
374 The following BACKUP methods are internal of Relax-and-Recover:
375
376 BACKUP=NETFS
377 Internal backup method which can be used to create a simple backup
378 (tar archive).
379
380 BACKUP=RSYNC
381 Use rsync to restore data.
382
383 If your favourite backup software is missing from this list, please
384 submit a patch or ask us to implement it for you.
385
386 When using BACKUP=NETFS you must provide the backup target location
387 through the BACKUP_URL variable. Possible BACKUP_URL settings are:
388
389 BACKUP_URL=file://
390 To backup to local disk, use BACKUP_URL=file:///directory/path/
391
392 BACKUP_URL=nfs://
393 To backup to NFS disk, use
394 BACKUP_URL=nfs://nfs-server-name/share/path
395
396 BACKUP_URL=tape://
397 To backup to tape device, use BACKUP_URL=tape:///dev/nst0 or
398 alternatively, simply define TAPE_DEVICE=/dev/nst0
399
400 BACKUP_URL=rsync://
401 When backup method BACKUP=RSYNC is chosen then we need to define a
402 corresponding BACKUP_URL rule:
403
404 BACKUP_URL=rsync://[user@]host[:port]/path
405 BACKUP_URL=rsync://[user@]host[:port]::/path
406
407 BACKUP_URL=cifs://
408 To backup to a Samba share (CIFS), use
409 BACKUP_URL=cifs://cifs-server-name/share/path. To provide
410 credentials for CIFS mounting use a /etc/rear/cifs credentials file
411 and define BACKUP_OPTIONS="cred=/etc/rear/cifs" and pass along:
412
413 username=_username_
414 password=_secret password_
415 domain=_domain_
416
417 BACKUP_URL=usb://
418 To backup to USB storage device, use
419 BACKUP_URL=usb:///dev/disk/by-path/REAR-000 or use a real device
420 node or a specific filesystem label. Alternatively, you can specify
421 the device using USB_DEVICE=/dev/disk/by-path/REAR-000.
422
423 If you combine this with OUTPUT=USB you will end up with a bootable
424 USB device.
425
426 BACKUP_URL=sshfs://
427 To backup to a remote server via sshfs (SSH protocol), use
428 BACKUP_URL=sshfs://user@remote-system.name.org/home/user/backup-dir/
429
430 It is advisable to add ServerAliveInterval 15 in the
431 /root/.ssh/config file for the remote system
432 (remote-system.name.org).
433
434 BACKUP_URL=iso://
435 To include the backup within the ISO image. It is important that
436 the BACKUP_URL and OUTPUT_URL variables are different. E.g.
437
438 BACKUP_URL=iso:///backup/
439 OUTPUT_URL=nfs://server/path/
440
441 When using BACKUP=NETFS and BACKUP_PROG=tar there is an option to
442 select BACKUP_TYPE=incremental or BACKUP_TYPE=differential to let rear
443 make incremental or differential backups until the next full backup day
444 e.g. via FULLBACKUPDAY="Mon" is reached or when the last full backup is
445 too old after FULLBACKUP_OUTDATED_DAYS has passed. Incremental or
446 differential backup is currently only known to work with
447 BACKUP_URL=nfs. Other BACKUP_URL schemes may work but at least
448 BACKUP_URL=usb requires USB_SUFFIX to be set to work with incremental
449 or differential backup.
450
452 Relax-and-Recover supports self-encrypting disks (SEDs) compliant with
453 the TCG Opal 2 specification if the sedutil-cli executable is
454 installed.
455
456 Self-encrypting disk support includes
457
458 · recovery (saving and restoring the system’s SED configuration),
459
460 · setting up SEDs, including assigning a disk password,
461
462 · providing a pre-boot authentication (PBA) system to unlock SEDs at
463 boot time.
464
465 To prepare booting from an SED, run rear mkopalpba, then create the
466 rescue system.
467
468 To set up an SED, boot the Relax-and-Recover rescue system and run`rear
469 opaladmin setupERASE DEVICE` (DEVICE being the disk device path like
470 /dev/sda).
471
472 For complete information, consult the section "Support for TCG Opal
473 2-compliant Self-Encrypting Disks" in the Relax-and-Recover user guide.
474
476 To configure Relax-and-Recover you have to edit the configuration files
477 in /etc/rear/. All *.conf files there are part of the configuration,
478 but only site.conf and local.conf are intended for the user
479 configuration. All other configuration files hold defaults for various
480 distributions and should not be changed.
481
482 In /etc/rear/templates/ there are also some template files which are
483 used by Relax-and-Recover to create configuration files (mostly for the
484 boot environment). Modify the templates to adjust the information
485 contained in the emails produced by Relax-and-Recover. You can use
486 these templates to prepend your own configurations to the configuration
487 files created by Relax-and-Recover, for example you can edit
488 PXE_pxelinux.cfg to add some general pxelinux configuration you use.
489
490 In almost all circumstances you have to configure two main settings and
491 their parameters: The backup method and the output method.
492
493 The backup method defines, how your data was saved and whether
494 Relax-and-Recover should backup your data as part of the mkrescue
495 process or whether you use an external application, e.g. backup
496 software to archive your data.
497
498 The output method defines how the rescue system is written to disk and
499 how you plan to boot the failed computer from the rescue system.
500
501 See the default configuration file /usr/share/rear/conf/default.conf
502 for an overview of the possible methods and their options.
503
504 An example to use TSM for backup and ISO for output would be to add
505 these lines to /etc/rear/local.conf (no need to define a BACKUP_URL
506 when using an external backup solution):
507
508 BACKUP=TSM
509 OUTPUT=ISO
510
511 And if all your systems use NTP for time synchronisation, you can also
512 add these lines to /etc/rear/site.conf
513
514 TIMESYNC=NTP
515
516 Do not forget to distribute the site.conf to all your systems.
517
518 The resulting ISO image will be created in /var/lib/rear/output/. You
519 can now modify the behaviour by copying the appropriate configuration
520 variables from default.conf to local.conf and changing them to suit
521 your environment.
522
524 0
525 Successful program execution.
526
527 >0
528 Usage, syntax or execution errors. Check the log file in
529 /var/log/rear/ for more information.
530
532 To print out the current settings for BACKUP and OUTPUT methods and
533 some system information. This command can be used to see the supported
534 features for the given release and platform.
535
536 # rear dump
537
538 To create a new rescue environment. Do not forget to copy the resulting
539 rescue system away so that you can use it in the case of a system
540 failure.
541
542 # rear -v mkrescue
543
544 To create a new rescue image together with a complete archive of your
545 local system run the command:
546
547 # rear -v mkbackup
548
550 /usr/sbin/rear
551 The program itself.
552
553 /etc/rear/local.conf
554 System specific configuration can be set here.
555
556 /etc/rear/site.conf
557 Site specific configuration can be set here (not created by
558 default).
559
560 /var/log/rear/
561 Directory holding the log files.
562
563 /tmp/rear.####
564 Relax-and-Recover working directory. If Relax-and-Recover exits
565 with an error, you must remove this directory manually.
566
567 /usr/share/rear
568 Relax-and-Recover script components.
569
570 /usr/share/rear/conf/default.conf
571 Relax-and-Recover default values. Contains a complete set of
572 parameters and its explanation. Please do not edit or modify. Copy
573 values to local.conf or site.conf instead.
574
576 Feedback is welcome, please report any issues or improvements to our
577 issue-tracker at: http://github.com/rear/issues/
578
579 Furthermore, we welcome pull requests via GitHub.
580
582 Relax-and-Recover comes with extensive documentation located in
583 /usr/share/doc.
584
586 The ReaR project was initiated in 2006 by Schlomo Schapiro
587 (https://github.com/schlomo) and Gratien D’haese
588 (https://github.com/gdha) and has since then seen a lot of
589 contributions by many authors. As ReaR deals with bare metal disaster
590 recovery, there is a large amount of code that was contributed by
591 owners and users of specialized hardware and software. Without their
592 combined efforts and contributions ReaR would not be the universal
593 Linux bare metal disaster recovery solution that it is today.
594
595 As time passed the project was lucky to get the support of additional
596 developers to also help as maintainers: Dag Wieers
597 (https://github.com/dagwieers), Jeroen Hoekx
598 (https://github.com/jhoekx), Johannes Meixner
599 (https://github.com/jsmeix), Vladimir Gozora
600 (https://github.com/gozora) and Sébastien Chabrolles
601 (https://github.com/schabrolles). We hope that ReaR continues to prove
602 useful and to attract more developers who agree to be maintainers.
603 Please refer to the MAINTAINERS
604 (https://github.com/rear/rear/blob/master/MAINTAINERS) file for the
605 list of active and past maintainers.
606
607 To see the full list of authors and their contributions please look at
608 the git history (https://github.com/rear/rear/graphs/contributors). We
609 are very thankful to all authors and encourage anybody interested to
610 take a look at our source code and to contribute what you find
611 important.
612
613 Relax-and-Recover is a collaborative process using Github at
614 http://github.com/rear/
615
616 The Relax-and-Recover website is located at:
617 http://relax-and-recover.org/
618
620 (c) 2006-2018
621
622 The copyright is held by the original authors of the respective code
623 pieces as can be seen in the git history at
624 https://github.com/rear/rear/graphs/contributors
625
626 Relax-and-Recover comes with ABSOLUTELY NO WARRANTY; for details see
627 the GNU General Public License at http://www.gnu.org/licenses/gpl.html
628
629
630
631 20 June 2018 REAR(8)