# Switching from x86 to x86_64 without reinstalling

## jsepia

I have an 64-bit processor and matching motherboard. I use several programs that are known to be more efficient in their x64 versions. However my kernel is x86.

I don't want to reinstall Gentoo, I've made myself quite at home on my current installation. What should I do to be able to use programs compiled for x64? Is it enough to just recompile the kernel for x64? (I've never recompiled a kernel)

Any tips appreciated.

----------

## Jaglover

Sorry, can't be done.   :Sad: 

----------

## Hu

As Jaglover says, you cannot perform an in-place conversion.  However, for common partition layouts, this is not that much of a problem.  You can wipe the partitions containing /, /usr, and any others containing installed executable code.  Take care not to wipe the partition containing /home.  If you did not create sufficient partitions to do this, you can still pull it off, if you have enough space to spare for some shuffling.

First, confirm your latest backup is in good order.  This procedure is not risk-free, so you may need it if you make a mistake.

Shrink your filesystem(s) to create enough room for the data you want to preserve.

Shrink the partitions containing the shrunken filesystems.

Create a new partition in the resulting free space.

Make a filesystem on it.

Copy the precious data into the new filesystem.

Now you can wipe the executable partitions and install a 64-bit image.  If you cannot tolerate downtime, there is a more complex variant to allow this.  Do the steps above to move precious data onto a separate filesystem, but create enough free space that you can make additional partitions to hold the new amd64 installation.  Get a 64-bit kernel, either from a rescue CD image or via cross-compiling.  Boot it, using your 32-bit root.  You can now create an amd64 chroot and use your x86 applications while you populate the amd64 chroot.  You can then reboot using that as your root, and remove the x86 partitions once you are happy with the conversion.

----------

## d2_racing

 *Jaglover wrote:*   

> Sorry, can't be done.  

 

In fact +++

----------

## jsepia

Thanks Hu, that looks feasible but I guess I would have to reinstall every single program too in order to leave the system the way it was and avoid conflicts or broken links. I think I'll stay with 32 bits just to save me the hassle. Thanks anyway!

----------

## Hu

Yes.  One way or another, you cannot keep any of your old installed code.  The only advantage to the path I described is that your system remains functional during the upgrade, so you can continue to use it for normal tasks while converting.

----------

