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

apply_layout_mappings function is not sufficiently fail safe #1845

Closed
jsmeix opened this issue Jun 28, 2018 · 2 comments
Closed

apply_layout_mappings function is not sufficiently fail safe #1845

jsmeix opened this issue Jun 28, 2018 · 2 comments
Assignees
Labels
cleanup enhancement Adaptions and new features fixed / solved / done minor bug An alternative or workaround exists
Milestone

Comments

@jsmeix
Copy link
Member

jsmeix commented Jun 28, 2018

The current apply_layout_mappings function is not sufficiently fail safe.

In particular things go wrong when for a target disk in /var/lib/rear/layout/disk_mappings
no associated mapping for that disk as source disk exists.
For example when I have /dev/sda and /dev/sdb both with same size
I get /var/lib/rear/layout/disk_mappings generated as

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

When I change that to

/dev/sda /dev/sdb
#/dev/sdb /dev/sdb

I get disklayout.conf changed into (excerpts):

disk /dev/sdb 21474836480 msdos
disk _REAR1_ 21474836480 msdos

Furthermore the current apply_layout_mappings function runs mad if
there are lines with unexpected syntax in /var/lib/rear/layout/disk_mappings
in particular if there are empty lines.

Because in MIGRATION_MODE /var/lib/rear/layout/disk_mappings is meant
to be manually adapted by the user ReaR should behave more fail safe against
possibly missing or wrong entries in /var/lib/rear/layout/disk_mappings.
Currently ReaR blindly proceeds in such cases.

@jsmeix jsmeix added enhancement Adaptions and new features cleanup minor bug An alternative or workaround exists labels Jun 28, 2018
@jsmeix jsmeix added this to the ReaR v2.5 milestone Jun 28, 2018
@jsmeix jsmeix self-assigned this Jun 28, 2018
@jsmeix
Copy link
Member Author

jsmeix commented Jun 28, 2018

In
#1843
the commit
ba2aefa
should make the apply_layout_mappings function and its callers behave more fail safe.

jsmeix added a commit that referenced this issue Jun 29, 2018
…B2_installation

Fixed, simplified, and enhanced GRUB2 installation on x86 architecture
(the same on ppc64le architecture is planned to be done soon).
Enhanced GRUB2 installation by the new config variable
GRUB2_INSTALL_DEVICES so that now the user
can specify what he wants if needed.
In MIGRATION_MODE apply disk mappings when
devices in GRUB2_INSTALL_DEVICES match,
cf. #1437
Made the apply_layout_mappings() function
and its callers behave more fail safe,
cf. #1845
Made 250_migrate_disk_devices_layout.sh behave safer
by saving restored original files before they get modified
(some other scripts that also modify restored files
may also need to be adapted accordingly).
Added popd where missing after pushd.
Fixed typos 'whereto' -> 'where to'.
@jsmeix
Copy link
Member Author

jsmeix commented Jun 29, 2018

With #1843 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
cleanup enhancement Adaptions and new features fixed / solved / done minor bug An alternative or workaround exists
Projects
None yet
Development

No branches or pull requests

1 participant