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