Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files (also restored files) get needlessly modified for identical mapping /dev/sda => /dev/sda #1847

Closed
jsmeix opened this issue Jun 29, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@jsmeix
Copy link
Member

jsmeix commented Jun 29, 2018

Using current master code.

When there are two disks /dev/sda and /dev/sdb with same size
"rear recover" goes into MIGRATION_MODE
(which is right to be on the safe side):

Comparing disks
Ambiguous possible target disks need manual configuration (more than one with same size found)
Switching to manual disk layout configuration
Using /dev/sda (same name and same size) for recreating /dev/sda
Current disk mapping table (source -> target):
    /dev/sda /dev/sda

But when that identical mapping "/dev/sda => /dev/sda" is used
then files like disklayout.conf and during finalize stage even restored files
get needlessly modified (hopefully usually with actually identical modification
but that lots of needlessly done sed magic might result unwanted changes):

Applying disk layout mappings in /var/lib/rear/layout/disk_mappings to certain restored files...
The original restored files get saved in var/lib/rear/saved_original_files/ (in /mnt/local)
Applied disk layout mappings to restored 'boot/grub2/grub.cfg' (in /mnt/local)
Applied disk layout mappings to restored 'boot/grub2/device.map' (in /mnt/local)
Applied disk layout mappings to restored 'etc/sysconfig/bootloader' (in /mnt/local)
Applied disk layout mappings to restored 'etc/fstab' (in /mnt/local)
Applied disk layout mappings to restored 'etc/mtools.conf' (in /mnt/local)
Applied disk layout mappings to restored 'etc/smartd.conf' (in /mnt/local)
Applied disk layout mappings to restored 'etc/sysconfig/smartmontools' (in /mnt/local)

One can see that since #1843 is merged
but it happened all the time (only silently and without saving original files).

I will try to detect a completely identical mapping
i.e. all entries in /var/lib/rear/layout/disk_mappings must be an identity map like

/dev/sda /dev/sda
/dev/sdb /dev/sdb
/dev/sdc /dev/sdc

and in this case all what belongs to /var/lib/rear/layout/disk_mappings
can be skipped.

@jsmeix jsmeix added enhancement Adaptions and new features cleanup labels Jun 29, 2018
@jsmeix jsmeix added this to the ReaR v2.5 milestone Jun 29, 2018
@jsmeix jsmeix self-assigned this Jun 29, 2018
@jsmeix jsmeix changed the title In finalize stage restored files get modified for identical mapping /dev/sda => /dev/sda Files (also restored files) get needlessly modified for identical mapping /dev/sda => /dev/sda Jun 29, 2018
@jsmeix
Copy link
Member Author

jsmeix commented Jul 2, 2018

In #1848 the commit
f23c601
is intended to fix this issue here, see
#1848 (comment)

jsmeix added a commit that referenced this issue Jul 16, 2018
…B2_installation_for_ppc64le

Fixed, simplified and enhanced GRUB2 installation for PPC64/PPC64LE
in the same way as it was already done for x86 architecture,
cf. #1843
and #1828
so that the code in finalize/Linux-ppc64le/620_install_grub2.sh
is aligned with the code in finalize/Linux-i386/620_install_grub2.sh
as far as possible.
Additionally the new is_completely_identical_layout_mapping function
detects if a completely identical mapping and is used
to not run the apply_layout_mappings function
when there is a completely identical mapping
cf. #1847
@jsmeix
Copy link
Member Author

jsmeix commented Jul 16, 2018

With #1848 merged
this issue should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant