Editing Centos Upgrade 4.x to 5.x
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 6: | Line 6: | ||
follow these steps: | follow these steps: | ||
− | + | 1 - Create a container using centos-4-i386-minimal and set a valid nameserver | |
− | + | <pre> | |
− | Create a container using centos-4-i386-minimal and set a valid nameserver | + | vzctl create CTID --ostemplate centos-4-i386-minimal --config CONFIG_TEMPLATE --ipadd container_IP --hostname temp |
+ | vzctl set CTID --nameserver NAMESERVER_IP --save | ||
+ | </pre> | ||
+ | 2 - Enter in container | ||
<pre> | <pre> | ||
− | vzctl | + | vzctl enter CTID |
− | |||
</pre> | </pre> | ||
− | + | 3 - Install centos-5-release packages | |
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
− | + | rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/centos-release-notes-5.0.0-2.i386.rpm | |
+ | rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/centos-release-5-0.0.el5.centos.2.i386.rpm | ||
</pre> | </pre> | ||
Note: centos-release-5 depends on notes-package, start with that one. | Note: centos-release-5 depends on notes-package, start with that one. | ||
− | + | 4 - Backup your /dev/, since initscripts need udev and will remove vzdev you'll net the backup | |
− | + | <pre> | |
− | + | tar -cf dev.tar ./dev | |
− | + | </pre> | |
+ | 5 - Install initscripts package (forced and with no deps) | ||
<pre> | <pre> | ||
− | + | rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/initscripts-8.45.30-2.el5.centos.i386.rpm --force --nodeps | |
</pre> | </pre> | ||
− | + | 6 - Exit from container | |
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
− | + | exit | |
</pre> | </pre> | ||
− | + | 7 - In /etc/vz/conf/CSID.conf replace | |
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
OSTEMPLATE="centos-4-i386-minimal" | OSTEMPLATE="centos-4-i386-minimal" | ||
</pre> | </pre> | ||
− | + | to | |
<pre> | <pre> | ||
OSTEMPLATE="centos-5-i386-minimal" | OSTEMPLATE="centos-5-i386-minimal" | ||
</pre> | </pre> | ||
− | + | 8 - Coppy existing template from | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
/vz/template/centos/4 | /vz/template/centos/4 | ||
Line 68: | Line 50: | ||
/vz/template/centos/5 | /vz/template/centos/5 | ||
</pre> | </pre> | ||
+ | 9 - In /vz/template/centos/4/i386/config/yum.conf change mirrors to CentOS 5 | ||
− | + | 10 - Upgrade container packages using vzyum (32bit only) | |
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
− | + | vzyum CTID upgrade | |
− | |||
− | |||
</pre> | </pre> | ||
+ | Note: on 64-bit yum db-version might complain. Do "rm /vz/root/VZNUM/var/lib/rpm/__*" to delete conflicting DB. | ||
− | + | 11 - Stop your VE | |
− | |||
− | |||
<pre> | <pre> | ||
− | + | vzctl stop CTID | |
</pre> | </pre> | ||
− | + | 12 - Replace the new /dev/ with the old one | |
− | |||
<pre> | <pre> | ||
− | + | cd /vz/private/CTID | |
+ | rm -rf dev | ||
+ | tar -xvf dev.tar | ||
</pre> | </pre> | ||
− | + | 13 - Leave the container private dir (or it will not stard) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
− | + | cd | |
− | |||
</pre> | </pre> | ||
− | + | 14 - Start the container | |
− | |||
− | |||
<pre> | <pre> | ||
− | vzctl | + | vzctl start CTID |
− | |||
</pre> | </pre> | ||
− | + | 15 - Remove container IP | |
− | |||
− | |||
<pre> | <pre> | ||
− | vzctl | + | vzctl set --ipdel container_IP |
</pre> | </pre> | ||
− | + | 16 - Stop container | |
− | |||
<pre> | <pre> | ||
− | + | vzctl stop CTID | |
</pre> | </pre> | ||
− | + | 17 - Create the template | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
− | cd /vz/private/ | + | cd /vz/private/CTID |
− | tar --numeric-owner -zcf /vz/template/cache/centos-5. | + | tar --numeric-owner -zcf /vz/template/cache/centos-5.0-i386-minimal.tar.gz . |
</pre> | </pre> |