Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

028 to 042 kernel upgrade

560 bytes added, 13:21, 26 May 2015
no edit summary
This article describes a way to upgrade your old OpenVZ system with RHEL5-based
(028stabNNN kernel) to RHEL6-based (042stabNNN) kernel, and convert /vz
from ext3 to ext4, while keeping RHEL/CentOS 5 as a host OS.
Assumptions:
yum update
 
Install required software:
 
yum install e4fsprogs.x86_64
== Add rhel6 kernel repos ==
and make sure the system is up and running.
 
== For linux swraid (mdadm) users with bitmap enabled and low IO write speed, you might need to redo bitmap
cat /proc/mdstat , if chunk size is small , try (example for internal bitmap) :
mdadm --grow --bitmap=none /dev/md2 ;
mdadm --grow --bitmap=internal --bitmap-chunk=16384 /dev/md2
== Convert /vz to ext4 ==
Boot If your /vz is a separate file system, you need to stop all containersand umount it first:  for ve in $(vzlist -1); do vzctl stop $ve; done umount /vz Alternatively, boot the node from a live-CD (such as, CentOS 6 live CD) and perform the following steps.
Check file system:
Turn on ext4 features:
# tune2fs tune4fs -O extents,uninit_bg,dir_index /dev/sd''xY''
Check the new file system again, as ext4 this time:
# fsck.ext4 -fD fpD /dev/sd''xY''
You If you have booted from the live CD, you can do the same for root filesystem, too.
NowIf you have booted from the live CD, do this:* mount your ROOT (<code>/</code>, not <code>/vz</code>) and BOOT partitions:
# mkdir /tmp/root
# mount /dev/sd''aB'' /tmp/root
# mount /dev/sd''aC'' /tmp/root/boot
 Finally, * chroot into it:
# chroot /tmp/root
Edit its Finally, edit <code>/etc/fstab</code>, replacing <code>ext3</code> with <code>ext4</code> for <code>/vz</code> (and <code>/</code> if you converted it as well).
# vi /etc/fstab
== Create new initrd with proper modules ==
This assumes you are still entered chroot: # KV=042stab083.2 # mkinitrd -v -f --with=ext4 --builtin=ehci-hcd --builtin=ohciwithout-hcd --builtin=uhci-hcd \ usb /boot/initrd-2.6.32-042stab81.8${KV}.img 2.6.32-042stab081.8${KV}
Notes:
* you have to add ext4 explicitly
* in RHEL6 kernels some USB stuff (that used to be in ehci-hcd, ohci-hcd, uhci-hcd modules) is are built-in
== Reboot and enjoy ==
/dev/sda2 ext3 496M 46M 425M 10% /boot
/dev/sdb1 ext4 1.8T 196M 1.7T 1% /vz
 
== Next steps ==
 
You can now install [[ploop]] and enjoy all its benefits.
 
Also, it makes sense to convert your containers to [[VSwap]].
== See also ==
Anonymous user