FYI: "rear mkbackuponly" may create inconsistencies in var/lib/rear/layout/ · Issue #3457 · rear/rear · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During testing of #3455
I noticed that "rear mkbackuponly" may create
inconsistencies in var/lib/rear/layout/ in particular
that the content in var/lib/rear/layout/disktodo.conf
does no longer match var/lib/rear/layout/disklayout.conf
This happens when certain things in etc/rear/local.conf
are changed from "rear mkrescue" to "rear mkbackuponly".
It is your task to ensure your backup is consistent.
What I did:
I did a test on a SLES15 VM
where I added a second disk sdb with two partitions
each one with an ext4 filesystem that are mounted
at /mountpoint1 and /mountpoint2 and I wanted
to exclude the whole sdb from the very beginning as in #3455
# usr/sbin/rear -D mkrescue
...
Running 'layout/save' stage ======================
Creating disk layout
Overwriting existing disk layout file /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf
Skipping /dev/sdb in EXCLUDE_COMPONENTS (does not automatically exclude mounted filesystems on it)
SLES12-SP1 (and later) btrfs subvolumes setup needed for /dev/sda2 (default subvolume path contains '@/.snapshots/')
Added /dev/sda2 to BTRFS_SUBVOLUME_SLES_SETUP in /var/tmp/rear.pFLRJLtn1pNy2Jp/rootfs/etc/rear/rescue.conf
Excluding component /dev/sdb in EXCLUDE_COMPONENTS
Excluding component fs:/mountpoint1 in EXCLUDE_COMPONENTS
Marking component 'fs:/mountpoint1' as done in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disktodo.conf
Excluding component fs:/mountpoint2 in EXCLUDE_COMPONENTS
Marking component 'fs:/mountpoint2' as done in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disktodo.conf
Disabling excluded components in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf
Disabling component 'fs ... /mountpoint1' in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf
Disabling component 'fs ... /mountpoint2' in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf
Using sysconfig bootloader 'grub2' for 'rear recover'
Skip saving storage layout as 'barrel' devicegraph (no 'barrel' command)
Verifying that the entries in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf are correct
Created disk layout (check the results in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf)
...
# cat var/lib/rear/layout/disktodo.conf
todo /dev/sda disk
todo /dev/sda1 part
todo /dev/sda2 part
todo /dev/sda3 part
todo fs:/ fs
done fs:/mountpoint1 fs
done fs:/mountpoint2 fs
todo btrfsmountedsubvol:/ btrfsmountedsubvol
todo btrfsmountedsubvol:/opt btrfsmountedsubvol
todo btrfsmountedsubvol:/boot/grub2/x86_64-efi btrfsmountedsubvol
todo btrfsmountedsubvol:/.snapshots btrfsmountedsubvol
todo btrfsmountedsubvol:/home btrfsmountedsubvol
todo btrfsmountedsubvol:/tmp btrfsmountedsubvol
todo btrfsmountedsubvol:/srv btrfsmountedsubvol
todo btrfsmountedsubvol:/boot/grub2/i386-pc btrfsmountedsubvol
todo btrfsmountedsubvol:/root btrfsmountedsubvol
todo btrfsmountedsubvol:/usr/local btrfsmountedsubvol
todo btrfsmountedsubvol:/var btrfsmountedsubvol
todo swap:/dev/sda3 swap
# grep sdb var/lib/rear/layout/disklayout.conf
# /dev/sdb /dev/sdb ata disk 2G
# |-/dev/sdb1 /dev/sdb1 /dev/sdb part ext4 1020M /mountpoint1 058cb383-20e1-4237-abf5-c53ce27325ae
# `-/dev/sdb2 /dev/sdb2 /dev/sdb part ext4 512M /mountpoint2 670b47d9-31b3-4483-9409-43116e16b0ac
# Skipped /dev/sdb in EXCLUDE_COMPONENTS (does not automatically exclude mounted filesystems on it)
#fs /dev/sdb1 /mountpoint1 ext4 uuid=058cb383-20e1-4237-abf5-c53ce27325ae label= blocksize=4096 reserved_blocks=5% max_mounts=-1 check_interval=0d bytes_per_inode=16384 default_mount_options=user_xattr,acl options=rw,relatime
#fs /dev/sdb2 /mountpoint2 ext4 uuid=670b47d9-31b3-4483-9409-43116e16b0ac label= blocksize=4096 reserved_blocks=4% max_mounts=-1 check_interval=0d bytes_per_inode=16384 default_mount_options=user_xattr,acl options=rw,relatime
Then I changed EXCLUDE_COMPONENTS in etc/rear/local.conf to
EXCLUDE_COMPONENTS+=( /dev/sdb fs:/mountpoint1 )
and did "rear mkbackuponly"
# usr/sbin/rear -D mkbackuponly
...
Running 'layout/save' stage ======================
Creating disk layout
Skipping /dev/sdb in EXCLUDE_COMPONENTS (does not automatically exclude mounted filesystems on it)
SLES12-SP1 (and later) btrfs subvolumes setup needed for /dev/sda2 (default subvolume path contains '@/.snapshots/')
Added /dev/sda2 to BTRFS_SUBVOLUME_SLES_SETUP in /var/tmp/rear.RvEysQdBOQRrsvV/rootfs/etc/rear/rescue.conf
Excluding component /dev/sdb in EXCLUDE_COMPONENTS
Excluding component fs:/mountpoint1 in EXCLUDE_COMPONENTS
Marking component 'fs:/mountpoint1' as done in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disktodo.conf
Disabling excluded components in /var/tmp/rear.RvEysQdBOQRrsvV/tmp/backuplayout.conf
Disabling component 'fs ... /mountpoint1' in /var/tmp/rear.RvEysQdBOQRrsvV/tmp/backuplayout.conf
Using sysconfig bootloader 'grub2' for 'rear recover'
Skip saving storage layout as 'barrel' devicegraph (no 'barrel' command)
Verifying that the entries in /var/tmp/rear.RvEysQdBOQRrsvV/tmp/backuplayout.conf are correct
Created disk layout (check the results in /var/tmp/rear.RvEysQdBOQRrsvV/tmp/backuplayout.conf)
...
# cat var/lib/rear/layout/disktodo.conf
todo /dev/sda disk
todo /dev/sda1 part
todo /dev/sda2 part
todo /dev/sda3 part
todo fs:/ fs
done fs:/mountpoint1 fs
todo fs:/mountpoint2 fs
todo btrfsmountedsubvol:/ btrfsmountedsubvol
todo btrfsmountedsubvol:/opt btrfsmountedsubvol
todo btrfsmountedsubvol:/boot/grub2/x86_64-efi btrfsmountedsubvol
todo btrfsmountedsubvol:/.snapshots btrfsmountedsubvol
todo btrfsmountedsubvol:/home btrfsmountedsubvol
todo btrfsmountedsubvol:/tmp btrfsmountedsubvol
todo btrfsmountedsubvol:/srv btrfsmountedsubvol
todo btrfsmountedsubvol:/boot/grub2/i386-pc btrfsmountedsubvol
todo btrfsmountedsubvol:/root btrfsmountedsubvol
todo btrfsmountedsubvol:/usr/local btrfsmountedsubvol
todo btrfsmountedsubvol:/var btrfsmountedsubvol
todo swap:/dev/sda3 swap
# grep sdb var/lib/rear/layout/disklayout.conf
# /dev/sdb /dev/sdb ata disk 2G
# |-/dev/sdb1 /dev/sdb1 /dev/sdb part ext4 1020M /mountpoint1 058cb383-20e1-4237-abf5-c53ce27325ae
# `-/dev/sdb2 /dev/sdb2 /dev/sdb part ext4 512M /mountpoint2 670b47d9-31b3-4483-9409-43116e16b0ac
# Skipped /dev/sdb in EXCLUDE_COMPONENTS (does not automatically exclude mounted filesystems on it)
#fs /dev/sdb1 /mountpoint1 ext4 uuid=058cb383-20e1-4237-abf5-c53ce27325ae label= blocksize=4096 reserved_blocks=5% max_mounts=-1 check_interval=0d bytes_per_inode=16384 default_mount_options=user_xattr,acl options=rw,relatime
#fs /dev/sdb2 /mountpoint2 ext4 uuid=670b47d9-31b3-4483-9409-43116e16b0ac label= blocksize=4096 reserved_blocks=4% max_mounts=-1 check_interval=0d bytes_per_inode=16384 default_mount_options=user_xattr,acl options=rw,relatime
Now var/lib/rear/layout/disktodo.conf does no longer
match var/lib/rear/layout/disklayout.conf
because with
EXCLUDE_COMPONENTS+=( /dev/sdb fs:/mountpoint1 )
var/lib/rear/layout/disklayout.conf becomes this
# usr/sbin/rear -D mkrescue
...
Running 'layout/save' stage ======================
Creating disk layout
Overwriting existing disk layout file /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf
Skipping /dev/sdb in EXCLUDE_COMPONENTS (does not automatically exclude mounted filesystems on it)
SLES12-SP1 (and later) btrfs subvolumes setup needed for /dev/sda2 (default subvolume path contains '@/.snapshots/')
Added /dev/sda2 to BTRFS_SUBVOLUME_SLES_SETUP in /var/tmp/rear.ahMiqcApvqDGLlO/rootfs/etc/rear/rescue.conf
Excluding component /dev/sdb in EXCLUDE_COMPONENTS
Excluding component fs:/mountpoint1 in EXCLUDE_COMPONENTS
Marking component 'fs:/mountpoint1' as done in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disktodo.conf
Disabling excluded components in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf
Disabling component 'fs ... /mountpoint1' in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf
Using sysconfig bootloader 'grub2' for 'rear recover'
Skip saving storage layout as 'barrel' devicegraph (no 'barrel' command)
Verifying that the entries in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf are correct
Created disk layout (check the results in /root/rear.github.master.jsmeix-disk-EXCLUDE_COMPONENTS/var/lib/rear/layout/disklayout.conf)
...
# cat var/lib/rear/layout/disktodo.conf
todo /dev/sda disk
todo /dev/sda1 part
todo /dev/sda2 part
todo /dev/sda3 part
todo fs:/ fs
done fs:/mountpoint1 fs
todo fs:/mountpoint2 fs
todo btrfsmountedsubvol:/ btrfsmountedsubvol
todo btrfsmountedsubvol:/opt btrfsmountedsubvol
todo btrfsmountedsubvol:/boot/grub2/x86_64-efi btrfsmountedsubvol
todo btrfsmountedsubvol:/.snapshots btrfsmountedsubvol
todo btrfsmountedsubvol:/home btrfsmountedsubvol
todo btrfsmountedsubvol:/tmp btrfsmountedsubvol
todo btrfsmountedsubvol:/srv btrfsmountedsubvol
todo btrfsmountedsubvol:/boot/grub2/i386-pc btrfsmountedsubvol
todo btrfsmountedsubvol:/root btrfsmountedsubvol
todo btrfsmountedsubvol:/usr/local btrfsmountedsubvol
todo btrfsmountedsubvol:/var btrfsmountedsubvol
todo swap:/dev/sda3 swap
# grep sdb var/lib/rear/layout/disklayout.conf
# /dev/sdb /dev/sdb ata disk 2G
# |-/dev/sdb1 /dev/sdb1 /dev/sdb part ext4 1020M /mountpoint1 058cb383-20e1-4237-abf5-c53ce27325ae
# `-/dev/sdb2 /dev/sdb2 /dev/sdb part ext4 512M /mountpoint2 670b47d9-31b3-4483-9409-43116e16b0ac
# Skipped /dev/sdb in EXCLUDE_COMPONENTS (does not automatically exclude mounted filesystems on it)
#fs /dev/sdb1 /mountpoint1 ext4 uuid=058cb383-20e1-4237-abf5-c53ce27325ae label= blocksize=4096 reserved_blocks=5% max_mounts=-1 check_interval=0d bytes_per_inode=16384 default_mount_options=user_xattr,acl options=rw,relatime
fs /dev/sdb2 /mountpoint2 ext4 uuid=670b47d9-31b3-4483-9409-43116e16b0ac label= blocksize=4096 reserved_blocks=4% max_mounts=-1 check_interval=0d bytes_per_inode=16384 default_mount_options=user_xattr,acl options=rw,relatime
The reason is that during "rear mkbackuponly"
it creates var/lib/rear/layout/disktodo.conf
and a new .../tmp/backuplayout.conf
so it makes a new var/lib/rear/layout/disktodo.conf
but keeps the old var/lib/rear/layout/disklayout.conf
which then do no longer match when the ReaR config
has changed.
This is no real problem because in the ReaR recovery sytem
both do match because "rear mkrescue" creates both new.
But it is an inconsistent behaviour of "rear mkbackuponly".
I think "rear mkbackuponly" should also create
a new .../tmp/disktodo.conf that matches
its new .../tmp/backuplayout.conf
By the way:
With
EXCLUDE_COMPONENTS+=( /dev/sdb fs:/mountpoint1 )
(i.e. without 'fs:/mountpoint2' in EXCLUDE_COMPONENTS)
I get - as expected - in the backup:
Uh oh!
There was an error while loading. Please reload this page.
Platform
Linux x64
Issue description:
During testing of #3455
I noticed that "rear mkbackuponly" may create
inconsistencies in var/lib/rear/layout/ in particular
that the content in var/lib/rear/layout/disktodo.conf
does no longer match var/lib/rear/layout/disklayout.conf
This happens when certain things in etc/rear/local.conf
are changed from "rear mkrescue" to "rear mkbackuponly".
In general it is a known issue that one must not mess around
with the ReaR config for "rear mkrescue" and "rear mkbackuponly", see
https://en.opensuse.org/SDB:Disaster_Recovery#Relax-and-Recover_versus_backup_and_restore
What I did:
I did a test on a SLES15 VM
where I added a second disk sdb with two partitions
each one with an ext4 filesystem that are mounted
at /mountpoint1 and /mountpoint2 and I wanted
to exclude the whole sdb from the very beginning as in
#3455
According to
#3455 (comment)
I had in etc/rear/local.conf
when I did "rear mkrescue"
Then I changed EXCLUDE_COMPONENTS in etc/rear/local.conf to
and did "rear mkbackuponly"
Now var/lib/rear/layout/disktodo.conf does no longer
match var/lib/rear/layout/disklayout.conf
because with
var/lib/rear/layout/disklayout.conf becomes this
The reason is that during "rear mkbackuponly"
it creates var/lib/rear/layout/disktodo.conf
and a new .../tmp/backuplayout.conf
so it makes a new var/lib/rear/layout/disktodo.conf
but keeps the old var/lib/rear/layout/disklayout.conf
which then do no longer match when the ReaR config
has changed.
This is no real problem because in the ReaR recovery sytem
both do match because "rear mkrescue" creates both new.
But it is an inconsistent behaviour of "rear mkbackuponly".
I think "rear mkbackuponly" should also create
a new .../tmp/disktodo.conf that matches
its new .../tmp/backuplayout.conf
By the way:
With
(i.e. without 'fs:/mountpoint2' in EXCLUDE_COMPONENTS)
I get - as expected - in the backup:
i.e. only the /mountpoint1 contents
are excluded from the backup.
The text was updated successfully, but these errors were encountered: