CentOS 3.4 -> 4.0 Upgrade

nuclear

Verified User
Joined
Sep 17, 2004
Messages
17
Below are the instructions that worked for me to bring a CentOS 3.4 server with DA up to 4.0. Instructions is a variation of this one.

Disclaimer: I attempted this upgrade several times both remotely and on local test machines--failing plenty of attempts. The below instructions are what ultimately worked for me and may not work for everyone else.


# wget http://mirror.trouble-free.net/cAos/centos/RPM-GPG-KEY-CentOS-4
# wget http://mirror.trouble-free.net/cAos/centos/4.0/os/i386/CentOS/RPMS/centos-release-4-0.1.i386.rpm

# rpm --import RPM-GPG-KEY-CentOS-4
# rpm -Uvh centos-release-4-0.1.i386.rpm

# yum install glibc glibc-common
# yum install (kernel or kernel-smp)


On my server I experienced a conflict with lvm2.

# cd /var/cache/yum/base/packages
# rpm -Fvh --replacefiles lvm2*.rpm

At this stage I downloaded my own kernel source and compiled it using the config file from /boot/config-2.6.9-5.0.3.EL

After installing the kernel I made an initrd image:

# cd /boot
# mkinitrd initrd-2.6.11.5-1.img 2.6.11.5


Optional step:


Configure your bootloader of choice at this point. Waiting until the end may cause further complications. I set up 2 entires for the new kernel but with different initrd images because we'll be creating one later as well.

Remove the 2.4 kernel rpms because they conflict with the new udev system.

# rpm -e kernel-smp-2.4.21-27.0.2.EL (the release number may vary depending on your system)

There will be a conflict with /etc/aliases from the da_exim package and setup-2.5.37-1.1.noarch.rpm.

# cp /etc/aliases /etc/aliases.bak
# rpm -Fvh --replacefiles /var/cache/yum/base/packages/setup-2.5.37-1.1.noarch.rpm
# mv /etc/aliases.bak /etc/aliases

Now it's time to run the yum upgrade and hope for the best.

# yum upgrade

Need to make another initrd image at this point because which one works seems to be anyone's guess.

# mkinitrd /boot/initrd-2.6.11.5-2.img 2.6.11.5


Optional step:

If you waited until now to configure your bootloader you may run into a problem since the /dev system is gone. With grub I did not have a problem and all I did was edit grub.conf and added 2 entries for the new kernel (one for each initrd image) If you use lilo you'll have to run lilo to update the boot record, and it will complain that /dev/hdaX does not exist. Solution:

# MAKDEV -d /dev hda (replace hda with the appropriate drive where your install resides)

Time for the reboot. I set lilo/grub to boot the 2.6.11.5 kernel with initrd-2.6.11.5-2.img (the second initrd image) because using the first one hangs the system on "Switching to new root"

# reboot

The system took some time to come back up, and may even run an fschk.

Once back up apache and da-popb4smtp would not run due to library errors.

For apache recompiling will solve the problem.

# cd /usr/local/directadmin/customapache
# ./build clean
# ./build all

Fixing da-popb4smtp simply required a library to be installed.

# yum install compat-libstdc++-33
# service da-popb4smtp start

As indicated further down in the original thread you'll want to install the newer rpmdb package and remove the old one.

# wget http://mirror.trouble-free.net/cAos...tOS/RPMS/rpmdb-CentOS-4.0-0.20050228.i386.rpm
# rpm --force -ivh rpmdb-CentOS-4.0-0.20050228.i386.rpm
# rpm -e rpmdb-redhat-3.4-0.20050105

Rebuild the rpm database just to be thorough.

# rm -f /var/lib/rpm/__db* && rpm --rebuilddb


* Added:

IMAP server was looking for libcom_err.so.3 just as apache/php was.


# cd /usr/lib
# ln -s libcom_err.so libcom_err.so.3


The end! Hopefully at this point everything is up and running without problem.
 
Last edited:
There is a few issues when doing it with your method. You run the risk of ending up with an non bootable machine.

You should get the server booted and running a 2.6 kernel before you yum upgrade it and install udev. If the box wont boot 2.6 the first time you are screwed because udev requires 2.6 kernel and 2.4 kernel will not work on it.

Booting to the 2.6 kernel and then installing udev also fixes the problem with /dev being gone. Make sure you have sysfs mounted first however.

I use my own method which involves installing part of the os using wget/rpm and then yum update after udev is working correctly.
 
Last edited:
Also wanted to point out to anyone doing custom kernel compiles, make sure you keep hotplug enabled otherwise udev will not operate. I have noticed some problems with software raid and udev aswell.
 
Hi, I'm looking to upgrade my server from CentOS 3.4 to the current 4.3 version. Does anyone have any more advice before I attempt this based on the information submitted above?

One thing I came across was this written by jlasman:
It's perfectly safe to use yum with DA, after adding this exclude list line:
Code:
exclude=httpd* mysql* php* perl* apache* mod_* MySQL* *ftp* exim* sendmail* php* kernel* da_*
to the bottom line of the [main] section of /etc/yum.conf.

That's the first line above the [base] line.

Any other tips or info would be most appreciated.
 
TheLinuxGuy makes some important points to heed if going up a full version.

We recommend leaving servers at the main version they were built as. CentOS is supported long enough for this to be reasonable.

And to note that we now (on OUR hardware) allow kernel updates, though of course we have to actually reboot the server to get the new kernel to run.

We've done extensive testing and studying, and on our hardware new kernels always support our hardware.

Jeff
 
Back
Top