# Is it possible to reuse a Gentoo install on another machine?

## vega

I've installed Gentoo in my laptop almost 3 years ago. My system is the way I want, perfect, so I don't want to fully install Gentoo on the new laptop I'm gonna buy and spend months to get it running the way I like it (like now, in my current notebook).

My idea is pretty simple:

1 - Make a perfect copy of my current HDD to the new notebook using dd (the HDDs are the same size - 80 Gb)

2 - Boot the new machine with a live CD to chroot to the copied HDD, make the appropriate changes to /etc/make.conf and compile the kernel

3 - Add a new entry to the grub menu and reboot

4 - Gradually update the packages with the new USE flags when new releases are available

The scenario:

1 - My old notebook has a Pentium 4 2.4 GHz 400 MHz 512 Kb L2 cache

2 - My new notebook will have a Pentium M 740 1.73 GHz 533 MHz 2 Mb L2 cache

3 - I don't care if the modem, IR, ODD or the network adapter are different, I can just uninstall the drivers/modules and install the new ones.

Do you think it is possible?

Anyone have some experience to share? I know that it probably wouldn't be possible if switching from P4 to AMD 64, but I guess it will work that way.

----------

## YD

1. Learn howto make a proper backup (:  (dd is a real crazy way, so use tar method)

2. You can migrate your linux system using backup with minor changes, if a new arch is 100% backward compatible with an old one.

----------

## vega

Thanks, YD, but my intention to use dd is not to create a backup but copy the harddrive exactly to the new one, including partitions, boot sector and everything else.

I'm not really concerned about the backup itself, I know dd will work to duplicate the disk because I've done it before to install Gentoo in several machines with the same hardware configuration.

But this situation is a little bit different because I'm copying a hard drive of a P4 2.4 to the HDD of a Pentium M 740 1.73 GHz 533 MHz 2 Mb L2 cache.

Only need to know if substituting the kernel will work "out of the box" without having to recompile all the packages I already have installed, and avoid a kernel panic (because the processor and motherboard are different).

If I used tar to save my personal configuration and files, I'd still have to compile all packages I want installed, and that's what I'm trying to avoid.

Anyway, in a couple of weeks I'll be able to test it because my new laptop will arrive. I'll post the results here (hope it works!).  :Smile: 

----------

## freelight

If it's a P3-based Pentium M (not a Pentium 4-M), and your packages were compiled with -march=pentium4, you will need to recompile them. (Or grab a p3 stage3 tarball and corresponding GRP packages for a quick install.)

----------

## nxsty

you could recompile your packages on the P4 laptop with -march=pentium3 (or -march=pentium-m for gcc 3.4) and then dd over the system. But emerge -e world will try to compile the latest version available in portage so it might cause problems if you haven´t updated it in a while. But I'm not sure that Pentium 4 compiled code won't run on a Pentium M. You could try just swapping the drives and see if the system works on your new laptop.

----------

## vega

nxsty, all my packages were compiled using:

```
CHOST="i686-pc-linux-gnu"

VIDEO_CARDS="sis"

CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays-pipe"

MAKEOPTS="-j2"

FEATURES="sandbox ccache buildpkg"

AUTOCLEAN="yes"
```

My system is fully updated:

```
kranked ~ # emerge -uDpv system

These are the packages that I would merge, in order:

Calculating system dependencies ...done!

Total size of downloads: 0 kB

kranked ~ # emerge -uDpv world

These are the packages that I would merge, in order:

Calculating system dependencies ...done!

Total size of downloads: 0 kB
```

And gcc is:

```
kranked ~ # gcc --version

gcc (GCC) 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)

Copyright (C) 2003 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

So I think it will work if I change /etc/make.conf to compile the new kernel and gradually recompile the other packages as soon as they have updates in the portage tree.

The idea of switching the harddrive is good also, although I think I must recompile the kernel first since it's a great change of processor type and motherboard and it will certainly lead to a kernel panic.

BTW, I didn't find in the docs any reference to -march=pentium-m. Where can I get info on all supported platforms for gcc?

----------

## freelight

Pentium M is a Pentim 3 with CPU frequency throttling, I believe.

----------

## St. Joe

 *vega wrote:*   

> BTW, I didn't find in the docs any reference to -march=pentium-m. Where can I get info on all supported platforms for gcc?

 

GCC 3.3.5 Intel 386 and AMD x86-64 Options

If you will upgrade to the gcc-3.4.3 you have more options:

GCC 3.4.3 Intel 386 and AMD x86-64 Options

----------

## vega

 *freelight wrote:*   

> Pentium M is a Pentim 3 with CPU frequency throttling, I believe.

 You're right! According to http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/i386-and-x86_002d64-Options.html (thanks, St. Joe!):

```
pentium-m

    Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set support. Used by Centrino notebooks.
```

Works only in gcc 3.4.3 which is masked in portage, so I think I'll wait to upgrade.

----------

## St. Joe

 *vega wrote:*   

> Works only in gcc 3.4.3 which is masked in portage, so I think I'll wait to upgrade.

 

I use that version without issues but it would require you recompiling your system and most likely the world packages as well. The gcc-3.4.3 ebuild itself is very stable from my experience, but if you are not planning on doing a total rebuild then I'd stay away from that option. Perhaps another day.

```
$ gcc --version

gcc (GCC) 3.4.3-20050110 (Gentoo 3.4.3.20050110-r2, ssp-3.4.3.20050110-0, pie-8.7.7)

Copyright (C) 2004 Free Software Foundation, Inc.
```

----------

## gerard27

I did something similar.

I used a rescue cd,mounted both HDisks to two directories,

named tempto and tempfrom,that I made with mkdir.

Then I used 

```

cp -a /tempfrom/* /tempto/* 
```

and kept my fingers crossed,but it came out allright.

Of course you have to partition and make filesytems first on the new disk

----------

## St. Joe

Even just tarring the whole install to a DVD and then extracting it to a ready partition on your new HD should work as long as it is the same basic arch. Next just chroot into that path using a LiveCD or similar, reinstall grub & reset your fstab if required, and that should take care of everything.

----------

## vega

 *St. Joe wrote:*   

> Even just tarring the whole install to a DVD and then extracting it to a ready partition on your new HD should work...

 Uow! I'd need a 70+ Gb DVD!

See, I think I have the entire portage tree installed! And that's the main reason I'm not in the mood to recompile everything.  :Very Happy: 

----------

## St. Joe

 *vega wrote:*   

> Uow! I'd need a 70+ Gb DVD!

 

You just made me feel pretty small with my tarred 2.8GB backup.  :Smile: 

And that's with Gnome and KDE installed!  :Shocked: 

Size ain't everything.  :Wink: 

----------

## vega

 *St. Joe wrote:*   

> Size ain't everything. 

 Tell that to my wife! hehehe....

I don't have Gnome anymore (I hate it from my guts) but I'm a developer and have most tools installed and also like to test everything Linux related, so I always install software just for fun, to learn and test. I usually find something I like everyday.

As for X11 WM, I have KDE, Enlighment, Fluxbox, FVWM, blackbox, aewm++, windowmaker, ctwm, evilwm, icewm and willing to give metisse a shot when I have the time. I don't really like any of them but today I have to use a GUI most of the time because of my clients, so I switch often trying not to get too bored. My favorite apps are still the shell (with screen), vim and mutt, which I use all the time (BTW, Ctrl+Alt+F2 is my best friend).

Also have most of the available apps in the categories app-laptop, dev-db, sys-apps, sys-devel, app-benchmarks, dev-php, net-analizer, net-www, etc...

It sounds exaggerated but I've learned a lot by doing this. I started to do this 5 years ago when I still used RedHat and Slack. Things got even more fun when I discovered Gentoo!  :Very Happy: 

----------

## vega

I forgot to say that I have tons of text apps installed, i'm in a constant search for a better text editor for coding but no app can beat vim! (don't wish to start a flame with Emacs' users though, I respect your choice)  :Twisted Evil: 

----------

