#2438 Issue closed
: SLES 12 SP4 - unable to backup serviguard files¶
Labels: support / question
, fixed / solved / done
makamp1 opened issue at 2020-06-24 11:05:¶
Relax-and-Recover (ReaR) Issue Template¶
Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):
-
ReaR version ("/usr/sbin/rear -V"):
Relax-and-Recover 2.4 / Git -
OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
SLES 12 SP4 -
ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
cat /etc/rear/local.conf
#Backup Parameters
BACKUP=NETFS
BACKUP_OPTIONS="nfsvers=3,nolock"
BACKUP_URL=nfs://10.254.132.1/export/rear/
NETFS_KEEP_OLD_BACKUP_COPY=no
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" snapper chattr lsattr)
COPY_AS_IS=( "${COPY_AS_IS[@]}" /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
# BACKUP_PROG_EXCLUDE=("$BACKUP_PROG_EXCLUDE[@]}" '/.snapshots/*' '/var/crash' )
BACKUP_PROG_EXCLUDE=('/.snapshots/*' '/var/crash' )
BACKUP_PROG_INCLUDE=( `findmnt -nrt btrfs | awk 'NR>1 {print "\047" $1 "\047"}' | egrep -v 'snapshot|crash' | tr '\n' ' '` '/opt/*')
EXCLUDE_VG=(`vgs | awk 'NR>1 {print $1}'`)
#ISO Parameters
OUTPUT=ISO
ISO_MKISOFS_BIN=/usr/bin/ebiso
ISO_PREFIX="rear-`date +%Y%m%d`-$HOSTNAME"
#Boot from SAN Configurations
AUTOEXCLUDE_MULTIPATH=n
BOOT_OVER_SAN=1
USING_UEFI_BOOTLOADER=1
UEFI_BOOTLOADER=( 'shim*.efi' 'grub.efi' )
-
Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
BM -
System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
X86 -
Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
-
Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
SAN -
Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):
lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT
NAME KNAME PKNAME TRAN TYPE FSTYPE SIZE MOUNTPOINT
/dev/sda /dev/sda fc disk 256G
|-/dev/sda1 /dev/sda1 /dev/sda part vfat 240M
|-/dev/sda2 /dev/sda2 /dev/sda part swap 2G
|-/dev/sda3 /dev/sda3 /dev/sda part btrfs 253.7G
`-/dev/mapper/360002ac000000000000000320001da07 /dev/dm-4 /dev/sda mpath 256G
|-/dev/mapper/360002ac000000000000000320001da07-part1 /dev/dm-11 /dev/dm-4 part vfat 240M /boot/efi
|-/dev/mapper/360002ac000000000000000320001da07-part2 /dev/dm-12 /dev/dm-4 part swap 2G [SWAP]
`-/dev/mapper/360002ac000000000000000320001da07-part3 /dev/dm-13 /dev/dm-4 part btrfs 253.7G /
/dev/sdb /dev/sdb fc disk LVM2_member 1T
`-/dev/mapper/VV0056 /dev/dm-5 /dev/sdb mpath LVM2_member 1T
/dev/sdc /dev/sdc fc disk 4G
`-/dev/mapper/VV0058 /dev/dm-6 /dev/sdc mpath 4G
/dev/sdd /dev/sdd fc disk LVM2_member 496G
`-/dev/mapper/VV0076 /dev/dm-7 /dev/sdd mpath LVM2_member 496G
/dev/sde /dev/sde fc disk LVM2_member 496G
`-/dev/mapper/VV0077 /dev/dm-8 /dev/sde mpath LVM2_member 496G
/dev/sdf /dev/sdf fc disk LVM2_member 496G
`-/dev/mapper/VV0078 /dev/dm-9 /dev/sdf mpath LVM2_member 496G
/dev/sdg /dev/sdg fc disk LVM2_member 496G
`-/dev/mapper/VV0079 /dev/dm-10 /dev/sdg mpath LVM2_member 496G
/dev/sdh /dev/sdh fc disk LVM2_member 496G
`-/dev/mapper/VV0108 /dev/dm-0 /dev/sdh mpath LVM2_member 496G
/dev/sdi /dev/sdi fc disk LVM2_member 496G
`-/dev/mapper/VV0109 /dev/dm-1 /dev/sdi mpath LVM2_member 496G
/dev/sdj /dev/sdj fc disk LVM2_member 496G
`-/dev/mapper/VV0110 /dev/dm-2 /dev/sdj mpath LVM2_member 496G
/dev/sdk /dev/sdk fc disk LVM2_member 496G
`-/dev/mapper/VV0111 /dev/dm-3 /dev/sdk mpath LVM2_member 496G
/dev/sdl /dev/sdl fc disk 256G
|-/dev/sdl1 /dev/sdl1 /dev/sdl part vfat 240M
|-/dev/sdl2 /dev/sdl2 /dev/sdl part swap 2G
|-/dev/sdl3 /dev/sdl3 /dev/sdl part btrfs 253.7G
`-/dev/mapper/360002ac000000000000000320001da07 /dev/dm-4 /dev/sdl mpath 256G
|-/dev/mapper/360002ac000000000000000320001da07-part1 /dev/dm-11 /dev/dm-4 part vfat 240M /boot/efi
|-/dev/mapper/360002ac000000000000000320001da07-part2 /dev/dm-12 /dev/dm-4 part swap 2G [SWAP]
`-/dev/mapper/360002ac000000000000000320001da07-part3 /dev/dm-13 /dev/dm-4 part btrfs 253.7G /
/dev/sdm /dev/sdm fc disk LVM2_member 1T
`-/dev/mapper/VV0056 /dev/dm-5 /dev/sdm mpath LVM2_member 1T
/dev/sdn /dev/sdn fc disk 4G
`-/dev/mapper/VV0058 /dev/dm-6 /dev/sdn mpath 4G
/dev/sdo /dev/sdo fc disk LVM2_member 496G
`-/dev/mapper/VV0076 /dev/dm-7 /dev/sdo mpath LVM2_member 496G
/dev/sdp /dev/sdp fc disk LVM2_member 496G
`-/dev/mapper/VV0077 /dev/dm-8 /dev/sdp mpath LVM2_member 496G
/dev/sr0 /dev/sr0 usb rom iso9660 306.6M /media/HPE_iLO_Virtual_DVD
/dev/sdq /dev/sdq fc disk LVM2_member 496G
`-/dev/mapper/VV0078 /dev/dm-9 /dev/sdq mpath LVM2_member 496G
/dev/sdr /dev/sdr fc disk LVM2_member 496G
`-/dev/mapper/VV0079 /dev/dm-10 /dev/sdr mpath LVM2_member 496G
/dev/sds /dev/sds fc disk LVM2_member 496G
`-/dev/mapper/VV0108 /dev/dm-0 /dev/sds mpath LVM2_member 496G
/dev/sdt /dev/sdt fc disk LVM2_member 496G
`-/dev/mapper/VV0109 /dev/dm-1 /dev/sdt mpath LVM2_member 496G
/dev/sdu /dev/sdu fc disk LVM2_member 496G
`-/dev/mapper/VV0110 /dev/dm-2 /dev/sdu mpath LVM2_member 496G
/dev/sdv /dev/sdv fc disk LVM2_member 496G
`-/dev/mapper/VV0111 /dev/dm-3 /dev/sdv mpath LVM2_member 496G
-
Description of the issue (ideally so that others can reproduce it):
The system is installed with ServiceGuard
when I do "rear -v mkbackup", in the ISO output file, only SG config files are backed up
there are no binary files copied frm /opt/cmcluster/bin and other folders in /opt/cmcluser
tried few options in local.conf and 960_collect_MC_serviceguard_infos.sh .. no success -
Workaround, if any:
-
Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):
To paste verbatim text like command output or file content,
include it between a leading and a closing line of three backticks like
```
verbatim content
```
gdha commented at 2020-06-24 11:25:¶
@makamp1 Why would you need ServiceGuard binaries in your rescue image? When you recover these will be restored automatically. The idea to copy the SG config files was to have an idea what kind of node you are dealing with, not to become a SG node in "recover" mode as this is out-of-scope by ReaR.
makamp1 commented at 2020-06-24 11:32:¶
thanks for quick reply on this .. after I restored, I am not seeing any of the SG binaries in /opt/cmcluster/bin.. due to this the node is not able to join the cluster post recover .. i need to manually install SG software to make SG cluster to work
since I want to recover the system back to original config without much manual work (i.e. install SG software etc), I want to include the SG binaries ..
is there a way to force SG files in to image ?
gdha commented at 2020-06-24 11:37:¶
@makamp1 Check the log file to see if /opt/cmcluster was excluded
somehow from the backup? You can also check the backup.log file which is
stored together with the tar.gz archive to see if it is missing.
During the recover all SAN disks are wiped out I guess?
makamp1 commented at 2020-06-24 11:58:¶
I checked the logs and dont see any specific entry which show why many
subfolders/files from /opt/cmcluster is excluded
attached the log with this message
yes, the SAN disks are wiped during the recover ..
jsmeix commented at 2020-06-24 12:18:¶
@makamp1
a side note:
NETFS_KEEP_OLD_BACKUP_COPY=no
does not do what it looks like because NETFS_KEEP_OLD_BACKUP_COPY
is a boolean variable, see the initial comment in
usr/share/rear/conf/default.conf
https://github.com/rear/rear/blob/master/usr/share/rear/conf/default.conf#L32
# 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.
Your
https://github.com/rear/rear/files/4825190/rear-cs900r01nfs2-shared.log
contains (excerpt)
2020-06-24 11:00:50.551589020 Including backup/NETFS/default/500_make_backup.sh
2020-06-24 11:00:50.554137272 Include list:
2020-06-24 11:00:50.556732689 '/srv'
2020-06-24 11:00:50.559496266 '/var/lib/pgsql'
2020-06-24 11:00:50.562030917 '/tmp'
2020-06-24 11:00:50.564706022 '/var/spool'
2020-06-24 11:00:50.567165678 '/var/lib/named'
2020-06-24 11:00:50.570006015 '/var/log'
2020-06-24 11:00:50.572770697 '/opt'
2020-06-24 11:00:50.575557172 '/var/opt'
2020-06-24 11:00:50.578317993 '/boot/grub2/x86_64-efi'
2020-06-24 11:00:50.581083553 '/boot/grub2/i386-pc'
2020-06-24 11:00:50.583850078 '/var/lib/machines'
2020-06-24 11:00:50.586629244 '/var/lib/mailman'
2020-06-24 11:00:50.589428964 '/usr/local'
2020-06-24 11:00:50.592224929 '/var/tmp'
2020-06-24 11:00:50.594918706 /opt/*
2020-06-24 11:00:50.597639608 /boot/efi
2020-06-24 11:00:50.600338598 /
2020-06-24 11:00:50.603089328 Exclude list:
2020-06-24 11:00:50.605922803 /.snapshots/*
2020-06-24 11:00:50.608978743 /var/crash
so it looks like /opt
should get included in the backup.
What result on your original system the commands
findmnt -a
versus
findmnt -nrt btrfs | awk 'NR>1 {print "\047" $1 "\047"}' | egrep -v 'snapshot|crash' | tr '\n' ' '
I ask because perhaps something from /opt/cmcluster is mounted
separatedly
and then that "something" would have to be also explicitly included
because
ReaR runs tar
with the --one-file-system
option, cf. your backup.log
file.
gdha commented at 2020-06-24 12:19:¶
Change in /etc/rear/local.conf the line:
BACKUP_PROG_INCLUDE=( `findmnt -nrt btrfs | awk 'NR>1 {print "\047" $1 "\047"}' | egrep -v 'snapshot|crash' | tr '\n' ' '` '/opt/*')
into
BACKUP_PROG_INCLUDE=( `findmnt -nrt btrfs | awk 'NR>1 {print "\047" $1 "\047"}' | egrep -v 'snapshot|crash' | tr '\n' ' '`)
makamp1 commented at 2020-06-24 12:29:¶
thanks again for the quick responses ..
@gdha : I have tried local.conf without /opt/* in BACKUP_PROG_INCLUDE
and had same issue
@jsmeix
the outputs requested are below .. /opt/cmcluster is not a separate file
system .. it is a folder in /opt
# findmnt -a
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/360002ac000000000000000320001da07-part3[/@/.snapshots/1/snapshot]
| btrfs rw,relatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot
|-/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
| |-/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
| |-/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755
| | |-/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgrou
| | |-/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset
| | |-/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
| | |-/sys/fs/cgroup/net_cls,net_prio
| | | cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
| | |-/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids
| | |-/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
| | |-/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
| | |-/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event
| | |-/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb
| | |-/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
| | `-/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
| |-/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
| |-/sys/firmware/efi/efivars efivarfs efivarfs rw,nosuid,nodev,noexec,relatime
| `-/sys/kernel/debug debugfs debugfs rw,relatime
| `-/sys/kernel/debug/tracing tracefs tracefs rw,relatime
|-/proc proc proc rw,nosuid,nodev,noexec,relatime
| `-/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct
| `-/proc/sys/fs/binfmt_misc binfmt_misc binfmt_misc rw,relatime
|-/dev devtmpfs devtmpfs rw,nosuid,size=32709540k,nr_inodes=8177385,mode=755
| |-/dev/shm tmpfs tmpfs rw,nosuid,nodev
| |-/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
| |-/dev/hugepages hugetlbfs hugetlbfs rw,relatime
| `-/dev/mqueue mqueue mqueue rw,relatime
|-/run tmpfs tmpfs rw,nosuid,nodev,mode=755
| `-/run/user/0 tmpfs tmpfs rw,nosuid,nodev,relatime,size=6544564k,mode=700
|-/media/HPE_iLO_Virtual_DVD /dev/sr0 iso9660 ro,relatime
|-/srv /dev/mapper/360002ac000000000000000320001da07-part3[/@/srv]
| btrfs rw,relatime,space_cache,subvolid=263,subvol=/@/srv
|-/var/lib/pgsql /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/lib/pgsql]
| btrfs rw,relatime,space_cache,subvolid=269,subvol=/@/var/lib/pgsql
|-/var/crash /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/crash]
| btrfs rw,relatime,space_cache,subvolid=266,subvol=/@/var/crash
|-/tmp /dev/mapper/360002ac000000000000000320001da07-part3[/@/tmp]
| btrfs rw,relatime,space_cache,subvolid=264,subvol=/@/tmp
|-/var/spool /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/spool]
| btrfs rw,relatime,space_cache,subvolid=272,subvol=/@/var/spool
|-/var/lib/named /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/lib/named]
| btrfs rw,relatime,space_cache,subvolid=268,subvol=/@/var/lib/named
|-/var/log /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/log]
| btrfs rw,relatime,space_cache,subvolid=270,subvol=/@/var/log
|-/boot/efi /dev/mapper/360002ac000000000000000320001da07-part1 vfat rw,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-
|-/opt /dev/mapper/360002ac000000000000000320001da07-part3[/@/opt]
| btrfs rw,relatime,space_cache,subvolid=262,subvol=/@/opt
|-/var/opt /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/opt]
| btrfs rw,relatime,space_cache,subvolid=271,subvol=/@/var/opt
|-/boot/grub2/x86_64-efi /dev/mapper/360002ac000000000000000320001da07-part3[/@/boot/grub2/x86_64-efi]
| btrfs rw,relatime,space_cache,subvolid=261,subvol=/@/boot/grub2/x86_64-efi
|-/boot/grub2/i386-pc /dev/mapper/360002ac000000000000000320001da07-part3[/@/boot/grub2/i386-pc]
| btrfs rw,relatime,space_cache,subvolid=260,subvol=/@/boot/grub2/i386-pc
|-/.snapshots /dev/mapper/360002ac000000000000000320001da07-part3[/@/.snapshots]
| btrfs rw,relatime,space_cache,subvolid=258,subvol=/@/.snapshots
|-/var/lib/machines /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/lib/machines]
| btrfs rw,relatime,space_cache,subvolid=285,subvol=/@/var/lib/machines
|-/var/lib/mailman /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/lib/mailman]
| btrfs rw,relatime,space_cache,subvolid=267,subvol=/@/var/lib/mailman
|-/usr/local /dev/mapper/360002ac000000000000000320001da07-part3[/@/usr/local]
| btrfs rw,relatime,space_cache,subvolid=265,subvol=/@/usr/local
`-/var/tmp /dev/mapper/360002ac000000000000000320001da07-part3[/@/var/tmp]
btrfs rw,relatime,space_cache,subvolid=273,subvol=/@/var/tmp
# findmnt -nrt btrfs | awk 'NR>1 {print "\047" $1 "\047"}' | egrep -v 'snapshot|crash' | tr '\n' ' '
'/srv' '/var/lib/pgsql' '/tmp' '/var/spool' '/var/lib/named' '/var/log' '/opt' '/var/opt' '/boot/grub2/x86_64-efi' '/boot/grub2/i386-pc' '/var/lib/machines' '/var/lib/mailman' '/usr/local' '/var/tmp' #
jsmeix commented at 2020-06-24 12:57:¶
@makamp1
your
findmnt -nrt btrfs | awk 'NR>1 {print "\047" $1 "\047"}' | egrep -v 'snapshot|crash' | tr '\n' ' '
command is wrong because it results single quotes in the values:
On my SLES12 system with btrfs I get with your command:
# BACKUP_PROG_INCLUDE=( `findmnt -nrt btrfs | awk 'NR>1 {print "\047" $1 "\047"}' | egrep -v 'snapshot|crash' | tr '\n' ' '` '/opt/*')
# for e in "${BACKUP_PROG_INCLUDE[@]}" ; do echo "'$e'" ; done
''/var/lib/mariadb''
''/var/lib/named''
''/var/lib/mysql''
''/var/lib/mailman''
''/home''
''/var/lib/pgsql''
''/var/spool''
''/var/lib/machines''
''/var/tmp''
''/boot/grub2/x86_64-efi''
''/boot/grub2/i386-pc''
''/var/log''
''/tmp''
''/opt''
''/usr/local''
''/var/opt''
''/var/lib/libvirt/images''
''/srv''
''/var/cache''
'/opt/*'
Why don't you use the porposed command in
usr/share/rear/conf/examples/SLE12-SP2-btrfs-example.conf
findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash'
On my SLES12 system with btrfs I get with the proposed command:
# BACKUP_PROG_INCLUDE=( $( findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash' ) )
# for e in "${BACKUP_PROG_INCLUDE[@]}" ; do echo "'$e'" ; done
'/var/lib/mariadb'
'/var/lib/named'
'/var/lib/mysql'
'/var/lib/mailman'
'/home'
'/var/lib/pgsql'
'/var/spool'
'/var/lib/machines'
'/var/tmp'
'/boot/grub2/x86_64-efi'
'/boot/grub2/i386-pc'
'/var/log'
'/tmp'
'/opt'
'/usr/local'
'/var/opt'
'/var/lib/libvirt/images'
'/srv'
'/var/cache'
For reference how it looks in my ReaR log on my SLES 12 system
(bit different wording because I use latest ReaR 2.6 but essentially
same code):
2020-06-05 13:19:51.203285532 Backup include list (backup-include.txt contents):
2020-06-05 13:19:51.205918835 /tmp
2020-06-05 13:19:51.208033505 /srv
2020-06-05 13:19:51.210037125 /boot/grub2/x86_64-efi
2020-06-05 13:19:51.212026370 /var/lib/machines
2020-06-05 13:19:51.213953833 /home
2020-06-05 13:19:51.215887140 /var/cache
2020-06-05 13:19:51.217734203 /var/log
2020-06-05 13:19:51.219684046 /var/lib/pgsql
2020-06-05 13:19:51.221552226 /var/lib/mailman
2020-06-05 13:19:51.223495637 /var/lib/mariadb
2020-06-05 13:19:51.225406793 /var/lib/named
2020-06-05 13:19:51.227353094 /var/lib/mysql
2020-06-05 13:19:51.229224444 /var/lib/libvirt/images
2020-06-05 13:19:51.230920931 /opt
2020-06-05 13:19:51.232545969 /var/tmp
2020-06-05 13:19:51.234124442 /var/spool
2020-06-05 13:19:51.235774948 /boot/grub2/i386-pc
2020-06-05 13:19:51.237407057 /usr/local
2020-06-05 13:19:51.239013090 /var/opt
2020-06-05 13:19:51.240634422 /
makamp1 commented at 2020-06-24 13:20:¶
thanks again for the reponse .. are you able to create a few files and dir under /opt/cmcluster folder and verify rear is backing them up ?
I still have the issue backing up ServiceGuard binaries under /opt/cmcluser/bin folder
# cat /etc/rear/local.conf | grep -v ^#
BACKUP=NETFS
BACKUP_OPTIONS="nfsvers=3,nolock"
BACKUP_URL=nfs://10.254.132.1/export/rear/
NETFS_KEEP_OLD_BACKUP_COPY=no
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" snapper chattr lsattr)
COPY_AS_IS=( "${COPY_AS_IS[@]}" /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
BACKUP_PROG_EXCLUDE=('/.snapshots/*' '/var/crash' )
BACKUP_PROG_INCLUDE=( ` findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash' `)
EXCLUDE_VG=(`vgs | awk 'NR>1 {print $1}'`)
OUTPUT=ISO
ISO_MKISOFS_BIN=/usr/bin/ebiso
ISO_PREFIX="rear-`date +%Y%m%d`-$HOSTNAME"
AUTOEXCLUDE_MULTIPATH=n
BOOT_OVER_SAN=1
USING_UEFI_BOOTLOADER=1
UEFI_BOOTLOADER=( 'shim*.efi' 'grub.efi' )
# findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash'
/srv
/var/lib/pgsql
/tmp
/var/spool
/var/lib/named
/var/log
/opt
/var/opt
/boot/grub2/x86_64-efi
/boot/grub2/i386-pc
/var/lib/machines
/var/lib/mailman
/usr/local
/var/tmp
jsmeix commented at 2020-06-24 13:45:¶
Seems to works well for me as far as I see on my SLES12 system:
# mkdir /opt/cmcluster
# mkdir /opt/cmcluster/subdir
# echo qqqq >/opt/cmcluster/qqqq
# echo qqqqqq >/opt/cmcluster/subdir/qqqqqq
# grep -v '^#' etc/rear/local.conf
OUTPUT=ISO
BACKUP=NETFS
BACKUP_OPTIONS="nfsvers=3,nolock"
BACKUP_URL=nfs://192.168.122.1/nfs
REQUIRED_PROGS+=( snapper chattr )
PROGS+=( lsattr )
COPY_AS_IS+=( /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
BACKUP_PROG_INCLUDE=( $( findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash' ) )
POST_RECOVERY_SCRIPT=( 'if snapper --no-dbus -r $TARGET_FS_ROOT get-config | grep -q "^QGROUP.*[0-9]/[0-9]" ; then snapper --no-dbus -r $TARGET_FS_ROOT set-config QGROUP= ; snapper --no-dbus -r $TARGET_FS_ROOT setup-quota && echo snapper setup-quota done || echo snapper setup-quota failed ; else echo snapper setup-quota not used ; fi' )
SSH_ROOT_PASSWORD="rear"
USE_DHCLIENT="yes"
# usr/sbin/rear -D mkbackuponly
...
Exiting rear mkbackuponly (PID 14552) and its descendant processes ...
and in my ReaR log file var/log/rear/rear-linux-s2ee.log I get (excerpt)
2020-06-24 15:27:05.473463998 Backup include list (backup-include.txt contents):
2020-06-24 15:27:05.475370556 /var/lib/mariadb
2020-06-24 15:27:05.476753518 /var/lib/named
2020-06-24 15:27:05.478252732 /var/lib/mysql
2020-06-24 15:27:05.480068610 /var/lib/mailman
2020-06-24 15:27:05.481502463 /home
2020-06-24 15:27:05.482933352 /var/lib/pgsql
2020-06-24 15:27:05.484310080 /var/spool
2020-06-24 15:27:05.485699091 /var/lib/machines
2020-06-24 15:27:05.487126089 /var/tmp
2020-06-24 15:27:05.488476872 /boot/grub2/x86_64-efi
2020-06-24 15:27:05.489872582 /boot/grub2/i386-pc
2020-06-24 15:27:05.491296389 /var/log
2020-06-24 15:27:05.492659810 /tmp
2020-06-24 15:27:05.494094468 /opt
2020-06-24 15:27:05.495659443 /usr/local
2020-06-24 15:27:05.497047273 /var/opt
2020-06-24 15:27:05.498443778 /var/lib/libvirt/images
2020-06-24 15:27:05.499851297 /srv
2020-06-24 15:27:05.501258204 /var/cache
2020-06-24 15:27:05.502644388 /
2020-06-24 15:27:05.504063597 Backup exclude list (backup-exclude.txt contents):
2020-06-24 15:27:05.505545965 /tmp/*
2020-06-24 15:27:05.507022112 /dev/shm/*
2020-06-24 15:27:05.508449890 /root/rear/var/lib/rear/output/*
2020-06-24 15:27:05.509873611 /tmp/rear.RVW5hDS6cQPAYJh
2020-06-24 15:27:05.511986661 Creating tar archive '/tmp/rear.RVW5hDS6cQPAYJh/outputfs/linux-s2ee/backup.tar.gz'
2020-06-24 15:27:05.524746946 tar --warning=no-xdev --sparse --block-number --totals --verbose --no-wildcards-match-slash --one-file-system --ignore-failed-read --anchored --xattrs --xattrs-include=security.capability --xattrs-include=security.selinux --acls --gzip -X /tmp/rear.RVW5hDS6cQPAYJh/tmp/backup-exclude.txt -C / -c -f - /var/lib/mariadb /var/lib/named /var/lib/mysql /var/lib/mailman /home /var/lib/pgsql /var/spool /var/lib/machines /var/tmp /boot/grub2/x86_64-efi /boot/grub2/i386-pc /var/log /tmp /opt /usr/local /var/opt /var/lib/libvirt/images /srv /var/cache / /root/rear/var/log/rear/rear-linux-s2ee.14552.log | dd of=/tmp/rear.RVW5hDS6cQPAYJh/outputfs/linux-s2ee/backup.tar.gz bs=1M
On my NFS server 192.168.122.1 I get
# tar -tzvf backup.tar.gz | grep cmcluster
drwxr-xr-x root/root 0 2020-06-24 15:25 opt/cmcluster/
drwxr-xr-x root/root 0 2020-06-24 15:25 opt/cmcluster/subdir/
-rw-r--r-- root/root 7 2020-06-24 15:25 opt/cmcluster/subdir/qqqqqq
-rw-r--r-- root/root 5 2020-06-24 15:25 opt/cmcluster/qqqq
# grep cmcluster backup.log
block 7691: /opt/cmcluster/
block 7694: /opt/cmcluster/subdir/
block 7697: /opt/cmcluster/subdir/qqqqqq
block 7701: /opt/cmcluster/qqqq
gdha commented at 2020-06-24 13:47:¶
@makamp1 Could it be caused by?
EXCLUDE_VG=(`vgs | awk 'NR>1 {print $1}'`)
jsmeix commented at 2020-06-24 14:02:¶
@gdha
thank you so much for your careful look at it.
With
BACKUP_PROG_INCLUDE=( $( findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash' ) )
EXCLUDE_VG=( $( vgs | awk 'NR>1 {print $1}' ) )
I get
# usr/sbin/rear -D mkbackuponly
...
Excluding Volume Group system.
...
Making backup (using backup method NETFS)
Creating tar archive '/tmp/rear.lkBDGviAJd6tqIS/outputfs/linux-s2ee/backup.tar.gz'
Preparing archive operation
OK
Saving /root/rear/var/log/rear/rear-linux-s2ee.23218.log as /root/rear/var/log/rear/rear-linux-s2ee.log
Exiting rear mkbackuponly (PID 23218) and its descendant processes ...
so basically nothing in the backup
and accordingly on my NFS server
6.8M Jun 24 15:50 backup.tar.gz
37K Jun 24 15:50 backup.log
in contrast to what it was before
1011M Jun 24 15:30 backup.tar.gz.old
6.4M Jun 24 15:31 backup.log.old
The unexpexted thing is that in my case my opt/cmcluster/ files
wrere even included in that tiny backup
# tar -tzvf backup.tar.gz | grep cmcluster
drwxr-xr-x root/root 0 2020-06-24 15:25 opt/cmcluster/
drwxr-xr-x root/root 0 2020-06-24 15:25 opt/cmcluster/subdir/
-rw-r--r-- root/root 7 2020-06-24 15:25 opt/cmcluster/subdir/qqqqqq
-rw-r--r-- root/root 5 2020-06-24 15:25 opt/cmcluster/qqqq
# grep cmcluster backup.log
block 7693: /opt/cmcluster/
block 7696: /opt/cmcluster/subdir/
block 7699: /opt/cmcluster/subdir/qqqqqq
block 7703: /opt/cmcluster/qqqq
As far as I see in my var/log/rear/rear-linux-s2ee.log
2020-06-24 15:50:48.224040197 Backup include list (backup-include.txt contents):
2020-06-24 15:50:48.226080576 /var/lib/mariadb
2020-06-24 15:50:48.227578580 /var/lib/named
2020-06-24 15:50:48.228955720 /var/lib/mysql
2020-06-24 15:50:48.230331629 /var/lib/mailman
2020-06-24 15:50:48.231768131 /home
2020-06-24 15:50:48.233754721 /var/lib/pgsql
2020-06-24 15:50:48.235286415 /var/spool
2020-06-24 15:50:48.236677305 /var/lib/machines
2020-06-24 15:50:48.238060244 /var/tmp
2020-06-24 15:50:48.239900913 /boot/grub2/x86_64-efi
2020-06-24 15:50:48.241566897 /boot/grub2/i386-pc
2020-06-24 15:50:48.243299372 /var/log
2020-06-24 15:50:48.244946803 /tmp
2020-06-24 15:50:48.246574769 /opt
2020-06-24 15:50:48.248250479 /usr/local
2020-06-24 15:50:48.250004744 /var/opt
2020-06-24 15:50:48.251725107 /var/lib/libvirt/images
2020-06-24 15:50:48.253341485 /srv
2020-06-24 15:50:48.255078012 /var/cache
2020-06-24 15:50:48.256729967 Backup exclude list (backup-exclude.txt contents):
2020-06-24 15:50:48.258364059 /tmp/*
2020-06-24 15:50:48.260053367 /dev/shm/*
2020-06-24 15:50:48.261670878 /root/rear/var/lib/rear/output/*
2020-06-24 15:50:48.263346334 /tmp/rear.lkBDGviAJd6tqIS
2020-06-24 15:50:48.265382510 Creating tar archive '/tmp/rear.lkBDGviAJd6tqIS/outputfs/linux-s2ee/backup.tar.gz'
2020-06-24 15:50:48.280154280 tar --warning=no-xdev --sparse --block-number --totals --verbose --no-wildcards-match-slash --one-file-system --ignore-failed-read --anchored --xattrs --xattrs-include=security.capability --xattrs-include=security.selinux --acls --gzip -X /tmp/rear.lkBDGviAJd6tqIS/tmp/backup-exclude.txt -C / -c -f - /var/lib/mariadb /var/lib/named /var/lib/mysql /var/lib/mailman /home /var/lib/pgsql /var/spool /var/lib/machines /var/tmp /boot/grub2/x86_64-efi /boot/grub2/i386-pc /var/log /tmp /opt /usr/local /var/opt /var/lib/libvirt/images /srv /var/cache /root/rear/var/log/rear/rear-linux-s2ee.23218.log | dd of=/tmp/rear.lkBDGviAJd6tqIS/outputfs/linux-s2ee/backup.tar.gz bs=1M
the difference is that now /
is no longer included in the backup
i.e. only the btrfs subvolumes are still included in the backup.
With
BACKUP_PROG_INCLUDE=( $( findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash' ) '/' )
EXCLUDE_VG=( $( vgs | awk 'NR>1 {print $1}' ) )
note the appended '/'
at BACKUP_PROG_INCLUDE I get again all in the
backup.
But of course EXCLUDE_VG=( $( vgs | awk 'NR>1 {print $1}' ) )
that evaluates to EXCLUDE_VG=( system )
on my SLES12 system
results that 'rear -D mkrescue' produces a
var/lib/rear/layout/disklayout.conf
where LVM entries are all disabled so that this disklayout.conf cannot
be used
as is to recreate the system:
I get the following disklayout.conf differences (excerpts):
disklayout.conf.older is without EXCLUDE_VG=( system )
disklayout.conf is with EXCLUDE_VG=( system )
--- var/lib/rear/layout/disklayout.conf.older 2020-06-24 16:12:02.126740309 +0200
+++ var/lib/rear/layout/disklayout.conf 2020-06-24 16:12:12.274740309 +0200
-# Disk layout dated 20200605131907 (YYYYmmddHHMMSS)
+# Disk layout dated 20200624161209 (YYYYmmddHHMMSS)
-disk /dev/sda 21474836480 msdos
+#disk /dev/sda 21474836480 msdos
-part /dev/sda 21473787904 1048576 primary boot,lvm /dev/sda1
+#part /dev/sda 21473787904 1048576 primary boot,lvm /dev/sda1
-lvmdev /dev/system /dev/sda1 Ap3S6g-OTrL-fon7-tMd9-u4uU-eMH4-clYWAz 41940992
+#lvmdev /dev/system /dev/sda1 Ap3S6g-OTrL-fon7-tMd9-u4uU-eMH4-clYWAz 41940992
-lvmgrp /dev/system 4096 5119 20967424
+#lvmgrp /dev/system 4096 5119 20967424
-lvmvol /dev/system root 19314769920b linear
-lvmvol /dev/system swap 2147483648b linear
+#lvmvol /dev/system root 19314769920b linear
+#lvmvol /dev/system swap 2147483648b linear
-fs /dev/mapper/system-root / btrfs uuid=e484623c-ec16-4895-8339-5eaaf822be89 label= options=rw,relatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot
+#fs /dev/mapper/system-root / btrfs uuid=e484623c-ec16-4895-8339-5eaaf822be89 label= options=rw,relatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot
-swap /dev/mapper/system-swap uuid=33fa1a05-01a2-4afe-9445-fada1ac4447a label=
+#swap /dev/mapper/system-swap uuid=33fa1a05-01a2-4afe-9445-fada1ac4447a label=
makamp1 commented at 2020-06-25 05:45:¶
Using the above local.conf works fine now and can see all the files in /opt are in the ISO image
I have used the BACKUP_URL as NFS .. and ISO created on NFS server fine and able to restore it.
this could be different issue to the one I started with
During the restore, if NFS server is not available, how to use the Local
ISO file to recover it ?
.. i.e. download the ISO locally and perform "rear recover"
BACKUP_URL=file://mnt/REAR
but I can not mount the ISO to /mnt/REAR, since ISO module is not loaded in the rescue kernel
any other alternatives you suggest ?
jsmeix commented at 2020-06-25 07:05:¶
@makamp1
it seems you mix up different things:
The ReaR recovery system versus the backup of your files.
Both are two different and separated things.
With
OUTPUT=ISO
you get your ReaR recovery system made as a bootable ISO image.
With
BACKUP=NETFS
BACKUP_URL=nfs://...
you get the backup of your files made with tar
and stored on your NFS
server.
Your ReaR recovery system does not contain the backup of your files.
On your replacement hardware you boot your ReaR recovery system.
In the ReaR recovery system you run "rear recover" which
first recreates your disk layout (according to disklayout.conf) and
then it restores the backup of your files.
To restore the backup of your files it must be possible to access your
backup
that is stored on your NFS server from within the ReaR recovery
system.
This means your replacement hardware must be in a network environment
where it is possible to access your NFS server where your backup is
stored
and the network setup of your ReaR recovery system must be appropriate
so that it works to mount the NFS share where your backup is stored
at a mountpoint in your ReaR recovery system.
In general to be able to mount ISOs in the ReaR recovery system
cf.
https://github.com/rear/rear/issues/1202
specify in your etc/rear/local.conf MODULES=( 'all_modules' )
which
is
the default since ReaR 2.5, cf.
https://github.com/rear/rear/blob/master/doc/rear-release-notes.txt#L924
Because you use multipath and UEFI
I guess you may use multipath disks with GPT partitioning.
If you use multipath disks with GPT partitioning I strongly recommend to
use
ReaR 2.6 because we have fixes for multipath disks with GPT
partitioning
in ReaR 2.6, see the 'multipath' related entries in
https://github.com/rear/rear/blob/master/doc/rear-release-notes.txt
in particular see
https://github.com/rear/rear/blob/master/doc/rear-release-notes.txt#L702
It is possible to have several ReaR versions in parallel each one
in its own separated directory without conflicts between each other
and without conflicts with a normally installed ReaR version via RPM
package
so you could try out our latest ReaR upstream code as you like, see the
section
"Testing current ReaR upstream GitHub master code" in
https://en.opensuse.org/SDB:Disaster_Recovery
In general for more and background information you may have a look at
https://en.opensuse.org/SDB:Disaster_Recovery
[Export of Github issue for rear/rear.]