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

Include mdadm configuration in the upgrade initramfs #1095

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matejmatuska
Copy link
Member

Currently, the mdadm configuration (/etc/mdadm.conf and the alternative
location and config dirs, see man mdadm.conf#Files) is explicitly set to not
be included in upgrade initramfs (via --nomdadmconf dracut option).
However, this might cause errors when there are md raid devices on the
system.

The configuration files should be compatible between RHEL 7, 8, 9.

For example, if md array locations are used in fstab instead of UUIDs:

$ cat /etc/mdadm.conf
ARRAY /dev/md/boot level=raid1 num-devices=2 UUID=531cea9d:bcb23190:ef4a0f87:65bf90d7
ARRAY /dev/md/root level=raid1 num-devices=2 UUID=4d920d36:ac04845a:2f67ffd8:a6f7a521

$ cat /etc/fstab
/dev/md/root /                       xfs     defaults        0 0
/dev/md/boot /boot                   xfs     defaults        0 0

In this case /boot and / can't be properly mounted, because their
location is specified in mdadm.conf.

Inclusion of mdadm.conf in the upgrade initramfs should fix such problems.
The file existence check in the target userspace is performed by dracut.
Without the --mdadmconf flag the file wouldn't be included at all since
the upgrade initramfs is --nohostonly.

The scanfilesfortargetuserspace actor is generalized to allow copying
directories in addition to regular files. Also fallback
files/directories to copy in case the original file doesn't exist can be
specified.
Currently, the mdadm configuration (/etc/mdadm.conf and the alternative
location and config dirs, see man mdadm.conf#Files) is explicitly set to not
be included in upgrade initramfs (via --nomdadmconf dracut option).
However, this might cause errors when there are md raid devices on the
system.

The configuration files should be compatible between RHEL 7, 8, 9.

For example, if md array locations are used in fstab instead of UUIDs:
$ cat /etc/mdadm.conf
ARRAY /dev/md/boot level=raid1 num-devices=2 UUID=531cea9d:bcb23190:ef4a0f87:65bf90d7
ARRAY /dev/md/root level=raid1 num-devices=2 UUID=4d920d36:ac04845a:2f67ffd8:a6f7a521

$ cat /etc/fstab
/dev/md/root /                       xfs     defaults        0 0
/dev/md/boot /boot                   xfs     defaults        0 0

In this case /boot and / can't be properly mounted, because their
location is specified in mdadm.conf.

Inclusion of mdadm.conf in the upgrade initramfs should fix such problems.
The file existence check in the target userspace is performed by dracut.
Without the --mdadmconf flag the file wouldn't be included at all since
the upgrade initramfs is --nohostonly.
@github-actions
Copy link

github-actions bot commented Jul 4, 2023

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please @oamg/developers to notify leapp developers of the review request
  • /packit copr-build to submit a public copr build using packit

Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp from PR#42, use /packit test oamg/leapp#42

To launch regression testing public members of oamg organization can leave the following comment:

  • /rerun to schedule basic regression tests using this pr build and latest upstream leapp build as artifacts
  • /rerun 42 to schedule basic regression tests using this pr build and leapp*PR42* as artifacts
  • /rerun-sst to schedule sst tests using this pr build and latest upstream leapp build as artifacts
  • /rerun-sst 42 to schedule sst tests using this pr build and leapp*PR42* as artifacts

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra.

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

Successfully merging this pull request may close these issues.

1 participant