Convert 32-bit CentOS to 64-bit?
Posted: 2013/04/24 12:09:27
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.