-
Notifications
You must be signed in to change notification settings - Fork 149
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
[experimental] Upgrade dracut module: Update /usr mounting solution #1202
base: main
Are you sure you want to change the base?
Conversation
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.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp, e.g. from PR#42, use It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
See other labels for particular jobs defined in the 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. |
/packit build |
67da1cd
to
bc5fd7e
Compare
/packit build |
Originally we had implemented our own mount_usr.sh script, which took care about mounting the /usr when it is present on separate partition / mountpoint. It took care also about LVM activation. However, it has been problematic in various cases (e.g. when device needed more time for initialisation - e.g. when connected using FC). Let's use instead existing system solutions, starting the upgrade.target after initrd-fs.target (instead of just basic.target). TBD jira: RHEL-3344
bc5fd7e
to
1fd6b1c
Compare
@pirat89 I have tried this patch with a VM that uses a separate virtio block device for /usr and it worked fine. I have verified that /usr is mounted, and that Do you happen to have any recollection on the conditions when this patch was not working? |
@MichalHe I have reproduced the problem with:
note that for the screenshot I had to re-run it, that's why you see an extra msg about |
@pirat89 By default, systemd will mount only
into
Also, if the device is an LVM's logical volume and the source system is using Otherwise, the upgrade went OK. |
Looking at when What we could do in theory is to run systemd-fstab-generator before reboot and try keeping the generated |
So, the issue is essentially twofold:
To tell dracut to include key LVM binaries, and an udev rule that takes care of triggering these commands. I have tried booting into the initramfs, and the lv for 2) We want to ditch running
resulting in the
into
Now systemd is very strict how mount units should be named, so we need to rename the mount units to reflect the new mount target. For example, for
Finally, we copy the contents of
And we have an upgrade initramfs that a) autoactivates LVM, b) uses systemd to mount entries from 😁 |
Add LVM autoactivation mechanism to the upgrade initramfs. The core of the mechanism is based on a special udev rule that is triggered when a new device is detected. The rule then calls two lvm binaries (which are also included into the upgrade initrams) to activate the volume groups and logical volumes.
@MichalHe, thanks for the great in-depth analysis. Just to understand the issue better - so the problem is if we're trying to access anything else than Is this just a new use case we need to support now (having |
Previously, we activated lvm and all other mountpoints have been mounted later by And that's basically why we started these discussions, as |
OK, I see - so dracut/systemd tandem in initrd only cares about |
Side note: the reason that we're not using the usual autoactivation in dracut is historical. At first, we didn't have any event-based autoactivation, so dracut needed to come up with its own way (not that ideal, because it contains a kind of a loop, but it didn't matter much since we were interested only in the VG/LV on which the rootfs sit). Then we added native event-based autoactivation to LVM, but only with a helper We could also try what happens if we have MD (or other storage virtualization technology) in the device stack instead of LVM - but I assume it would be very similar situation. |
@prajnoha Thanks. Anything that gets the job done is fine by me. I would just note that in case this change is implemented in dracut, we would be introducing code into dracut's codebase (a maintenance cost) that would be used by no one else but us (upgrades). How much work do you think would it be to get this into dracut? Is there a reason why is it a bad idea to bypass dracut's mechanisms? @pirat89 Do you see any issues in case that this would be implemented in dracut w.r.t. to how leapp releases its RHEL builds? It would not be that we require dracut, we would have to require dracut with some minimal version, otherwise we would have to do some weird stuff when we detect the dracut version and use leapp's old mechanism or something. I am also worried a bit about what if we decide, e.g., that we will support SANs. I know a little to nothing about having a SAN attached to the system, so I blindly wonder whether a LVM could be set up on top of a SAN. Would implementing the solution in dracut be flexible enough? Our use case requires us to mount everything in fstab - is there a chance that a LVM activation requires some nontrivial systemd dependencies? Re-reading this message, I get the feeling that I am a proponent of going the "LVM-autoactivation" route. Please, do not be mistaken, I just want to make an informed decision 😁 |
Originally we had implemented our own mount_usr.sh script, which took care about mounting the /usr when it is present on separate partition / mountpoint. It took care also about LVM activation.
However, it has been problematic in various cases (e.g. when device needed more time for initialisation - e.g. when connected using FC). Let's use instead existing system solutions, starting the upgrade.target after initrd-fs.target (instead of just basic.target).
jira: RHEL-3344
Cooperating with: prajnoha, lnykryn, pvalena.
do_not_merge: just exprimenting right now. if we find working solution, I will update yet commit msg at minimum.
Additional notes
initrd-parse-etc.service
, but the inside the unit file:initrd-cleanup
service includes also switch-root, which we do not want to happen at all and due to isolation it basically kills out upgrade process.Update: