Convert 32-bit CentOS to 64-bit?
-
- Posts: 25
- Joined: 2010/06/08 18:32:43
Convert 32-bit CentOS to 64-bit?
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.
[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?
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.
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.
-
- Posts: 25
- Joined: 2010/06/08 18:32:43
Re: Convert 32-bit CentOS to 64-bit?
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.)
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?
I'm guessing a quick look at the default installed repo's will tell me which is which.
-
- Posts: 25
- Joined: 2010/06/08 18:32:43
Re: Convert 32-bit CentOS to 64-bit?
And that is your definition of a flaky system?
- AlanBartlett
- Forum Moderator
- Posts: 9345
- Joined: 2007/10/22 11:30:09
- Location: ~/Earth/UK/England/Suffolk
- Contact:
Re: Convert 32-bit CentOS to 64-bit?
Moved to [i]CentOS Social[/i], as this thread does not contain a support query.
-
- Posts: 25
- Joined: 2010/06/08 18:32:43
Re: Convert 32-bit CentOS to 64-bit?
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?
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
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