Hi Everyone!
I have found an easy workaround how upgrade Centos 7 systemd without modify grub and without reboot host.
So, You should do a few steps.
Disclaimer 1, it's HIGHLY recommended to switch to modern distr which has actual systemd with natively support cgroup v2!!!!
Disclaimer 2, all examples is directed to modify container with ID 100, LVM storage and volume group VG-IMAGES
1. Making dir for mount
2. Mount a container base image.
3. Mount neccessary DEV, PROC, SYS to container
4. Entering to container via chroot
5. Download repo with systemd with cgroup v2
6. Update all packages to actual
7. Exit from chroot and unmount DEV, PROC, SYS, Container Image
7. Start Your container
I have found an easy workaround how upgrade Centos 7 systemd without modify grub and without reboot host.
So, You should do a few steps.
Disclaimer 1, it's HIGHLY recommended to switch to modern distr which has actual systemd with natively support cgroup v2!!!!
Disclaimer 2, all examples is directed to modify container with ID 100, LVM storage and volume group VG-IMAGES
1. Making dir for mount
Bash:
mkdir -p /mnt/virtual100
2. Mount a container base image.
Bash:
mount /dev/vg-images/vm-100-disk-0 /mnt/virtual100
3. Mount neccessary DEV, PROC, SYS to container
Bash:
mount --bind /dev/ /mnt/virtual100/dev
mount --bind /dev/pts /mnt/virtual100/dev/pts
mount --bind /proc /mnt/virtual100/proc
mount --bind /sys /mnt/virtual100/sys
4. Entering to container via chroot
Bash:
chroot /mnt/virtual100
5. Download repo with systemd with cgroup v2
Bash:
wget https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/repo/epel-7/jsynacek-systemd-backports-for-centos-7-epel-7.repo -O /etc/yum.repos.d/jsynacek-systemd-centos-7.repo
6. Update all packages to actual
Bash:
yum update
7. Exit from chroot and unmount DEV, PROC, SYS, Container Image
Bash:
exit
umount /dev/virtual100/dev/pts
umount /dev/virtual100/dev
umount /dev/virtual100/proc
umount /dev/virtual100/sys
umount /dev/virtual100
7. Start Your container
Bash:
pct start 100
Last edited: