Skip to content

Conversation

@Monstrofil
Copy link
Collaborator

This proposed change fixes upgrades on CloudLinux systems with multiple partitions.

Before this change, upgrade exited with "Can not load RPM file" error if server had multiple partitions mounted on CloudLinux.

Can not load RPM file: /installroot/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms/leapp-deps-el8-5.0.8-0.202403281153Z.c18549c5.HEAD.el8.noarch.rpm.
Can not load RPM file: /installroot/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms/leapp-repository-deps-el8-5.0.8-0.202403281153Z.c18549c5.HEAD.el8.noarch.rpm.
Can not load RPM file: /installroot/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms/kernel-workaround-0.1-1.el8.noarch.rpm.
Could not open: /installroot/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms/leapp-deps-el8-5.0.8-0.202403281153Z.c18549c5.HEAD.el8.noarch.rpm /installroot/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms/leapp-repository-deps-el8-5.0.8-0.202403281153Z.c18549c5.HEAD.el8.noarch.rpm /installroot/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms/kernel-workaround-0.1-1.el8.noarch.rpm

This error happened because leapp is expecting mounts to be shared when it creates installroot in overlayfs and it's true for CentOS-based systems, but not for CloudLinux, where mounts are remounted as private on boot.

As a result, some mounts were missing in installroot.

CentOS:

├─/var/lib/leapp/el8userspace/installroot                                                       overlay2                                                                   overlay     rw,relatime,lowerdir=/,upperdir=/var/lib/leapp/scratch/mounts/root_/upper,workdir=/var/lib/leapp/scratch/mounts/root_/work
│ ├─/var/lib/leapp/el8userspace/installroot/tmp                                                 overlay2                                                                   overlay     rw,relatime,lowerdir=/tmp,upperdir=/var/lib/leapp/scratch/mounts/root_tmp/upper,workdir=/var/lib/leapp/scratch/mounts/root_tmp/work
│ ├─/var/lib/leapp/el8userspace/installroot/usr                                                 overlay2                                                                   overlay     rw,relatime,lowerdir=/usr,upperdir=/var/lib/leapp/scratch/mounts/root_usr/upper,workdir=/var/lib/leapp/scratch/mounts/root_usr/work
│ └─/var/lib/leapp/el8userspace/installroot/var/cache/dnf                                       /dev/sda1[/var/cache/dnf]                                                  ext4        rw,relatime,data=ordered,jqfmt=vfsv1,usrjquota=quota.user

CloudLinux:

└─/var/lib/leapp/el8userspace/installroot                                                       overlay2                                                                   overlay     rw,relatime,lowerdir=/,upperdir=/var/lib/leapp/scratch/mounts/root_/upper,workdir=/var/lib/leapp/scratch/mounts/root_/work

This patch explicitely adds --make-shared argument to mount which results in shared mounts creation during elevation:

[root@vm-id-2050710 ~]# findmnt -o TARGET,PROPAGATION
TARGET                                                                                          PROPAGATION
/                                                                                               private
├─/sys                                                                                          private
...
├─/var/lve/dbgovernor-shm                                                                       private
├─/var/lib/nfs/rpc_pipefs                                                                       private
├─/tmp                                                                                          private
├─/var/tmp                                                                                      private
├─/var/lib/leapp/scratch/mounts/root_/system_overlay                                            shared
│ ├─/var/lib/leapp/scratch/mounts/root_/system_overlay/tmp                                      shared
│ ├─/var/lib/leapp/scratch/mounts/root_/system_overlay/usr                                      shared
│ ├─/var/lib/leapp/scratch/mounts/root_/system_overlay/var/cache/dnf                            shared
│ └─/var/lib/leapp/scratch/mounts/root_/system_overlay/el8target                                shared
├─/var/lib/leapp/scratch/mounts/root_tmp/root_tmp                                               shared
└─/var/lib/leapp/scratch/mounts/root_usr/root_usr                                               shared

As a result, overlayfs creation also succedes and upgrade works as it would work on regular CentOS.

├─/tmp                                                                                          private
├─/var/tmp                                                                                      private
├─/var/lib/leapp/scratch/mounts/root_/system_overlay                                            shared
│ ├─/var/lib/leapp/scratch/mounts/root_/system_overlay/tmp                                      shared
│ ├─/var/lib/leapp/scratch/mounts/root_/system_overlay/usr                                      shared
│ └─/var/lib/leapp/scratch/mounts/root_/system_overlay/var/cache/dnf                            shared
├─/var/lib/leapp/el8userspace/installroot                                                       shared
│ ├─/var/lib/leapp/el8userspace/installroot/tmp                                                 shared
│ ├─/var/lib/leapp/el8userspace/installroot/usr                                                 shared
│ └─/var/lib/leapp/el8userspace/installroot/var/cache/dnf                                       shared
├─/var/lib/leapp/scratch/mounts/root_tmp/root_tmp                                               shared
└─/var/lib/leapp/scratch/mounts/root_usr/root_usr                                               shared

This patch fixes CLOS-2565 and also probably RHEL-23449.

Monstrofil added 2 commits May 3, 2024 12:29
…565)

leapp is expecting system to have `shared` mounts propagation
by default which is wrong for os's like CloudLinux where all
mountpoints are created in `private` mode

this patch explicitly adds `--make-shared` option to `mount` command
to preserve expected behaviour of `shared` mount points during elevation

this changed does not affect existing mount points,
only those which are temporary created during upgrade process
@github-actions
Copy link

github-actions bot commented May 3, 2024

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 mergable.
If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run copr build and e2e tests in OAMG CI
  • review please to notify leapp developers of review request

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 consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@prilr prilr merged commit 69a7fbf into cloudlinux May 6, 2024
@prilr prilr deleted the clos-2565-fix-private-mounts branch June 17, 2024 11:12
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.

3 participants