Debian Codegraph @

doc/rear.8.adoc

raw
1 = rear(8)
2 :version: v2.9
3 :date: 31 January 2025
4 :data-uri:
5 :doctype: manpage
6 :lang: en
7 :quirks:
8
9
10 == NAME
11 rear - bare metal disaster recovery and system migration tool
12
13
14 == SYNOPSIS
15 *rear* [*-h*|*--help*] [*-V*|*--version*] [*-dsSv*] [*-D*|*--debugscripts* _SET_] [*-c* _DIR_] [*-C* _CONFIG_] [*-r* _KERNEL_] [*-n*|*--non-interactive*] [*-e*|*--expose-secrets*] [--] _COMMAND_ [_ARGS_...]
16
17
18 == DESCRIPTION
19 Relax-and-Recover (abbreviated ReaR) is the de facto standard disaster recovery framework on Linux.
20
21 It is in particular used on enterprise Linux distributions like Red Hat Enterprise Linux (RHEL)
22 and SUSE Linux Enterprise Server (SLES).
23
24 ReaR is a system administrator tool and framework to create a bootable disaster recovery system image
25 for bare metal disaster recovery with data backup restore on physical or virtual replacement hardware.
26
27 For bare metal disaster recovery the ReaR recovery system is booted on pristine replacement hardware.
28 On replacement hardware first the storage setup/layout is recreated (disk partitioning, filesystems, mount points),
29 then a backup restore program is called to restore the data (system files) into the recreated storage,
30 and finally a boot loader is installed.
31
32 System administrators use the ReaR framework to set up a disaster recovery procedure
33 as part of their disaster recovery policy (which complements their existing backup policy).
34
35 ReaR complements backup and restore of data with bare metal disaster recovery. ReaR can also act as local backup software,
36 but ReaR is not a a backup management software. In many enterprise environmentments, data backup and restore happens via dedicated backup software which is integrated by ReaR and used to restore the data onto a replacement system as part of the automated disaster recovery procedure implemented by ReaR.
37
38 ReaR has support for built-in backup methods using 'tar' and 'rsync' that are used for backup and restore.
39
40 ReaR integrates supports the following 3rd party, also commercial, tools for restoring a backup.
41
42 The complete list of backup methods (*BACKUP=...*) is:
43
44 * *AVA* Dell EMC Avamar / EMC Avamar
45 * *BACULA* Bacula
46 * *BAREOS* Bareos
47 * *BLOCKCLONE* block device cloning via `dd`
48 * *BORG* Borg Backup
49 * *CDM* Rubrik Cloud Data Management
50 * *DP* OpenText Data Protector
51 * *DUPLICITY* Duplicity / Duply
52 * *EXTERNAL* External custom restore method
53 * *FDRUPSTREAM* FDR/Upstream
54 * *GALAXY11* Commvault Galaxy 11 / Commvault Simpana
55 * *NBKDC* NovaStor DataCenter
56 * *NBU* Veritas NetBackup / Symantec NetBackup
57 * *NETFS* ReaR built-in backup and restore via `rsync` or `tar` to a network file system or to a locally attached backup disk (USB, eSATA, ...)
58 * *NFS4SERVER* NFS4 server to push data *to* the rescue system
59 * *NSR* Dell EMC NetWorker / EMC NetWorker / Legato NetWorker
60 * *OBDR* One Button Disaster Recovery via tape
61 * *PPDM* Dell PowerProtect Data Manager
62 * *RBME* Rsync Backup Made Easy
63 * *REQUESTRESTORE* Request restore from a human operator
64 * *RSYNC* ReaR built-in backup using `rsync` via `rsync` or `ssh` protocol
65 * *SESAM* SEP Sesam
66 * *TSM* IBM Storage Protect / Tivoli Storage Manager / IBM Spectrum Protect
67 * *VEEAM* Veeam Backup
68
69 ReaR integrates well with Disaster Recovery Linux Manager (DRLM, see https://drlm.org), which can act as a central management tool for ReaR deployments.
70
71 Professional services and support are available, see https://relax-and-recover.org/support/
72
73 == OPTIONS
74
75 === GLOBAL OPTIONS
76
77 -h --help::
78 usage information
79
80 -c DIR::
81 alternative config directory instead of /etc/rear
82
83 -C CONFIG::
84 additional config files (absolute path or relative to config directory)
85
86 -d::
87 *debug mode*: run many commands verbosely with debug messages in the log file (also sets -v)
88
89 -D::
90 *debugscript mode*: log executed commands via 'set -x' (also sets -v and -d)
91
92 --debugscripts SET::
93 same as -D but *debugscript mode* with 'set -SET'
94
95 -r KERNEL::
96 kernel version to use (by default the version of the running kernel)
97
98 -s::
99 *simulation mode*: show what scripts are run without executing them
100
101 -S::
102 *step-by-step mode*: acknowledge each script individually
103
104 -v::
105 *verbose mode*: show messages what ReaR is doing on the terminal
106
107 -n --non-interactive::
108 *non-interactive mode*: abort in UserInput() if default input does not make ReaR proceed (experimental)
109
110 -e --expose-secrets::
111 do not suppress output of confidential values (passwords, encryption keys) in particular in the log file
112
113 -p --portable::
114 allow running any ReaR workflow, especially recover, from a git checkout or rear source archive
115
116 -V --version::
117 version information
118
119 === COMMANDS
120
121 *checklayout*::
122 check if the disk layout has changed since the last run of
123 mkbackup/mkrescue
124
125 *dump*::
126 dump configuration and system information; run this to verify
127 your setup
128
129 *format*::
130 format and label USB or tape media to be used with rear;
131 first argument is the USB or tape device to use, eg. _/dev/sdX_ or
132 _/dev/stX_
133
134 *help*::
135 print full list of commands and options
136
137 *mkbackup*::
138 create rescue media and backup the system (only for internal backup
139 methods)
140
141 *mkbackuponly*::
142 backup the system (only for internal backup methods) without creating
143 rescue media
144
145 *mkrescue*::
146 create rescue media only
147
148 *mountonly*::
149 use ReaR as live media to mount and repair the system
150
151 *recover*::
152 recover the system; can be used only when running from the rescue media
153
154 *restoreonly*::
155 only restore the backup; can be used only when running from the rescue media
156
157 *mkopalpba*::
158 create a pre-boot authentication (PBA) image to boot from TCG Opal 2-compliant self-encrypting disks
159
160 *opaladmin*::
161 administrate TCG Opal 2-compliant self-encrypting disks
162
163 *validate*::
164 submit validation information
165
166 Use 'rear -v help' for more advanced commands.
167
168
169 == BACKGROUND INFORMATION
170 The process of bare metal disaster recovery consists of two parts:
171
172 - Recreate the system layout
173 - Restore the data to the system
174
175 Most backup software solutions are very good at restoring data but do not
176 support recreating the system layout. Relax-and-Recover is very good at
177 recreating the system layout but works best when used together with
178 supported backup software.
179
180 In this combination Relax-and-Recover recreates the system layout and calls
181 the backup software to restore the actual data. Thus there is no unnecessary
182 duplicate data storage and the Relax-and-Recover rescue media can be very small.
183
184 For demonstration and special use purposes Relax-and-Recover also includes
185 an internal backup method, NETFS, which can be used to create a simple tar.gz
186 archive of the system. For all permanent setups we recommend using something
187 more professional for backup, either a traditional backup software (open
188 source or commercial) or rsync with hardlink based solutions, e.g. RSYNC
189 BACKUP MADE EASY.
190
191 == RESCUE IMAGE CONFIGURATION
192 The +OUTPUT+ variable defines from where our bootable rescue image will be
193 booted and the +OUTPUT_URL+ variable defines where the rescue image should be
194 send to. Possible +OUTPUT+ settings are:
195
196 OUTPUT=*RAMDISK*::
197 Create only the Relax-and-Recover initramfs.
198
199 OUTPUT=*ISO*::
200 *(Default)* Create a bootable ISO9660 image on disk as _rear-$(hostname).iso_
201
202 OUTPUT=*PXE*::
203 Create on a remote PXE/NFS server the required files (such as
204 configuration file, kernel and initrd image)
205
206 OUTPUT=*OBDR*::
207 Create a bootable OBDR tape (optionally including the backup archive).
208 Specify the OBDR tape device by using +TAPE_DEVICE+.
209
210 OUTPUT=*USB*::
211 Create a bootable USB disk.
212
213 OUTPUT=*RAWDISK*::
214 Create a bootable image file named "rear-$(hostname).raw.gz", which
215
216 * supports UEFI boot if syslinux/EFI or Grub 2/EFI is installed,
217 * supports Legacy BIOS boot if syslinux is installed,
218 * supports UEFI/Legacy BIOS dual boot if syslinux *and* one of the supported EFI
219 bootloaders are installed.
220
221 OUTPUT=*PORTABLE*::
222 Create a portable ReaR archive that can be used on any rescue system to run
223 any ReaR workflow, especially recover. Assumes that all required software is
224 installed and usable there. This is experimental, please report any issues.
225
226 When using +OUTPUT=ISO+, +RAMDISK+, +OBDR+, +USB+, +PORTABLE+ or +RAWDISK+ you should
227 provide the backup target location through the +OUTPUT_URL+ variable. Possible
228 +OUTPUT_URL+ settings are:
229
230 OUTPUT_URL=*file://*::
231 Write the image to disk. The default is in _/var/lib/rear/output/_.
232
233 OUTPUT_URL=*nfs://*::
234 Write the image by mounting the target filesystem via NFS.
235
236 OUTPUT_URL=*cifs://*::
237 Write the image by mounting the target filesystem via CIFS.
238
239 OUTPUT_URL=*fish://*::
240 Write the image using +lftp+ and the FISH protocol.
241
242 OUTPUT_URL=*ftp://*::
243 Write the image using +lftp+ and the FTP protocol.
244
245 OUTPUT_URL=*ftps://*::
246 Write the image using +lftp+ and the FTPS protocol.
247
248 OUTPUT_URL=*hftp://*::
249 Write the image using +lftp+ and the HFTP protocol.
250
251 OUTPUT_URL=*http://*::
252 Write the image using +lftp+ and the HTTP (PUT) protocol.
253
254 OUTPUT_URL=*https://*::
255 Write the image using +lftp+ and the HTTPS (PUT) protocol.
256
257 OUTPUT_URL=*sftp://*::
258 Write the image using +lftp+ and the secure FTP (SFTP) protocol.
259
260 OUTPUT_URL=*rsync://*::
261 Write the image using +rsync+ and the RSYNC protocol.
262
263 OUTPUT_URL=*sshfs://*::
264 Write the image using sshfs and the SSH protocol.
265
266 OUTPUT_URL=*null*::
267 Do not copy the rescue image from _/var/lib/rear/output/_ to a remote output location.
268 +OUTPUT_URL=null+ is useful when another program (e.g. an _external_ backup program)
269 is used to save the rescue image from the local system to a remote place,
270 or with +BACKUP_URL=iso:///backup+ when the backup is included in the rescue image
271 to avoid a (big) copy of the rescue image at a remote output location.
272 In the latter case the rescue image must be manually saved from the local system to a remote place.
273 +OUTPUT_URL=null+ is only supported together with +BACKUP=NETFS+.
274
275 If you do not specify +OUTPUT_URL+ variable then by default it will be aligned to what
276 was defined by variable +BACKUP_URL+. And, the rescue image will then be copied to the same
277 location as your backup of the system disk(s).
278
279 The +ISO_DEFAULT+ variable defines what default boot option is used on the rescue image.
280 Possible values are `manual`, `boothd` or `automatic`. Manual will make you boot into
281 the shell directly by default, boothd will boot to the first disk (default) or automatic
282 will automatically start in recovery mode.
283
284 == RESCUE IMAGE KERNEL COMMAND LINE OPTIONS
285 When booting the rescue image you can edit the kernel command line.
286 There are some Relax-and-Recover specific kernel command line options:
287
288 *debug*::
289 The rescue system start up scripts in /etc/scripts/system-setup.d/
290 are run one by one each one after pressing 'Enter' and
291 the scripts are run with 'set -x' which prints commands
292 and their arguments as they are executed.
293
294 *auto_recover* or *automatic*::
295 Launch 'rear recover' automatically (without automated reboot).
296 Together with 'debug' it runs 'rear recover' in debugscript mode.
297
298 *unattended*::
299 Launch 'rear recover' automatically as with 'auto_recover'
300 plus automated reboot after successful 'rear recover'.
301
302 *ip= nm= netdev= gw=*::
303 When IP address plus optionally netmask (default 255.255.255.0),
304 network device (default eth0), and default gateway are specified,
305 then only that single network device is set up. Example:
306 ----
307 ip=192.168.100.2 nm=255.255.255.0 netdev=eth0 gw=192.168.100.1
308 ----
309
310 *noip*::
311 Skip network devices setup by the rescue system start up scripts (overrides ip= nm= netdev= gw=).
312
313 == BACKUP SOFTWARE INTEGRATION
314 Currently Relax-and-Recover supports the below listed backup methods.
315
316 There is a distinction between Relax-and-Recover support for 3rd party
317 backup software and Relax-and-Recover built-in backup methods. The latter
318 also creates a backup of your data while the former will only integrate
319 Relax-and-Recover with the backup software to restore the data with the
320 help of the backup software without actually creating backups. This means
321 that for all non-built-in backup software you *must* take care of creating
322 backups yourself (unless otherwise noted).
323
324 Especially the +rear mkbackup+ command can be confusing as it is only
325 useful for the built-in backup methods and has usually no function at all with
326 the other (3rd party / external) backup methods where the +rear mkrescue+ command applies.
327
328 See the full list of supported backup methods above for reference and consult '/usr/share/rear/conf/default.conf'
329 for the full list of supported options for each backup method. Also, 'rear dump' will
330 show you the current settings for +BACKUP+ and +OUTPUT+ methods including all available options.
331
332 The default *BACKUP* method is *REQUESTRESTORE* which is not a backup method at all but simply
333 halts the recovery and requests that somebody will restore the data to the appropriate location
334 (e.g. via SSH). This method works especially well with an rsync based backup that is pushed
335 back to the backup client.
336
337 If your favourite backup software is missing from this list, please submit
338 a patch or ask us to implement it for you.
339
340 When using +BACKUP=NETFS+ you must provide the backup target location
341 through the +BACKUP_URL+ variable. Possible +BACKUP_URL+ settings are:
342
343 BACKUP_URL=*file://*::
344 To backup to local disk, use +BACKUP_URL=file:///directory/path/+
345
346 BACKUP_URL=*nfs://*::
347 To backup to NFS disk, use +BACKUP_URL=nfs://nfs-server-name/share/path+
348
349 BACKUP_URL=*tape://*::
350 To backup to tape device, use +BACKUP_URL=tape:///dev/nst0+ or alternatively,
351 simply define +TAPE_DEVICE=/dev/nst0+
352
353 BACKUP_URL=*rsync://*::
354 When backup method +BACKUP=RSYNC+ is chosen then we need to define a corresponding +BACKUP_URL+ rule:
355 +
356 ----
357 BACKUP_URL=rsync://[user@]host[:port]/path
358 BACKUP_URL=rsync://[user@]host[:port]::/path
359 ----
360
361 BACKUP_URL=*cifs://*::
362 To backup to a Samba share (CIFS), use
363 +BACKUP_URL=cifs://cifs-server-name/share/path+. To provide credentials for
364 CIFS mounting use a _/etc/rear/cifs_ credentials file and define
365 +BACKUP_OPTIONS="cred=/etc/rear/cifs"+ and pass along:
366 +
367 ----
368 username=_username_
369 password=_secret password_
370 domain=_domain_
371 ----
372
373 BACKUP_URL=*usb://*::
374 To backup to USB storage device, use +BACKUP_URL=usb:///dev/disk/by-label/REAR-000+
375 or use a partition device node or a specific filesystem label. Alternatively, you
376 may specify the partition device using +USB_DEVICE=/dev/disk/by-label/REAR-000+ if needed.
377 +
378 If you combine this with +OUTPUT=USB+ you will end up with a bootable USB
379 device.
380
381 BACKUP_URL=*sshfs://*::
382 To backup to a remote server via sshfs (SSH protocol), use
383 +BACKUP_URL=sshfs://[email protected]/home/user/backup-dir/+
384 +
385 It is advisable to add *ServerAliveInterval 15* in the +/root/.ssh/config+
386 file for the remote system (remote-system.name.org).
387
388 BACKUP_URL=*iso://*::
389 To include the backup within the ISO image. It is important that the +BACKUP_URL+ and
390 +OUTPUT_URL+ variables are different. E.g.
391 +
392 ----
393 BACKUP_URL=iso:///backup/
394 OUTPUT_URL=nfs://server/path/
395 ----
396
397 When using +BACKUP=NETFS+ and BACKUP_PROG=tar there is an option to select
398 +BACKUP_TYPE=incremental+ or +BACKUP_TYPE=differential+ to let +rear+ make
399 incremental or differential backups until the next full backup day
400 e.g. via +FULLBACKUPDAY="Mon"+ is reached or when the last full backup
401 is too old after FULLBACKUP_OUTDATED_DAYS has passed.
402 Incremental or differential backup is currently only known to work
403 with +BACKUP_URL=nfs+. Other BACKUP_URL schemes may work but
404 at least +BACKUP_URL=usb+ requires USB_SUFFIX to be set
405 to work with incremental or differential backup.
406
407 == SUPPORT FOR SELF-ENCRYPTING DISKS
408 Relax-and-Recover supports self-encrypting disks (SEDs) compliant with the TCG
409 Opal 2 specification if the `sedutil-cli` executable is installed.
410
411 Self-encrypting disk support includes
412
413 * recovery (saving and restoring the system's SED configuration),
414 * setting up SEDs, including assigning a disk password,
415 * providing a pre-boot authentication (PBA) system to unlock SEDs at boot time.
416
417 To prepare booting from an SED, run +rear mkopalpba+, then create the rescue
418 system.
419
420 To set up an SED, boot the Relax-and-Recover rescue system and run `rear
421 opaladmin setupERASE DEVICE` (_DEVICE_ being the disk device path like
422 `/dev/sda`).
423
424 For complete information, consult the section "Support for TCG Opal 2-compliant
425 Self-Encrypting Disks" in the Relax-and-Recover user guide.
426
427 == CONFIGURATION
428 To configure Relax-and-Recover you have to edit the configuration files in
429 _/etc/rear/_. All _*.conf_ files there are part of the configuration, but
430 only _site.conf_ and _local.conf_ are intended for the user configuration.
431 All other configuration files hold defaults for various distributions and
432 should not be changed.
433
434 In _/etc/rear/templates/_ there are also some template files which are used
435 by Relax-and-Recover to create configuration files (mostly for the boot
436 environment). Modify the templates to adjust the information contained in
437 the emails produced by Relax-and-Recover. You can use these templates to
438 prepend your own configurations to the configuration files created by
439 Relax-and-Recover, for example you can edit _PXE_pxelinux.cfg_ to add some
440 general pxelinux configuration you use.
441
442 In almost all circumstances you have to configure two main settings and their
443 parameters: The backup method and the output method.
444
445 The backup method defines, how your data is to be saved and whether Relax-and-Recover
446 should backup your data as part of the mkbackup workflow for internal backup methods
447 or whether you use 3rd party backup software to archive your data.
448
449 The output method defines how the rescue system is written to disk and how you
450 plan to boot the failed computer from the rescue system.
451
452 See the default configuration file _/usr/share/rear/conf/default.conf_ for
453 an overview of the possible methods and their options.
454
455 An example to use TSM for backup and ISO for output would be to add
456 these lines to _/etc/rear/local.conf_ (no need to define a +BACKUP_URL+
457 when using an external backup solution):
458
459 BACKUP=TSM
460 OUTPUT=ISO
461
462 And if all your systems use NTP for time synchronisation, you can also
463 add these lines to _/etc/rear/site.conf_
464
465 TIMESYNC=NTP
466
467 Do not forget to distribute the _site.conf_ to all your systems.
468
469 The resulting ISO image will be created in _/var/lib/rear/output/_.
470 You can now modify the behaviour by copying the appropriate
471 configuration variables from _default.conf_ to _local.conf_ and
472 changing them to suit your environment.
473
474
475 == EXIT STATUS
476 0::
477 Successful program execution.
478 >0::
479 Usage, syntax or execution errors. Check the log file in
480 _/var/log/rear/_ for more information.
481
482
483 == EXAMPLES
484 To print out the current settings for +BACKUP+ and +OUTPUT+ methods and some
485 system information. This command can be used to see the supported features
486 for the given release and platform.
487
488 # rear dump
489
490 To create a new rescue environment. Do not forget to copy the resulting
491 rescue system away so that you can use it in the case of a system failure.
492
493 # rear -v mkrescue
494
495 To create a new rescue image together with a complete archive of your local
496 system run the command:
497
498 # rear -v mkbackup
499
500
501 == FILES
502 /usr/sbin/rear::
503 The program itself.
504
505 /etc/rear/local.conf::
506 System specific configuration can be set here.
507
508 /etc/rear/site.conf::
509 Site specific configuration can be set here (not created by default).
510
511 /var/log/rear/::
512 Directory holding the log files.
513
514 /tmp/rear.##############::
515 Relax-and-Recover working directory. If Relax-and-Recover exits with an error,
516 you must remove this directory manually.
517
518 /usr/share/rear::
519 Relax-and-Recover script components.
520
521 /usr/share/rear/conf/default.conf::
522 Relax-and-Recover default values. Contains a complete set of parameters
523 and its explanation. Do not edit or modify things therein but
524 use _local.conf_ or _site.conf_ for specific settings.
525
526
527 == BUGS
528 Feedback is welcome, please report issues or improvements to our
529 issue-tracker at: http://github.com/rear/issues/
530
531 Furthermore, we welcome pull requests via GitHub.
532
533 == SEE ALSO
534 Relax-and-Recover comes with extensive documentation located in
535 _/usr/share/doc_.
536
537
538 == AUTHORS
539 The ReaR project was initiated in 2006 by Schlomo Schapiro (https://github.com/schlomo) and
540 Gratien D'haese (https://github.com/gdha) and has since then seen a lot of contributions by many authors.
541 As ReaR deals with bare metal disaster recovery, there is a large amount of code
542 that was contributed by owners and users of specialized hardware and software.
543 Without their combined efforts and contributions ReaR would not be
544 the universal Linux bare metal disaster recovery solution that it is today.
545
546 As time passed the project was lucky to get the support of additional developers to also help as maintainers:
547 Dag Wieers (https://github.com/dagwieers),
548 Jeroen Hoekx (https://github.com/jhoekx),
549 Johannes Meixner (https://github.com/jsmeix),
550 Vladimir Gozora (https://github.com/gozora),
551 Sebastien Chabrolles (https://github.com/schabrolles),
552 Renaud Metrich (https://github.com/rmetrich) and
553 Pavel Cahyna (https://github.com/pcahyna).
554 We hope that ReaR continues to prove useful and to attract more developers who agree to be maintainers.
555 Refer to the MAINTAINERS (https://github.com/rear/rear/blob/master/MAINTAINERS) file for the list of active and past maintainers.
556
557 To see the full list of authors and their contributions
558 look at the git history (https://github.com/rear/rear/graphs/contributors).
559 We are very thankful to all authors and encourage anybody interested
560 to take a look at our source code and to contribute what you find important.
561
562 Relax-and-Recover is a developed with a collaborative process using Github at http://github.com/rear/
563
564 The Relax-and-Recover website is located at: http://relax-and-recover.org/
565
566
567 == COPYRIGHT
568 (c) 2006-2022
569
570 The copyright is held by the original authors of the respective code pieces as can be seen in the git history at https://github.com/rear/rear/graphs/contributors
571
572 Relax-and-Recover comes with ABSOLUTELY NO WARRANTY; for details
573 see the GNU General Public License at http://www.gnu.org/licenses/gpl.html