Editing 028 to 042 kernel upgrade

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
This article describes a way to upgrade your old OpenVZ system with RHEL5-based
 
This article describes a way to upgrade your old OpenVZ system with RHEL5-based
 
(028stabNNN kernel) to RHEL6-based (042stabNNN) kernel, and convert /vz
 
(028stabNNN kernel) to RHEL6-based (042stabNNN) kernel, and convert /vz
from ext3 to ext4, while keeping RHEL/CentOS 5 as a host OS.
+
from ext3 to ext4.
  
 
Assumptions:
 
Assumptions:
Line 16: Line 16:
  
 
  yum update
 
  yum update
 
Install required software:
 
 
yum install e4fsprogs.x86_64
 
  
 
== Add rhel6 kernel repos ==
 
== Add rhel6 kernel repos ==
Line 73: Line 69:
  
 
and make sure the system is up and running.
 
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 ==
 
== Convert /vz to ext4 ==
  
If your /vz is a separate file system, you need to stop all containers
+
Boot node from a live-CD (such as, CentOS 6 live CD) and perform the following steps.
and 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).
 
  
 
Check file system:
 
Check file system:
Line 93: Line 78:
  
 
Turn on ext4 features:
 
Turn on ext4 features:
  # tune4fs -O extents,uninit_bg,dir_index /dev/sd''xY''
+
  # tune2fs -O extents,uninit_bg,dir_index /dev/sd''xY''
  
 
Check the new file system again, as ext4 this time:
 
Check the new file system again, as ext4 this time:
  # fsck.ext4 -fpD /dev/sd''xY''
+
  # fsck.ext4 -fD /dev/sd''xY''
  
If you have booted from the live CD, you can do the same for root filesystem.
+
You can do the same for root filesystem, too.
  
If you have booted from the live CD, do this:
+
Now, mount your ROOT (<code>/</code>, not <code>/vz</code>) and BOOT partitions:
* mount your ROOT and BOOT partitions:
 
 
  # mkdir /tmp/root
 
  # mkdir /tmp/root
 
  # mount /dev/sd''aB'' /tmp/root
 
  # mount /dev/sd''aB'' /tmp/root
 
  # mount /dev/sd''aC'' /tmp/root/boot
 
  # mount /dev/sd''aC'' /tmp/root/boot
* chroot into it:
+
 
 +
Finally, chroot into it:
 
  # chroot /tmp/root
 
  # chroot /tmp/root
  
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).
+
Edit its <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
 
  # vi /etc/fstab
  
 
== Create new initrd with proper modules ==
 
== Create new initrd with proper modules ==
  
# KV=042stab083.2
+
This assumes you are still entered chroot:
  # mkinitrd -v -f --with=ext4 --without-usb /boot/initrd-2.6.32-${KV}.img 2.6.32-${KV}
+
 
 +
  # mkinitrd -v -f --with=ext4 --builtin=ehci-hcd --builtin=ohci-hcd --builtin=uhci-hcd \
 +
  /boot/initrd-2.6.32-042stab81.8.img 2.6.32-042stab081.8
  
 
Notes:
 
Notes:
 
* you have to add ext4 explicitly
 
* you have to add ext4 explicitly
* in RHEL6 kernels USB modules are built-in
+
* in RHEL6 kernels some USB stuff (that used to be in ehci-hcd, ohci-hcd, uhci-hcd modules) is built-in
  
 
== Reboot and enjoy ==
 
== Reboot and enjoy ==
Line 137: Line 124:
 
       /dev/sda2    ext3    496M  46M  425M  10% /boot
 
       /dev/sda2    ext3    496M  46M  425M  10% /boot
 
       /dev/sdb1    ext4    1.8T  196M  1.7T  1% /vz
 
       /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 ==
 
== See also ==

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)