Page 1 of 1

Convert 32-bit CentOS to 64-bit?

Posted: 2013/04/24 12:09:27
by nutznboltz
What if anything could go wrong when this is done?

[code]
Do not do this on a system with precious contents. Test this on a VM of no importance to anyone.
May have unknown consequences and could cause losses.
COMPLETELY AT-YOUR-OWN-RISK. NO WARANTIES EXPRESSED OR IMPLIED. YOU HAVE BEEN WARNED.

Start with a i686 (32-bit) CentOS installation.

Fetch the kernel from a mirror using wget http://centos.some-mirror.org/.../kernel-2.6.32-{some-version}.el6.x86_64.rpm
rpm -Uhv --force --ignorearch kernel-2.6.32-{someversion}.el6.x86_64.rpm
reboot
The system will be running the 64-bit kernel which is compatible with 32-bit userspace.

rpm -q | grep 86$ | sed 's/\.....//' | xargs yumdownloader
rm *.i686.rpm
rpm -iv --force *.rpm
reboot

The system will be 64-bit.
[/code]

Note:
* If you have a working 64-bit system you can use yumdownloader to fetch the kernel and scp it to the 32-bit system instead of using wget.
* The rpm -q | grep 86$ | sed 's/\.....//' | xargs yumdownloader part could be improved to not download i686 RPMs along with the x86_64 ones.
* The *.rpm may expand to be longer than a command line can be. It may be possible to create a dummy RPM that lists all the required RPMs as dependencies in the spec file.

Convert 32-bit CentOS to 64-bit?

Posted: 2013/04/24 19:47:13
by vonskippy
Why risk it - and have to deal with a Frankenstein flaky system afterwards.

Backup your data and config files, wipe the hard drive, do a fresh 64bit install, restore data and app configs, and be confident your new 64bit system will be stable.

Re: Convert 32-bit CentOS to 64-bit?

Posted: 2013/04/24 21:06:47
by nutznboltz
I was hoping for something more specific than that but thanks anyway.

If I made two VMs, on 64-bit from the start and the other 32-bit converted to 64-bit and removed all the 32-bit kernels, and yum logs, syslogs, wtmp files, etc. and gave you root on both and asked you to tell me which was which I bet you couldn't (at least not without guessing and that would give you a 50% chance.)

Re: Convert 32-bit CentOS to 64-bit?

Posted: 2013/04/25 03:39:38
by vonskippy
I'm guessing a quick look at the default installed repo's will tell me which is which.

Re: Convert 32-bit CentOS to 64-bit?

Posted: 2013/04/25 13:01:56
by nutznboltz
And that is your definition of a flaky system?

Re: Convert 32-bit CentOS to 64-bit?

Posted: 2013/04/25 22:46:31
by AlanBartlett
Moved to [i]CentOS Social[/i], as this thread does not contain a support query.

Re: Convert 32-bit CentOS to 64-bit?

Posted: 2013/04/26 00:57:40
by nutznboltz
It's OK. Even if the question was in the support forum nobody here is smart enough to answer it.

Re: Convert 32-bit CentOS to 64-bit?

Posted: 2014/10/25 00:30:49
by Atratus
I've been experimenting with this and run into one little glitch: at the point of installing all the downloaded x86_64.rpm files it rpm itself has a cow when the architecture of the rpm command changes. At that point I deleted the __db.* files from /var/lib/rpm , rebuilt the database with rpm --rebuilddb , and then reran the rpm -iv *.rpm command. So far so good, but I am still waiting for it to finish.

This old thread ended up being relevant to me out of a desire to upgrade a 32-bit install of CentOS 6 to CentOS 7 where there is no longer a 32-bit version.

Yes, I realize the a fresh install is the recommended way to go, but there is a special combination of curious and lazy involved in this experiment ;)