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

Issue 2281(missing delete_dummy_partitions_and_resize_real_ones calls) #2295

Merged
merged 3 commits into from Dec 12, 2019

Conversation

rmetrich
Copy link
Contributor

@rmetrich rmetrich commented Dec 9, 2019

See #2281 for details.

…'" was outputted instead of "End of code handling disk '/dev/<device>'"
…used (Software Raid can have partitions since these are virtual disks
…lar disks), including MBR erasing and partition creation and cleanup

create_multipath() cannot call create_disk() because create_disk() verifies that the device is a block device, which it isn't with multipath because it's a symlink to a device mapper instead.
Copy link
Member

@jsmeix jsmeix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me from plain looking at the code changes.

@jsmeix
Copy link
Member

jsmeix commented Dec 9, 2019

@rmetrich
thank you so much for your fix!

Ony as a side note a question FYI:

As far as I see we have now the same code

    cat >> "$LAYOUT_CODE" <<EOF
# Make sure device nodes are visible (eg. in RHEL4)
my_udevtrigger
my_udevsettle

# Clean up transient partitions and resize shrinked ones
delete_dummy_partitions_and_resize_real_ones

in three scripts:

layout/prepare/GNU/Linux/100_include_partition_code.sh
layout/prepare/GNU/Linux/120_include_raid_code.sh
layout/prepare/GNU/Linux/210_load_multipath.sh

in each one directly after the create_partitions call.

I am wondering if that code could be moved
into the create_partitions function at its end, cf.
#2281 (comment)
(excerpt)

@rmetrich
when my assumption is right
that delete_dummy_partitions_and_resize_real_ones
must be called after any create_partitions call
then it is perhaps best to add the
delete_dummy_partitions_and_resize_real_ones call
into the create_partitions function to ensure that
delete_dummy_partitions_and_resize_real_ones
is always called at the end of each create_partitions call?

Or what is the reason why code like

    cat >> "$LAYOUT_CODE" <<EOF
# Make sure device nodes are visible (eg. in RHEL4)
my_udevtrigger
my_udevsettle

# Clean up transient partitions and resize shrinked ones
delete_dummy_partitions_and_resize_real_ones

#
# End of code handling disk or software RAID or multipath device '$disk'
#
EOF

cannot be added at the end of the create_partitions function
in layout/prepare/GNU/Linux/100_include_partition_code.sh
?

Perhaps the reason is obvious but I still do not see it.

@jsmeix jsmeix added bug The code does not do what it is meant to do cleanup labels Dec 9, 2019
@jsmeix jsmeix added this to the ReaR v2.6 milestone Dec 9, 2019
@jsmeix jsmeix changed the title Issue 2281 Issue 2281(missing delete_dummy_partitions_and_resize_real_ones calls) Dec 9, 2019
@rmetrich
Copy link
Contributor Author

rmetrich commented Dec 9, 2019

The idea behind create_partitions is to create partitions, but we want to let the admin create additional ones if he needs to. Hence the code being split.
Now, regarding having twice the same code, this could indeed be consolidated, but probably harder to read and detect errors, since create_disk function would now have different parameters passed to it depending on if we are multipath, a disk, or a softraid ...

@rmetrich rmetrich merged commit e18957e into rear:master Dec 12, 2019
@rmetrich
Copy link
Contributor Author

@pcahyna we may need this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do cleanup fixed / solved / done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants