Relax and Recovery Issue

Latest response

Hello experts,

Hope you are doing well.
Its been years since I was really happy with the Rear backup recovery.
Buy recently I have been facing a picualliar issue while creating a backup.

so here is the scenario. I accidentally installed the server into 'nvme' disk instead of 'sda'. So I was planning to take backup of the image. and recover the system under 'sda'.

$ lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda             8:0    0 446.6G  0 disk 
├─sda1          8:1    0     1G  0 part 
├─sda2          8:2    0    16G  0 part 
└─sda3          8:3    0 429.6G  0 part 
sdb             8:16   0  65.5T  0 disk 
└─sdb1          8:17   0  65.5T  0 part /Backup  <=== [should be skipped]
nvme0n1       259:0    0 372.6G  0 disk 
├─nvme0n1p1   259:1    0     1G  0 part /boot
├─nvme0n1p2   259:2    0     4G  0 part [SWAP]
└─nvme0n1p3   259:3    0 367.6G  0 part 
  └─rhel-root 253:0    0 367.6G  0 lvm  /
nvme1n1       259:4    0 372.6G  0 disk 

My rear conf :

 $ sudo cat /etc/rear/local.conf 

OUTPUT=ISO
OUTPUT_URL=file:///Backup/rear/
BACKUP=NETFS
BACKUP_URL=iso:///Backup/rear/
EXCLUDE_MOUNTPOINTS=( '/Backup/*' )
AUTOEXCLUDE_PATH=( /Backup )
USE_RESOLV_CONF="no"
AUTOEXCLUDE_DISKS=( /dev/sda /dev/sda1 /dev/sda2 /dev/sda3 /dev/sdb1 /dev/sdb )
EXCLUDE_COMPONENTS=( "${EXCLUDE_COMPONENTS[@]}" "fs:/sda1" "swap:/dev/sda2" "pv:/dev/sda3" "fs:/dev/sdb1" "fs:/Backup/" )
export TMPDIR="/Backup/rear-tmp/"

So , while I ran the backup it showed that was skipping the '/Backup' directory where the '/dev/sdb1' was mounted. So the total backup should be 450GB maximum. but the backup is still compressing and continue upto 3 TB. that means it is also compressing the data under /Backup directory. Because I have over 6TB of backup under that /backup directory.

output:

# rear -v mkbackup                                       
Relax-and-Recover 2.5 / 2019-05-10
Running rear mkbackup (PID 34528)
Using log file: /var/log/rear/rear-syslog-jessore.log
Using backup archive '/Backup/rear-tmp/rear.KGxKgj8F7REACSE/tmp/isofs/Backup/rear//backup.tar.gz'
Using autodetected kernel '/boot/vmlinuz-3.10.0-693.el7.x86_64' as kernel in the recovery system
Creating disk layout
Excluding component fs:/sda1.
Excluding component swap:/dev/sda2.
Excluding component pv:/dev/sda3.
**Excluding component fs:/dev/sdb1. <== [ Skipped ]**
**Excluding component fs:/Backup/. <== [ Skipped ]**
Using guessed bootloader 'GRUB' (found in first bytes on /dev/nvme0n1)
Verifying that the entries in /var/lib/rear/layout/disklayout.conf are correct ...
Creating root filesystem layout
Skipping 'virbr0': not bound to any physical interface.
To log into the recovery system via ssh set up /root/.ssh/authorized_keys or specify SSH_ROOT_PASSWORD
Copying logfile /var/log/rear/rear-syslog-jessore.log into initramfs as '/tmp/rear-syslog-jessore-partial-2020-06-01T22:11:06+0600.log'
Copying files and directories
Copying binaries and libraries
Copying all kernel modules in /lib/modules/3.10.0-693.el7.x86_64 (MODULES contains 'all_modules')
Copying all files in /lib*/firmware/
Broken symlink '/usr/lib/modules/3.10.0-693.el7.x86_64/source' in recovery system because 'readlink' cannot determine its link target
Broken symlink '/usr/lib/modules/3.10.0-693.el7.x86_64/build' in recovery system because 'readlink' cannot determine its link target
Testing that the recovery system in /Backup/rear-tmp/rear.KGxKgj8F7REACSE/rootfs contains a usable system
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (175796106 bytes) in 18 seconds
Creating tar archive '/Backup/rear-tmp/rear.KGxKgj8F7REACSE/tmp/isofs/Backup/rear//backup.tar.gz'
**Archived 2575943 [avg 17381 Kib/sec] **<==== [ Still compressing 2.5TB ++]

any observation on this ?? I have tried many variations from manual but it is same.

Responses

You could try either one of the following

BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/Backup/' )
EXCLUDE_BACKUP=( ${EXCLUDE_BACKUP[@]} '/Backup/
' )

Thank you martin.

I have just tested, that works. But In my configuration the problem was in -

EXCLUDE_MOUNTPOINTS=( '/Backup/*' )

Removing the leading asterisk * fixed the situation. so the right configuratin for me was.

OUTPUT=ISO
OUTPUT_URL=file:///Backup/rear/
BACKUP=NETFS
BACKUP_URL=iso:///Backup/rear/
EXCLUDE_MOUNTPOINTS=(  /Backup )  <== this fixed the problem
USE_RESOLV_CONF="no"
AUTOEXCLUDE_DISKS=( /dev/sda /dev/sda1 /dev/sda2 /dev/sda3 /dev/sdb1 /dev/sdb )
EXCLUDE_COMPONENTS=( "${EXCLUDE_COMPONENTS[@]}" "fs:/sda1" "swap:/dev/sda2" "pv:/dev/sda3" "fs:/dev/sdb1" "fs:/Backup/" )
export TMPDIR="/Backup/rear-tmp/"

I am facing another problem now. I am trying to recover into another disk. Hopefully I will post another discussion. Please take a look then :).