-
Notifications
You must be signed in to change notification settings - Fork 246
/
default.conf
2987 lines (2846 loc) · 157 KB
/
default.conf
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# conf/default.conf
# Relax-and-Recover default configuration.
# This file is part of Relax-and-Recover, licensed under the GNU General
# Public License. Refer to the included COPYING for full text of license.
#
#
# Here we define and describe all configuration variables and set them to a default.
#
# Do not change them here. Set them in your site.conf or local.conf file as needed.
#
# Some variables are actually bash arrays and should be treated with care.
# Use VAR=() to set an empty array.
# Use VAR+=( 'value' ) to add a fixed value to an array.
# Use VAR+=( "$var" ) to add a variable value to an array.
# Whether or not the latter case works as intended depends on when and
# how "$var" is set and evaluated by the Relax-and-Recover scripts.
# Be careful with values that are globbing patterns (cf. COPY_AS_IS below).
# In general using ${VAR[*]} is problematic and using ${VAR[@]} without
# double-quotes is also problematic, see 'Arrays' in "man bash" and
# see https://github.com/rear/rear/issues/1068 for some examples.
#
# Most variables can be set to an empty value VAR= which means that this
# setting is off or set to some automatic mode.
#
# Boolean variables can be set to anything as we only check whether the variable
# is not empty so that both VAR=yes and VAR=no evaluate to boolean 'true'.
# To set a boolean variable to 'false' set it to an empty value.
#
# Some variables have ternary semantics:
# - explicit true value like True T true t Yes Y yes y 1
# - explicit false value like False F false f No N no n 0
# - unset or empty or a value that is neither a true value nor a false value
# (see the is_true and is_false functions in lib/global-functions.sh).
#
# In case of doubt inspect the scripts how exactly a particular variable works.
##
# TMPDIR
#
# Relax-and-Recover needs a (temporary) working area where it builds in particular
# the rescue/recovery system ISO image (and perhaps even stores the backup archive).
# The directory name of the working area is created in /usr/sbin/rear by calling
# mktemp -d -t rear.XXXXXXXXXXXXXXX
# which usually results /tmp/rear.XXXXXXXXXXXXXXX or $TMPDIR/rear.XXXXXXXXXXXXXXX
# the latter when the canonical Linux/Unix environment variable TMPDIR
# is set in the environment where /usr/sbin/rear is called.
# To have a specific working area directory prefix for Relax-and-Recover
# specify in /etc/rear/local.conf something like
#
# export TMPDIR="/prefix/for/rear/working/directory"
#
# where /prefix/for/rear/working/directory must already exist.
# This is useful for example when there is not sufficient free space
# in /tmp or $TMPDIR for the ISO image or even the backup archive.
# TMPDIR cannot be set to a default value here, otherwise /usr/sbin/rear
# would not work in compliance with the Linux/Unix standards regarding TMPDIR
# see https://github.com/rear/rear/issues/968
# You can override autodetection and specify the kernel for the rescue/recovery system:
KERNEL_FILE=""
# The kernel configuration is used to collect the kernel binary and modules.
# It can be set to a different version (e.g. to create a UP rescue media on a SMP system):
KERNEL_VERSION="${KERNEL_VERSION:-$( uname -r )}"
# You can add arbitrary kernel command line parameters when booting the rescue/recovery system
# as you need it (e.g. things like 'console=...' see USE_SERIAL_CONSOLE below).
# Additionally Relax-and-Recover supports the following special kernel command line parameters:
# - 'debug' starts all init-scripts (in /etc/scripts/system-setup.d/ in the rescue/recovery system)
# in debug mode (via 'set -x') and asks for confirmation before it runs each init-script
# so that you can skip a script if needed.
# - 'noip' prevents initialization of the networking configuration which is useful when
# you want to do the networking configuration manually in the rescue/recovery system
# e.g. to prevent the rescue/recovery system to use the same IP address as the original system
# but for the latter using USE_DHCLIENT="yes" (see below) is probably easier:
KERNEL_CMDLINE=""
# The COPY_KERNEL_PARAMETERS array lists kernel parameter that should be part of the KERNEL_CMDLINE (in rescue image)
# if present on the current system (/proc/cmdline).
# COPY_KERNEL_PARAMETERS should only store kernel parameter key, not the value (ex: net.ifnames but not net.ifnames=0)
# If the key-value kernel parameter is already set in KERNEL_CMDLINE variable it will always superseed
# the one detected on the current system (if any).
# - Check net.ifnames and biosdevname kernel parameter as it may impact the network interface name during recovery/migration.
COPY_KERNEL_PARAMETERS=( 'net.ifnames' 'biosdevname' )
# These variables are used to include arch/os/version specific stuff:
# machine architecture, OS independent
REAL_MACHINE="$( uname -m )"
case "$REAL_MACHINE" in
(x86_64|i686|i586)
# all these behave exactly like i386. For 64bit we took care to handle the
# special cases within the 32bit scripts to prevent code duplication
MACHINE=i386
;;
(arm*|aarch*)
MACHINE=arm
;;
(s390*)
MACHINE=s390
;;
(*)
MACHINE=$REAL_MACHINE
esac
# Architecture, e.g. Linux-i386
ARCH="$( uname -s )-$MACHINE" 2>>/dev/null
REAL_ARCH="$( uname -s )-$REAL_MACHINE" 2>>/dev/null
# Short hostname
HOSTNAME="$( hostname -s 2>/dev/null || uname -n | cut -d. -f1 )"
# Logfile name
# NOTE: This may not be dynamic, else deal with .bash_history in rescue system
LOGFILE="$LOG_DIR/rear-$HOSTNAME.log"
# Operating System, e.g. GNU/Linux
OS="$( uname -o )"
# Vendors are SUSE, Red Hat, Debian, Ubuntu, etc.
# as returned by lsb_release -i -s
OS_VENDOR=generic
# Versions are 9.0, 10, 12.2, etc.
# as returned by lsb_release -r -s
OS_VERSION=none
# Only with OS_VENDOR=generic and OS_VERSION=none
# the OS_VENDOR and OS_VERSION variables are automatically
# determined and set (via the above lsb_release calls).
# Setting OS_VENDOR or OS_VERSION to invalid or unsupported values
# results undefined behaviour for things that depend on those variables.
# If on your system the above lsb_release calls result values
# that are not yet supported by ReaR you may specify appropriate
# supported values that could make it work even for your system.
# See the SetOSVendorAndVersion function in the config-functions.sh script.
# Keep the build area after we are done (ternary).
# Useful to inspect the ReaR recovery system content in $TMPDIR/rear.XXXXXXXXXXXXXXX/rootfs/
# directly without the need to extract it from the initramfs/initrd in the ISO image.
# Set to "y", "Yes", etc. to always keep the build area, to "n", "No", etc. to never keep it.
# KEEP_BUILD_DIR is automatically set to true in debug mode (-d) and in debugscript mode (-D).
# In addition to true (any value that is recognized as 'yes' by the is_true function)
# and false (any value that is recognized as 'no' by the is_false function) it can be set
# to several special values:
# - "errors" to obtain the old behaviour where KEEP_BUILD_DIR was always set
# to true to keep the build area when errors in the ReaR recovery system were detected.
# - empty (KEEP_BUILD_DIR="") which means that the build area will be kept on errors
# if running interactively (in a terminal) and not otherwise (to avoid cluttering
# /tmp by cron or other automated jobs in case of errors).
KEEP_BUILD_DIR=""
# No default workflows. This variable is filled in where the workflows are defined
# without the empty string as initial value WORKFLOWS and LOCKLESS_WORKFLOWS would
# be unbound variables that would result an error exit if 'set -eu' is used:
WORKFLOWS=("")
# Allow some workflows to not lock and use a separate logfile named 'LOGFILE.lockless'.
# The LOCKLESS_WORKFLOWS array gets filled during runtime as needed by the various
# usr/share/rear/lib/WORKFLOW-workflow.sh scripts. Currently the following workflows
# add themselves to the LOCKLESS_WORKFLOWS array: checklayout dump help
# To make setting the right logfile name working in usr/sbin/rear
# the lockless workflows must also be predefined here (cf. usr/sbin/rear):
LOCKLESS_WORKFLOWS=( 'checklayout' 'dump' 'help' )
# SIMULTANEOUS_RUNNABLE_WORKFLOWS are also allowed to run simultaneously
# but cannot use LOGFILE.lockless as the LOCKLESS_WORKFLOWS.
# Instead the SIMULTANEOUS_RUNNABLE_WORKFLOWS get a LOGFILE with PID
# because simultaneously runnable workflows require unique logfile names
# so that the PID is interposed in the LOGFILE value from default.conf above,
# i.e. by default SIMULTANEOUS_RUNNABLE_WORKFLOWS use during runtime
# a logfile named /var/log/rear/rear-$HOSTNAME.$$.log that gets
# at the end copied to a final possibly used-defined LOGFILE,
# see /usr/sbin/rear and https://github.com/rear/rear/issues/1102
SIMULTANEOUS_RUNNABLE_WORKFLOWS=( 'mkbackuponly' 'restoreonly' )
##
# MESSAGE_PREFIX
#
# Get messages of Relax-and-Recover output functions prefixed with ${MESSAGE_PREFIX}.
# Other output (e.g. from programs that are called) is not prefixed.
# By default MESSAGE_PREFIX is empty but the user can set it e.g. to MESSAGE_PREFIX="$$: "
# to get ReaR messages prefixed with the PID of the running 'rear' main program which is
# basically a requirement when workflows are run simultaneously to get distinguishable
# messages (cf. SIMULTANEOUS_RUNNABLE_WORKFLOWS)
MESSAGE_PREFIX=""
##
# PROGRESS_MODE
#
# How progress messages are shown (cf. lib/progresssubsystem.nosh).
# PROGRESS_MODE can be "ANSI" (default/fallback) or "plain".
# When there is a tty on stdout messages via the progress subsystem
# are by default shown with ANSI escape sequences so that all
# subsequent progress messages appear on one same line.
# With PROGRESS_MODE="plain" the progress subsystem outputs the same
# messages as in "ANSI" mode but without ANSI escape sequences.
# PROGRESS_MODE="plain" is basically a requirement when workflows
# are run simultaneously (cf. SIMULTANEOUS_RUNNABLE_WORKFLOWS) because
# otherwise the progress messages from simultaneously running workflows
# would mix up on one same line which results illegible and meaningless
# output on the terminal
PROGRESS_MODE="ANSI"
##
# PROGRESS_WAIT_SECONDS
#
# The number of seconds between subsequent progress messages that are output
# via the progress subsystem while a longer task (usually backup or restore) runs.
# The default/fallback is 1 second. Setting e.g. PROGRESS_WAIT_SECONDS="5" can be
# used to get less progress messages on the terminal but at the same time it delays
# continuing after the task (e.g. backup or restore) had finished by half that time
# on average up to at most the whole amount of PROGRESS_WAIT_SECONDS
PROGRESS_WAIT_SECONDS="1"
##
# Relax-and-Recover UserInput function default behaviour
#
# see the UserInput function decription in
# usr/share/rear/lib/_input-output-functions.sh
#
# USER_INPUT_TIMEOUT
# USER_INPUT_INTERRUPT_TIMEOUT
# USER_INPUT_PROMPT
# USER_INPUT_MAX_CHARS
# USER_INPUT_user_input_ID
#
# USER_INPUT_TIMEOUT specifies the default timeout in seconds
# after that UserInput() automatically proceeds with a default value.
# That timeout interrupts a possibly ongoing user input
# (same as the timeout of the 'read' bash builtin).
# The UserInput timeout must be sufficiently long for the user
# to read and understand the possibly unexpected UserInput() message
# and then some more time to make a decision whether or not
# the default action ("just proceed") is actually the right one
# in his particular case and finally even more time to enter
# his particular input when the default is not the right one.
# USER_INPUT_TIMEOUT is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_TIMEOUT=30
# directly before he calls "rear ...":
test "$USER_INPUT_TIMEOUT" || USER_INPUT_TIMEOUT=300
#
# USER_INPUT_INTERRUPT_TIMEOUT specifies the default timeout in seconds
# for how long UserInput() waits for the user to interrupt an automated input
# when a predefined input value is specified for a particular UserInput() call
# via a matching USER_INPUT_user_input_ID variable (see below).
# The minimum waiting time to interrupt an automated input is one second.
# The default is 5 seconds to give the user a better chance to recognize
# an automated input and be able to actually hit a key to interrupt.
# USER_INPUT_INTERRUPT_TIMEOUT is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_INTERRUPT_TIMEOUT=10
# directly before he calls "rear ...":
test "$USER_INPUT_INTERRUPT_TIMEOUT" || USER_INPUT_INTERRUPT_TIMEOUT=5
#
# USER_INPUT_PROMPT specifies the default prompt text that is shown
# if no prompt was specified for a particular UserInput() call.
# USER_INPUT_PROMPT is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_PROMPT="$HOSTNAME input"
# directly before he calls "rear ...":
test "$USER_INPUT_PROMPT" || USER_INPUT_PROMPT='enter your input'
#
# USER_INPUT_MAX_CHARS specifies the default maximum characters until
# the UserInput function truncates further input and returns.
# USER_INPUT_MAX_CHARS is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_MAX_CHARS=200
# directly before he calls "rear ...":
test "$USER_INPUT_MAX_CHARS" || USER_INPUT_MAX_CHARS=1000
#
# USER_INPUT_user_input_ID variables can be used to predefine automated
# input for UserInput() calls with the matching user_input_ID value.
# Each UserInput() call has a specific user_input_ID that is shown
# when ReaR is run in debug mode (via the '-d' command line option).
# For example "rear -d recover" may show something like:
# UserInput -I LAYOUT_MIGRATION_CONFIRM_MAPPINGS needed ...
# Confirm or edit the disk mapping
# 1) Confirm disk mapping and continue 'rear recover'
# 2) Edit disk mapping (/var/lib/rear/layout/disk_mappings)
# 3) Use Relax-and-Recover shell and return back to here
# 4) Abort 'rear recover'
# (default '1' timeout 300 seconds)
# In this case one can specify a predefined input in local.conf like
# USER_INPUT_LAYOUT_MIGRATION_CONFIRM_MAPPINGS=2
# or directly on command line before running "rear recover" like
# export USER_INPUT_LAYOUT_MIGRATION_CONFIRM_MAPPINGS=2
# The user_input_ID that is shown 'LAYOUT_MIGRATION_CONFIRM_MAPPINGS'
# must be appended to a USER_INPUT_ variable prefix to get the right
# USER_INPUT_LAYOUT_MIGRATION_CONFIRM_MAPPINGS variable name.
# Then the "Edit disk mapping" choice will be selected automatically.
# In this case the USER_INPUT_INTERRUPT_TIMEOUT is crucial because
# otherwise one would be caught in an endless "Edit disk mapping" loop.
# Default backup and output targets:
BACKUP=REQUESTRESTORE
OUTPUT=ISO
# Default cdrom size in MB (probably it is actually MiB?):
CDROM_SIZE=20
# The CHECK_CONFIG_FILES array lists files where changes
# require the ReaR rescue/recovery system to be recreated.
# Testing whether or not those files changed is implemented in the checklayout workflow
# which exits with non-zero exit code when the disk layout or those files changed
# (cf. https://github.com/rear/rear/issues/1134) but the checklayout workflow
# does not automatically recreate the rescue/recovery system.
CHECK_CONFIG_FILES=( '/etc/drbd/' '/etc/drbd.conf' '/etc/lvm/lvm.conf' '/etc/multipath.conf' '/etc/rear/' '/etc/udev/udev.conf' )
##
# Relax-and-Recover recovery system update during "rear recover"
#
# see https://github.com/rear/rear/issues/841
# and https://hackweek.suse.com/14/projects/1508
#
# The by default empty RECOVERY_UPDATE_URL means this functionality is not used so that
# "rear recover" runs as usual without updating any files in the ReaR recovery system
# (i.e. with the recovery system as "rear mkbackup" or "rear mkrescue" had made it).
#
# If RECOVERY_UPDATE_URL is non-empty it points to a download location
# wherefrom "rear recover" will first of all download a tar.gz archive and
# extract that at the root directory '/' in the ReaR recovery system.
#
# The intended purpose is to download and replace in the recovery system ReaR config files
# (usually the content of /etc/rear/ and /var/lib/rear/recovery/ and /var/lib/rear/layout/)
# with updated ReaR config files.
#
# But it is not limited to replace only ReaR config files in the recovery system.
# Anything in the tar.gz archive will be extracted at '/' in the recovery system
# (even if it destroys the recovery system) so that it can also be used to update
# anything in the recovery system - provided one does the update carefully.
# For example one should not replace currently running ReaR scripts.
#
# Currently only a HTTP download location is supported like
# RECOVERY_UPDATE_URL="http://my_internal_server/$HOSTNAME.rear_config.tgz"
# so that "curl -o recovery-update.tar.gz $RECOVERY_UPDATE_URL" will work.
# Accordingly when using RECOVERY_UPDATE_URL="http://..."
# curl should be added to the REQUIRED_PROGS array like
# REQUIRED_PROGS+=( curl )
#
# RECOVERY_UPDATE_URL is set to a default value here only
# if not already set so that the user can set it also via
# export RECOVERY_UPDATE_URL="http://my_internal_server/host123_rear_config.tgz"
# directly before he calls "rear recover":
test "$RECOVERY_UPDATE_URL" || RECOVERY_UPDATE_URL=""
##
# MIGRATION_MODE recovery during "rear recover"
#
# There is some basic autodetection during "rear recover" when
# disks on the replacement hardware seem to not match compared to
# what there was stored in disklayout.conf on the original system.
# If a mismatch is autodetected then ReaR goes into its
# MIGRATION_MODE where manual disk layout configuration happens.
# In this case ReaR asks the user via several user dialogs what to do.
# Only the disk size is used to determine whether or not
# disks on the replacement hardware match the disks on the original system.
# Problems only appear when more than one disk with same size is used.
# Examples:
# When on the original system and on the replacement hardware two disks
# with same size are used the disk devices may get interchanged
# so that what there was on /dev/sda on the original system may get
# recreated on /dev/sdb on the replacement hardware and vice versa.
# When on the original system one disk is used for the system and
# another disk with same size for the ReaR recovery system and backup
# the disk devices may get interchanged on the replacement hardware
# so that "rear recover" could result an ultimate disaster
# (instead of a recovery from a disaster) if it recreated the system
# on the disk where the ReaR recovery system and backup is
# which would overwrite/destroy the backup via parted and mkfs
# (cf. https://github.com/rear/rear/issues/1271).
# Therefore to be on the safe side and to avoid such problems
# ReaR goes by default automatically into its MIGRATION_MODE
# when more than one disk with same size is used on the original system
# or when for one of the used disk sizes on the original system
# more than one disk with same size is found on the replacement hardware
# i.e. when there is more than one possible target disk.
# Accordingly ReaR goes by default not into its MIGRATION_MODE
# only if for each used disk size on the original system eaxctly one
# possible target disk with same size is found on the replacement hardware.
# By setting MIGRATION_MODE='true' one can enfore MIGRATION_MODE.
# The by-default empty MIGRATION_MODE results that MIGRATION_MODE
# is set via the above described autodetection during "rear recover".
# MIGRATION_MODE is set to a default value here only
# if not already set so that the user can set it also via
# export MIGRATION_MODE='true'
# directly before he calls "rear recover":
test "$MIGRATION_MODE" || MIGRATION_MODE=''
##
# Resizing partitions in MIGRATION_MODE during "rear recover"
#
# AUTORESIZE_PARTITIONS
# AUTORESIZE_EXCLUDE_PARTITIONS
# AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE
# AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE
#
# For details see the scripts
# usr/share/rear/layout/prepare/default/420_autoresize_last_partitions.sh
# and
# usr/share/rear/layout/prepare/default/430_autoresize_all_partitions.sh
#
# When AUTORESIZE_PARTITIONS is false, no partition is resized.
#
# When AUTORESIZE_PARTITIONS is true, all active partitions on all active disks
# get resized by the 430_autoresize_all_partitions.sh script
# (except boot and swap partitions via some special hardcoded rules in that script)
# if the disk size had changed (i.e. only in migration mode).
# This does not resize volumes on top of the affected partitions.
#
# A true or false value must be the first one in the AUTORESIZE_PARTITIONS array.
#
# When the first value in AUTORESIZE_PARTITIONS is neither true nor false
# only the last active partition on each active disk gets resized
# by the 420_autoresize_last_partitions.sh script.
#
# The following applies only when the last active partition on each active disk
# gets resized by the 420_autoresize_last_partitions.sh script:
#
# In particular this does not resize volumes on top of the affected partitions.
# To migrate volumes on a disk where the disk size had changed the user must in advance
# manually adapt his disklayout.conf file before he runs "rear recover".
#
# All other values in the AUTORESIZE_PARTITIONS array specify partition device nodes
# e.g. as in AUTORESIZE_PARTITIONS=( /dev/sda2 /dev/sdb3 )
# where last partitions with those partition device nodes should be resized
# (i.e. this way only last partitions can be specified to be resized)
# regardless of what is specified in the AUTORESIZE_EXCLUDE_PARTITIONS array.
#
# The values in the AUTORESIZE_EXCLUDE_PARTITIONS array specify partition device nodes
# where partitions with those partition device nodes are excluded from being resized.
# The special values 'boot', 'swap', and 'efi' specify that
# - partitions where its filesystem mountpoint contains 'boot' or 'bios' or 'grub'
# or where its GPT name or flags contain 'boot' or 'bios' or 'grub' (anywhere case insensitive)
# - partitions for which an active 'swap' entry exists in disklayout.conf
# or where its GPT name or flags contain 'swap' (anywhere case insensitive)
# - partitions where its filesystem mountpoint contains 'efi' or 'esp'
# or where its GPT name or flags contains 'efi' or 'esp' (anywhere case insensitive)
# are excluded from being resized e.g. as in
# AUTORESIZE_EXCLUDE_PARTITIONS=( boot swap efi /dev/sdb3 /dev/sdc4 )
#
# In general ReaR is not meant to somehow "optimize" a system during "rear recover".
# ReaR is meant to recreate a system as much as possible exactly as it was before.
# Accordingly the automated resizing by the 420_autoresize_last_partitions.sh script
# implements a "minimal changes" approach:
#
# When the new disk is a bit smaller (at most AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE percent),
# only the last (active) partition gets shrinked but all other partitions are not changed.
# When the new disk is smaller than AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE percent it errors out.
# To migrate onto a substantially smaller new disk the user must in advance
# manually adapt his disklayout.conf file before he runs "rear recover".
#
# When the new disk is not much bigger (less than AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE percent),
# no partition gets increased (which leaves the bigger disk space at the end of the disk unused).
# When the new disk is substantially bigger (at least AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE percent),
# only the last (active) partition gets increased but all other partitions are not changed.
# To migrate various partitions onto a substantially bigger new disk the user must in advance
# manually adapt his disklayout.conf file before he runs "rear recover".
#
# Because only the end value of the last partition may get changed, the partitioning alignment
# of the original system is not changed, cf. https://github.com/rear/rear/issues/102
#
# Because only the last active (i.e. not commented in disklayout.conf) partition on a disk
# may get changed, things go wrong if another partition is actually the last one on the disk
# but that other partition is commented in disklayout.conf (e.g. because that partition
# is a partition of another operating system that is not mounted during "rear mkrescue").
# To migrate a system with a non-active last partition onto a bigger or smaller new disk
# the user must in advance manually adapt his disklayout.conf file before he runs "rear recover".
#
AUTORESIZE_PARTITIONS=''
AUTORESIZE_EXCLUDE_PARTITIONS=( boot swap efi )
AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE=2
AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE=10
##
# Creating XFS filesystems during "rear recover"
#
# MKFS_XFS_OPTIONS
# MKFS_XFS_OPTIONS_...
#
# For details see the script
# usr/share/rear/layout/prepare/GNU/Linux/130_include_filesystem_code.sh
# and for some reasoning behind you may have a look at
# https://github.com/rear/rear/pull/2005
#
# During "rear mkrescue/mkbackup" the script layout/save/GNU/Linux/230_filesystem_layout.sh
# calls 'xfs_info' and stores its output in var/lib/rear/layout/xfs/XFS_DEVICE.xfs files
# where XFS_DEVICE is the basename of the device where the XFS filesystem is (e.g. sda2).
# By default during "rear recover" the XFS filesystem on that device gets recreated
# with matching mkfs.xfs options according to the stored 'xfs_info' output so that
# XFS filesystems should get recreated with same XFS filesystem options as before.
#
# In particular in MIGRATION_MODE when disk devices had changed it could be needed
# to recreate XFS filesystems with different XFS filesystem options as before.
# MKFS_XFS_OPTIONS specifies global mkfs.xfs options for recreating all XFS filesystems.
# Device specific mkfs.xfs options can be specified for each XFS device via
# MKFS_XFS_OPTIONS_XFS_DEVICE where XFS_DEVICE is the basename of the device
# but only uppercase letters and digits to ensure a valid bash variable name.
# For example for /dev/sda2 it would be MKFS_XFS_OPTIONS_SDA2 and
# for /dev/mapper/ACME_1000-part3 it would be MKFS_XFS_OPTIONS_ACME1000PART3
# Common global options can be specified first like MKFS_XFS_OPTIONS="global options"
# and used via MKFS_XFS_OPTIONS_SDA2="$MKFS_XFS_OPTIONS additional options for sda2"
# versus separated options as in MKFS_XFS_OPTIONS_SDB3="all options for sdb3".
# To recreate XFS filesystems with the mkfs.xfs defaults (i.e. without mkfs.xfs options)
# specify a space MKFS_XFS_OPTIONS=' ' or MKFS_XFS_OPTIONS_SDA2=' ' only for sda2.
#
# The by-default empty MKFS_XFS_OPTIONS results that the mkfs.xfs options are set
# via the above described default according to the stored 'xfs_info' output.
# MKFS_XFS_OPTIONS is set to a default value here only
# if not already set so that the user can set it also via
# export MKFS_XFS_OPTIONS="..."
# directly before he calls "rear recover":
test "$MKFS_XFS_OPTIONS" || MKFS_XFS_OPTIONS=''
##
# Support for TCG Opal 2-compliant Self-Encrypting Disks
# (see doc/user-guide/13-tcg-opal-support.adoc)
#
# Output location for the Pre-Boot Authentication (PBA) System (empty for not using a PBA).
# (For URL syntax, see "Using OUTPUT_URL..." in doc/user-guide/03-configuration.adoc.)
# This URL specifies
# - where PBA output shall be stored by "rear mkopalpba", and
# - where to find a local PBA image file during "rear mkrescue" and "rear opaladmin" (but can
# be overridden by OPAL_PBA_IMAGE_FILE).
# The actual PBA image file resides below the OPAL_PBA_OUTPUT_URL directory at
# "$HOSTNAME/TCG-Opal-PBA-$HOSTNAME.raw".
# NOTE: If a local directory is specified, Relax-and-Recover will automatically pick
# up the PBA image when installing it to local disks or when building a rescue system.
OPAL_PBA_OUTPUT_URL="file://$VAR_DIR/TCG-Opal-PBA"
#
# Full path of a local PBA image file.
# This local path specifies the PBA image to be used by "rear mkrescue" and "rear opaladmin".
# If not set (the default) and OPAL_PBA_OUTPUT_URL points to a local directory, the location is
# determined by OPAL_PBA_OUTPUT_URL.
OPAL_PBA_IMAGE_FILE=""
#
# These variables extend their non-prefixed counterparts (PROGS, COPY_AS_IS, etc.) for the PBA system only.
# Their main purpose is to include the necessary files for a Plymouth graphical boot animation, which
# provides a nice looking user interface to enter the disk password.
OPAL_PBA_PROGS=()
OPAL_PBA_COPY_AS_IS=()
OPAL_PBA_LIBS=()
OPAL_PBA_KERNEL_CMDLINE=""
# The following variable sets USE_SERIAL_CONSOLE for the PBA system.
OPAL_PBA_USE_SERIAL_CONSOLE=""
#
# PBA debug password (empty for not using the debug shell facility).
# If this pseudo-password is entered when the PBA asks for a password to unlock disks,
# an interactive emergency shell will be started.
# Used to debug the PBA system.
OPAL_PBA_DEBUG_PASSWORD=""
#
# When not empty, OPAL_PBA_DEBUG_DEVICE_COUNT overrides the number of TCG Opal 2-compliant self-encrypting disks
# installed. To test the PBA system on a machine without any Opal 2-compliant disk, set OPAL_PBA_DEBUG_DEVICE_COUNT=1.
# Used to debug the PBA system.
OPAL_PBA_DEBUG_DEVICE_COUNT=""
##
# Output/backup locations
##
# The URL defines the remote share as <scheme>://<host>/<share> like these examples:
# nfs://host.domain/path/path/path
# cifs://server.domain/share
# usb:///dev/sdb1
# others might also work, if they can be mounted with mount <host>:/<path>
# there is special support for tape:///dev/nst0
# Additional options to the mount command are given using *_OPTIONS
# Alternatively, you can provide your own mount/unmount commands, in that case
# Relax-and-Recover will append its mountpoint to the command.
# Specify the location of the backup (see text above):
BACKUP_URL=
# BACKUP_OPTIONS variable contains the mount options, do not confuse with BACKUP_PROG_OPTIONS
BACKUP_OPTIONS=
BACKUP_MOUNTCMD=
BACKUP_UMOUNTCMD=
# Specify the location of the output:
# When OUTPUT_URL is not specified it inherits the BACKUP_URL value.
OUTPUT_URL=
OUTPUT_OPTIONS=
OUTPUT_MOUNTCMD=
OUTPUT_UMOUNTCMD=
OUTPUT_PREFIX="$HOSTNAME"
# Keep an older copy of the output (mv $OUTPUT_PREFIX $OUTPUT_PREFIX.old before we copy the new version)
# empty means only keep current output:
KEEP_OLD_OUTPUT_COPY=
# The remote file system layout for OUTPUT=PXE can be modified to accommodate different TFTP server layouts
# (simply overwrite OUTPUT_PREFIX_PXE).
#OUTPUT_PREFIX_PXE="$OUTPUT_PREFIX" # make it empty - see issue #570 (DRLM will fill it up)
OUTPUT_PREFIX_PXE=""
##
# OUTPUT=RAMDISK stuff
##
# With OUTPUT=RAMDISK the ReaR rescue/recovery system initramfs/initrd
# is created but nothing additional is done to make it bootable.
#
# The script output/RAMDISK/default/900_copy_ramdisk.sh adds the initramfs
# plus the kernel to the RESULT_FILES array so that the subsequent
# script output/default/950_copy_result_files.sh will copy them
# to the output location specified via OUTPUT_URL (or inherited from BACKUP_URL).
#
# With non-empty RAMDISK_SUFFIX
# the kernel at the output location will be kernel-$RAMDISK_SUFFIX
# the initramfs at the output location will be initramfs-$RAMDISK_SUFFIX.img
RAMDISK_SUFFIX="$HOSTNAME"
##
# OUTPUT=ISO stuff
##
# OUTPUT=ISO produces files suitable for booting with SYSLINUX/ISOLINUX and assumes that the result
# will be written sequentially to a read-only medium with limited size (e.g. optical medium like CD-ROM).
#
# Default "local" ISO directory (usually /var/lib/rear/output). However, to avoid duplicate ISO images when
# also using the OUTPUT_URL variable with a file syntax, it is then better only to use ISO_DIR.
# Keep in mind that ISO_DIR works only with an absolute directory path and does not replace OUTPUT_URL
# which supports the NETFS syntax (to copy the ISO image across the network).
ISO_DIR=$VAR_DIR/output
#
# Default ISO label:
# When the backup is split on multiple ISOs (cf. ISO_MAX_SIZE below)
# the first ISO 'rear-HOSTNAME.iso' has the label $ISO_VOLID
# and subsequent ISOs 'rear-HOSTNAME_01.iso' 'rear-HOSTNAME_02.iso' ...
# get the labels ${ISO_VOLID}_01 ${ISO_VOLID}_02 ... respectively.
# The default value RELAXRECOVER is too long to fit a FAT32 volume label
# so that the actual FAT32 volume label on the medium is truncated
# which lets 'rear recover' fail because ReaR cannot mount it with
# the RELAXRECOVER volume label so that in case of FAT32 or any other
# filesystem that only support short volume labels the ISO_VOLID value
# must be appropriately specified in /etc/rear/local.conf
ISO_VOLID="RELAXRECOVER"
#
# How to find isolinux.bin.
# Possible values are "" (meaning search for it) or "/path/to/isolinux.bin"
ISO_ISOLINUX_BIN=""
#
# Maximum size of generated ISO images.
# Multiple ISO images will be generated if the size exceeds ISO_MAX_SIZE.
# The ISO_MAX_SIZE value is specified in MiB
# (is is used in a "split -b ${ISO_MAX_SIZE}m ..." command).
# It is useful when the backup is included within the ISO image
# (i.e. together with things like 'BACKUP_URL=iso:///backup').
# ISO_MAX_SIZE cannot be less than what the ReaR rescue/recovery system needs
# because the recovery system must fit onto one (bootable) recovery medium
# so that the recovery system must be made as a single (bootable) ISO.
# When the backup is split on multiple ISOs, then "rear mkrescue" would destroy
# the backup because after "rear mkbackup" the first ISO 'rear-HOSTNAME.iso'
# contains the recovery system plus the first part of the splitted backup
# but "rear mkrescue" overwrites that first ISO with one that contains only
# a new recovery system but no longer the first part of the splitted backup
# so that then "rear recover" fails with "ERROR: Backup archive ... not found"
# cf. https://github.com/rear/rear/issues/1545
# Even with a sufficiently big maximum ISO size so that all is in one ISO
# "rear mkrescue" would overwrite an ISO that already contains a backup.
# Accordingly when ISO_MAX_SIZE is set the mkrescue workflow is forbidden
# to be on the safe side to not possibly destroy an existing backup.
ISO_MAX_SIZE=
#
# How to find mkisofs:
# Guess the common names mkisofs or genisoimage
# script in prep stage will verify this and complain if not found
# ebiso (https://github.com/gozora/ebiso/) can be used as alternative
# for mkisofs/genisoimage on UEFI bootable systems
# to use ebiso, specify ISO_MKISOFS_BIN=<full_path_to_ebiso>/ebiso
# in /etc/rear/local.conf or /etc/rear/site.conf
# xorrisofs is now used as the preferred method for generating the iso image
# with mkisofs and genisoimage as second and third option
ISO_MKISOFS_BIN="$( type -p xorrisofs || type -p mkisofs || type -p genisoimage )"
#
# Additional options passed to the $ISO_MKISOFS_BIN binary
ISO_MKISOFS_OPTS=""
#
# Which files to include in the ISO image:
ISO_FILES=()
#
# Prefix name for ISO images without the .iso suffix.
# This might get a number appended (for splitting data onto multiple CDs).
ISO_PREFIX="rear-$HOSTNAME"
#
# Default boot option (i.e. what gets booted automatically after some timeout)
# when SYSLINUX boots the ISO image on BIOS systems.
# This variable ISO_DEFAULT should be better named ISO_BIOS_BOOT_DEFAULT
# (cf. USB_BIOS_BOOT_DEFAULT below) but we won't rename existing config variables
# to avoid regressions for users who use existing config variable names
# cf. https://github.com/rear/rear/pull/2293#issuecomment-564439509
# If ISO_DEFAULT is unset or empty or only blanks "boothd" is used by default.
# ISO_DEFAULT="boothd" is an automatism that intends to boot from the original first disk.
# In case of ISOLINUX "boothd" means to boot from the first disk 'boothd0' because
# usually ISOLINUX is used for booting from CD-ROM which is usually not the first disk
# so that the original first disk still is the first disk when booting the ISO from CD-ROM.
# In case of EXTLINUX "boothd" would mean to boot from the second disk 'boothd1' because
# usually when EXTLINUX is used the device with the ISO would be the first disk
# and the original first disk would become the second disk (cf. USB_BIOS_BOOT_DEFAULT below).
# ISO_DEFAULT="boothd0" boots from the first disk.
# ISO_DEFAULT="boothd1" boots from the second disk.
# The ISO_DEFAULT values 'boothd' 'boothd0' 'boothd1' are only supported
# when the SYSLINUX module 'chain.c32' for chain booting is available.
# ISO_DEFAULT="manual" boots the ReaR recovery system in normal mode
# where one must manually log in as 'root', manually type "rear recover", and manually reboot.
# ISO_DEFAULT="automatic" boots the ReaR recovery system with the 'auto_recover' kernel command line option
# that runs "rear recover" automatically without automated reboot (see "man rear").
# For details see the make_syslinux_config function in lib/bootloader-functions.sh
ISO_DEFAULT="boothd"
#
# ISO_RECOVER_MODE="unattended" boots the ReaR recovery system with the 'unattended' kernel command line option
# that runs "rear recover" automatically plus automated reboot after successful rear recover (see "man rear").
# Together with ISO_DEFAULT="automatic" full-automated recovery happens when the ISO image is booted
# which could result an endless full-automated recovery cycle when the ISO is booted by default
# (e.g. when the device with the ISO is the first one in the BIOS boot order list).
# The default ISO_RECOVER_MODE="" results the normal behaviour:
ISO_RECOVER_MODE=""
##
# OUTPUT=USB stuff
##
# OUTPUT=USB produces files suitable for booting with SYSLINUX/EXTLINUX from a disk device.
# USB sticks and USB disks are the main use case for this.
# "USB" also means any local block-storage device and includes eSATA and other external disks.
# The device is also made bootable and a boot loader installed.
# The device must be partitioned and formatted with an ext* file system.
#
# The device to use, set automatically by BACKUP=NETFS and BACKUP_URL=usb:///dev/sdb1
USB_DEVICE=
#
# The partition type that is used when formatting a medium for use with ReaR via the format workflow.
# It can be 'msdos' to create a MBR partition table or 'gpt' to create a GUID partition table (GPT).
# When UEFI is used the format workflow will create a GUID partition table in any case.
# A MBR partition table limits the maximum usable storage space on the medium to 2TB.
# For larger medium sizes use 'gpt'. If you must use a MBR partition table on a medium > 2TB
# set USB_DEVICE_FILESYSTEM_PERCENTAGE appropriately so that what is used for ReaR does not exceed
# what works with a MBR partition table but then you cannot use the remaining space on the medium:
USB_DEVICE_PARTED_LABEL=msdos
#
# The label that is set for the ReaR data partition via the format workflow.
# That label must be used for settings like
# BACKUP_URL=usb:///dev/disk/by-label/$USB_DEVICE_FILESYSTEM_LABEL
# USB_DEVICE=/dev/disk/by-label/$USB_DEVICE_FILESYSTEM_LABEL
# For OBDR only the default 'REAR-000' works (a label with exactly 8 characters length may also work)
# cf. prep/OBDR/default/500_check_tape_label.sh and prep/OBDR/default/700_write_OBDR_header.sh
USB_DEVICE_FILESYSTEM_LABEL='REAR-000'
#
# Filesystem to use for the USB_DEVICE_FILESYSTEM_LABEL labeled ReaR data partition
# when formatting a medium for use with ReaR via the format workflow.
# Only ext3 and ext4 are supported by the format workflow.
# (An additional EFI system partition uses the vfat filesystem in any case.)
# The default ext3 should work up to a maximum medium size of about 4TB
# while ext4 should work up to a maximum medium size of about 16TB.
# For larger medium sizes set USB_DEVICE_FILESYSTEM_PERCENTAGE appropriately
# so that what is used for ReaR partitions by the format workflow
# does not exceed what works for the specified USB_DEVICE_FILESYSTEM:
USB_DEVICE_FILESYSTEM=ext3
#
# USB_DEVICE_FILESYSTEM_PARAMS allow to add optimisations to the formatting
# (mkfs) phase of the USB_DEVICE_FILESYSTEM. This can be handy to optimise
# flash memory drives. An example for a Sandisk Cruzer Force 16GB USB stick:
# USB_DEVICE_FILESYSTEM_PARAMS="-b 4096 -E stride=8,stripe-width=256 -O sparse_super,^has_journal"
# Often the Linux kernel limits increase the block size value above 4096 (4K).
# To determine optimal values one can use a utility as flashbench.
USB_DEVICE_FILESYSTEM_PARAMS=
#
# Percentage of the whole medium that is used for ReaR partitions
# when formatting a medium via the format workflow.
# When UEFI is used it specifies what is used by the format workflow for both partitions,
# the EFI system partition (ESP) plus the USB_DEVICE_FILESYSTEM_LABEL labeled ReaR data partition.
# A setting of less than 100 (i.e. less than the whole medium)
# does not leave any existing data intact on the medium.
# The format workflow deletes all existing data on the whole medium.
# A setting of less than 100 only leaves unused space on the medium
# which can be manually used otherwise by the user:
USB_DEVICE_FILESYSTEM_PERCENTAGE=100
#
# USB_PARTITION_ALIGN_BLOCK_SIZE specifies partitioning alignment in MiB
# when formatting a medium via the format workflow.
# The default alignment of 8 MiB is intended in particular for flash memory devices.
# The partitioning tool can't figure out optimal alignment values for many flash memory devices.
# The flashbench command helps determining "erase block size" a.k.a. "segment size"
# a.k.a. "allocation unit size" for your particular flash memory device.
# A too small value will result lower speed and less lifetime of your flash memory device.
# A sufficiently big value will improve speed and lifetime of your flash memory device.
USB_PARTITION_ALIGN_BLOCK_SIZE="8"
#
# When UEFI is used USB_UEFI_PART_SIZE specifies the size of the EFI system partition (ESP)
# in MiB when formatting a medium by the format workflow.
# If USB_UEFI_PART_SIZE is empty or invalid (i.e. not an unsigned integer larger than 0)
# the user must interactively enter a valid value while running the format workflow.
# The default value of 400 MiB should be sufficiently big and it is in compliance
# with the 8 MiB partition alignment default value ( 400 = 8 * 50 )
# and even with a 16 MiB partition alignment value ( 400 = 16 * 25 )
# cf. https://github.com/rear/rear/pull/1205
# The value of USB_UEFI_PART_SIZE will be rounded to the nearest
# USB_PARTITION_ALIGN_BLOCK_SIZE chunk:
USB_UEFI_PART_SIZE="400"
#
# Default boot option (i.e. what gets booted automatically after some timeout)
# when EXTLINUX boots the USB stick or USB disk or other disk device on BIOS systems.
# USB_BIOS_BOOT_DEFAULT="boothd0" boots from 'boothd0' which is usually the same disk
# wherefrom currently EXTLINUX is booting so that this results usually a booting loop.
# The default USB_BIOS_BOOT_DEFAULT="" boots from the second disk 'boothd1'
# which should be the original first local harddisk because usually when booting
# from USB stick or USB disk or other disk device this boot device is the first disk
# and the original first local harddisk disk becomes the second disk.
# USB_BIOS_BOOT_DEFAULT is only supported when the SYSLINUX module 'chain.c32' for chain booting is available.
# For details see output/USB/Linux-i386/300_create_extlinux.sh
USB_BIOS_BOOT_DEFAULT=""
#
# Resulting files that should be copied onto the USB stick:
USB_FILES=()
#
# USB_SUFFIX specifies the last part of the backup directory on the USB medium.
# When USB_SUFFIX is unset or empty, backup on USB works in its default mode which means
# multiple timestamp backup directories of the form rear/HOSTNAME/YYYYMMDD.HHMM
# plus automated rescue environments and backups cleanup via USB_RETAIN_BACKUP_NR.
# In contrast when USB_SUFFIX is set, backup on USB works in compliance with how backup on NFS works
# (i.e. BACKUP_URL=usb:... and BACKUP_URL=nfs:... behave compatible when USB_SUFFIX is set)
# which means a fixed backup directory of the form rear/HOSTNAME/USB_SUFFIX on the USB medium
# and no automated removal of backups or other files (regardless of USB_RETAIN_BACKUP_NR)
# see https://github.com/rear/rear/issues/1164
# Using multiple backups as described in doc/user-guide/11-multiple-backups.adoc
# requires a fixed backup directory so that USB_SUFFIX must be set for multiple backups on USB
# see https://github.com/rear/rear/issues/1160
# Also BACKUP_TYPE incremental or differential requires a fixed backup directory
# so that USB_SUFFIX must be set for incremental or differential backup on USB
# see https://github.com/rear/rear/issues/1145
USB_SUFFIX=""
#
# Number of older rescue environments or backups to retain on USB.
# What is more than USB_RETAIN_BACKUP_NR gets automatically removed.
# This setting is ignored when USB_SUFFIX is set (see above).
USB_RETAIN_BACKUP_NR=2
#
# Variable will probably be filled automatically
# if an USB device was manually mounted to avoid recursive backups:
AUTOEXCLUDE_USB_PATH=()
##
# OUTPUT=RAWDISK stuff
##
# RAWDISK produces a bootable image file named "rear-$HOSTNAME.raw", which
# - supports UEFI boot if syslinux/EFI or Grub 2/EFI is installed,
# - supports Legacy BIOS boot if syslinux is installed,
# - supports UEFI/Legacy BIOS dual boot if syslinux *and* one of the supported EFI bootloaders are installed.
#
# A RAWDISK image can be copied onto a disk boot medium (an USB stick will do) with
# dd if="$image_file" bs=1MB of="$disk_device" # Note: Use the entire disk device, not a partition.
#
# A RAWDISK image is suitable for archiving USB images, works without having to format the USB device
# and can thus be used to replace the USB output method.
#
# Name of the disk image file (the extension '.raw' is appended automatically)
RAWDISK_IMAGE_NAME="rear-$HOSTNAME"
#
# Disk image file compression command (empty: no compression).
# The compression command may include options. It must
# - accept the input file as the only argument, and
# - produce an output file named like the input file plus a compression suffix.
RAWDISK_IMAGE_COMPRESSION_COMMAND='gzip'
#
# Name of the (only) GPT partition containing the FAT boot file system (maximum 36 ASCII-characters)
RAWDISK_GPT_PARTITION_NAME='Rescue System'
#
# Volume label of the FAT boot file system (maximum 11 ASCII-characters, all uppercase)
RAWDISK_FAT_VOLUME_LABEL='RESCUE SYS'
#
# Bootloader configuration:
# RAWDISK will auto-detect installed bootloaders and will provide the image with
# - one UEFI bootloader (syslinux/EFI preferred) if available, and
# - syslinux as a Legacy BIOS bootloader if available.
# Override the auto-detection and exclude the respective bootloader?
RAWDISK_BOOT_EXCLUDE_SYSLINUX_LEGACY='no'
RAWDISK_BOOT_EXCLUDE_SYSLINUX_EFI='no'
RAWDISK_BOOT_EXCLUDE_GRUB2_EFI='no'
#
# Set RAWDISK_DEBUG to 'yes' to drop into a shell as soon as the boot image is finished.
# The image's partitions are still mounted at this stage and can be examined. The
# ReaR workflow continues when exiting the shell.
RAWDISK_DEBUG='no'
##
# PXE stuff
##
# PXE produces files suitable for booting with pxelinux.
#
# where should I place the PXE configuration ? (legacy way)
PXE_CONFIG_PATH=/var/lib/rear/output
# where should I place the PXE configuration ? (URL style)
PXE_CONFIG_URL=
#
# put this before the hostname on the PXE server
PXE_CONFIG_PREFIX=rear-
#
# TFPT IP server. needed to create grub menu when PXE_CONFIG_GRUB_STYLE=y
# If not set, we gonna try to get TFTP IP from PXE_TFTP_URL
PXE_TFTP_IP=
#
# where should we put the TFTP files ? (legacy way)
PXE_TFTP_PATH=/var/lib/rear/output
# where should we put the TFTP files ? (URL style)
PXE_TFTP_URL=
#
# prefix for PXE files, e.g. the hostname
PXE_TFTP_PREFIX=$HOSTNAME.
#
# Create pxelinux config symlinks for MAC addresses or for IP addresses ? [MAC|IP|'']
PXE_CREATE_LINKS=MAC
#
# Should I remove old symlinks for this host ? [BOOL]
PXE_REMOVE_OLD_LINKS=
#
# Should I use PXE based on GRUB2 instead of PXE legacy. [BOOL] (default is no)
# PXE based on GRUB2 can be used by none x86 platform (like POWER ppc64/ppc64le).
# More information on the GRUB PXE setup can be found here :
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-server-setup.html#sect-network-boot-setup-ppc-grub2
PXE_CONFIG_GRUB_STYLE=
#
# The way we start up in our PXE mode (keywords known are 'automatic', 'unattended', and empty)
# 'automatic' is the auto_recover mode which means boot automatic with ReaR and execute a 'rear recover', but
# when a question has to be answered (e.g. during migration mode) it will wait on an answer...
# 'unattended' should only used by EXPERTS and is meant to foresee in an automated recovery for testing
# purposes only. If you do not know what I mean do not use it, or hire us ;-)
# Default is empty which means prompting what to do next and after a timeout boot next option defined by BIOS
PXE_RECOVER_MODE=
# Certain operation might need longer time to kick in and more retries might be desirable.
# REAR_SLEEP_DELAY (in sec.) is general delay for operation.
REAR_SLEEP_DELAY=1
# REAR_MAX_RETRIES is maximum number of attempts that should be executed before operation is aborted.
# Maximum timeout for operation calculates as REAR_SLEEP_DELAY * REAR_MAX_RETRIES
# This retries / timeout operation is currently implemented only in get_disk_size (),
# so if you have trouble with error messages like:
# 'Could not determine size of disk <device> ...' tweaking of REAR_SLEEP_DELAY and REAR_MAX_RETRIES might help.
REAR_MAX_RETRIES=5
##
# Internal BACKUP stuff
##
# These settings apply to all cases of internal Relax-and-Recover backup
#
# BACKUP Program defaults. mostly tested with tar and rsync
# by default all local filesystems will be saved
# for a full understanding of these options, look at backup/NETFS/default/*.sh
# NOTE: The BACKUP_* variables relate to ALL builtin backup methods !
# (NETFS, ISO, TAPE ...)
BACKUP_PROG=tar
# some backup progs can tell us if the transfer was only partially successful.
# Warning on partial transfers means that we won't abort but only print a warning. [BOOL]
BACKUP_PROG_WARN_PARTIAL_TRANSFER=1
# if using an unsupported backup program, the last option must be to write the archive to / read
# the archive from a file (like tar -f)
# then you also have to set the CREATE and RESTORE archive options. They are *ignored* if the
# backup program is supported.
# default setting for BACKUP_PROG_OPTIONS="" became "--anchored" (GD, 02/DEC/2014 - issue #475)
# BACKUP_PROG_OPTIONS used to be a string variable, turn it into an array (GD, 06/SEP/2017 - issue #1175)
BACKUP_PROG_OPTIONS=( "--anchored" )
# for unsupported backup programs, the last CREATE_ARCHIVE option must be to read excludes from a file
# (like tar -X filename). Furthermore, you should include an option for verbose output to stdout and
# an option to stay on the local filesystem (like tar --one-file-system) and maybe options to handle
# the exclude list correctly
BACKUP_PROG_OPTIONS_CREATE_ARCHIVE=""
# for unsupported backup programs, the last RESTORE_ARCHIVE options must be to restore the archive
# into a specific path (like tar -C $TARGET_FS_ROOT)
BACKUP_PROG_OPTIONS_RESTORE_ARCHIVE=""
BACKUP_PROG_SUFFIX=".tar"
# BACKUP_PROG_COMPRESS_OPTIONS is an array so that one can use it to provide more complex values
# e.g. to override the gzip default compression level (-6) via the tar '-I' option
# like BACKUP_PROG_COMPRESS_OPTIONS=( -I 'gzip -9 -n -c' )
# but using it with command options (as in 'gzip -9') fails with tar versions before 1.27
# with a tar error message like "gzip -9: Cannot exec" because only since tar version 1.27
# tar supports passing command line arguments to external commands, see
# http://git.savannah.gnu.org/cgit/tar.git/plain/NEWS?id=release_1_27
# Furthermore for advanced things like BACKUP_PROG_COMPRESS_OPTIONS=("--zstd")
# backup restore may fail during 'rear recover' due to missing zstd binaries
# in the ReaR recovery system (probably also for --lzip --lzma --lzop)
# because there is no automatism in ReaR that would automatically include
# additional things that are needed by tar into the ReaR recovery system
# so that in such cases additionally needed things in the recovery system
# must be manually specified via COPY_AS_IS, REQUIRED_PROGS, and LIBS.
BACKUP_PROG_COMPRESS_OPTIONS=( --gzip )
BACKUP_PROG_COMPRESS_SUFFIX=".gz"
# Addons for encryption and decryption of the backup (currently only tar is supported):
BACKUP_PROG_CRYPT_ENABLED="false"
# When BACKUP_PROG_CRYPT_ENABLED is set to a true value, BACKUP_PROG_CRYPT_KEY must be also set.
# It is recommended to avoid special characters in the BACKUP_PROG_CRYPT_KEY value,
# in particular bash metacharacters, bash control operator characters, bash grammar characters,
# globbing metacharacters, regexp metacharacters, and slash or whitespace characters like
# $ ` ' " | & ; ( ) < > { } [ ] . * @ ! ? / \ space tab newline
# so that only alphanumeric characters and the underscore should be used to be on the safe side.
# Otherwise things might break in weird ways when certain code in ReaR is not yet safe
# against special characters in values cf. https://github.com/rear/rear/issues/1372
# and https://github.com/rear/rear/issues/2157
# There is no BACKUP_PROG_CRYPT_KEY value in etc/rear/local.conf in the ReaR recovery system.
# It gets removed by build/default/960_remove_encryption_keys.sh
# because the ReaR recovery system must be free of secrets
# cf. the reasoning about SSH_UNPROTECTED_PRIVATE_KEYS below
# and see https://github.com/rear/rear/issues/2155
# Therefore BACKUP_PROG_CRYPT_KEY must be manually set before running "rear recover".
# BACKUP_PROG_CRYPT_KEY is set to a default value here only
# if not already set so that the user can set it also like
# export BACKUP_PROG_CRYPT_KEY='my_secret_passphrase'
# directly before he calls "rear ..." so that there is no need to store it in a config file.
# Avoid that the BACKUP_PROG_CRYPT_KEY value is shown when usr/sbin/rear was called with 'set -x'
# for debugging usr/sbin/rear cf. https://github.com/rear/rear/issues/2144#issuecomment-493908133
# In debugscript mode only scripts sourced by the Source function in lib/framework-functions.sh
# are run with 'set -x' but default.conf is sourced by usr/sbin/rear directly.
# See the comment of the UserInput function in lib/_input-output-functions.sh