CentOS 6.6 32Bit to 64Bit Upgrade to CentOS 7.0 - NOT 3D Printer Related.

Introduction

  • Let me say this, it was foolish of me to install a 32bit centos way back when. It started as a vmware player machine I built when CentOS 5.x was the latest and greatest. The problem is that my machine had a 32bit cpu in it. So even the virtual machine was 32bit.

  • This machine was regularly updated and is currently hosting media wiki. The wiki is nice but a pain in the ass to move. Its gone through the update cycles to become a CentOS 6.6 final 32bit machine.

  • CentOS 7.0 is out and I would like to go from CentOS6.6 32bit to CentOS 7.0 64Bit... It is however easier said than done. I could have just rebuilt the wiki with CentOS 7.0 and installed media wiki then exported and imported to it. However I find that a pain in the butt. The documentation is sparse and not really all that friendly. I decided to try another route. 32bit -> 64Bit – CentOS 7.0 64bit. It’s a bit of a hack job and the process could be somewhat scripted. However its not all that bad.

Preparing

  • You need to know your kernel version before you do anything. uname -a takes care of that. My version happens to be (2.6.32-504.1.3.el6.i686)

  • You need a valid URL for the repo. I used the following. http://mirror.centos.org/centos-6/6/centosplus/x86_64/Packages/

  • You need to back up your machine if it is important to you. For me I am currently hosting this machine on esxi 5.5 and I simply shut down the machine and copied the 20G vmdk out to my desktop.

Jumping in....

  • Execute the following being careful of observing the x86_64 portion of the kernel.

"wget http://mirror.centos.org/centos-6/6/centosplus/x8664/Packages/kernel-2.6.32-504.1.3.el6.centos.plus.x8664.rpm"

then

"wget http://mirror.centos.org/centos-6/6/centosplus/x86_64/Packages/kernel-firmware-2.6.32-504.1.3.el6.centos.plus.noarch.rpm"

  • Now we must install the kernel. Execute the following if you’re using the same version kernel as I am.

"rpm -Uhv --force --ignorearch kernel-2.6.32-504.1.3.el6.centos.plus.x86_64.rpm kernel-firmware-2.6.32-504.1.3.el6.centos.plus.noarch.rpm"

  • Reboot the box and you should be running a 64bit kernel.

Cleaning up the repo.

  • I did not bother to script this or figure out sed commands. I simply dumped the entire rpm repo out to a file in /tmp

"rpm -qa >> /tmp/rpm.86.txt"

  • We must edit this file and remove the "i686" entries. To do this I am using vi find and replace command. 1 - vi /tmp/rpm.86.txt
    2 - ":1,$ s/i686/x8664/g" This will replace the i686 with a x8664

  • Download all the 64bit packages. As of now not all the packs are available in 64bit, however most 32bit packages will work on a 64bit environment. To download the packages execute the following." cat rpm.86.txt | xargs yumdownloader " NOTE: Please consider the partition you are on and if that partition has 4-5G of free space. I am using /tmp which has about 4.5G of space.

Install new packages.

  • From the download directory execute the following. "rpm -ivh --force --ignorearch *.rpm"

  • We now must reboot the box and check if the original app is still functional.

  • I would suggests backing up the _db files in /var/lib/rpm then rebuilding the rpm db.

1 - cp -p /var/lib/rpm/db* /tmp
2 - rm -f /var/lib/rpm/
db*
4 - rpm --rebuilddb

  • Restart once more.

Upgrade from 6.6 to 7.0

  • I chose to do a live upgrade using the development method. Found in this wiki article. http://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool

  • Add the proper repo to /etc/yum.repos.d/

  • To add the repo simply run vi /etc/yum.repos.d/upgradetool.repo

  • Add the following to the file. "[upg] name=CentOS-$releasever - Upgrade Tool
    baseurl=http://dev.centos.org/centos/6/upg/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6"

  • Next up install proper packages. "yum install redhat-upgrade-tool preupgrade-assistant-contents"

  • At this point we should run the update checker. "preupg -s CentOS6_7"

  • Next up we run the importation of CentOs Keys. "rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7"

  • Finally we run the upgrade. "centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64/"

  • One thing to note, my system showed critical when asked for update. I went ahead anyway as the errors I have a feeling are related to the older 32bit packages left over. However I have a backup of the system in its original state so it’s not a problem if it goes badly.

  • To force the install anyway "centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64/ --force"

  • Once prompted restart the server and wait until the cows come home. It takes a while, especially since my wiki only runs 512mb of ram. It generally does not need more than that in my own environment.

Results

It works. I need to disable selinux and the firewall. However the sytem is actually upgraded.

Bruno M.

Engineer, Tinkerer, Technologist, Maker.

New York

Subscribe to engineerd3d

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!