# Bought new CPU and MOBO and have a couple questions (SOLVED)

## bobspencer123

I currently have a x86 gentoo install on an amd 3700+ and an asrock 939 dual sata mobo. I just bought a phenom 9850 quad core and an gigabyte mobo. I'm wondering if I can keep my existing installation and perform the below steps instead of doing a complete reinstall. I want to keep the existing installation because I have numerous services setup (i.e. Samba, udev, etc..) that I would like to not have to reconfigure.

Steps I think I can do:

1) Install new hardware

2) boot with system rescue CD

3) chroot into existing installation

5) change make.conf (see below)

6) compile new kernel

7) cross fingers and reboot 

 existing gcc --info 

```
Portage 2.1.6.7 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.29-gentoo i686)

=================================================================

System uname: Linux-2.6.29-gentoo-i686-AMD_Athlon-tm-_64_Processor_3700+-with-glibc2.0

Timestamp of tree: Sat, 11 Apr 2009 13:30:01 +0000

app-shells/bash:     3.2_p39

dev-java/java-config: 1.3.7-r1, 2.1.7

dev-lang/python:     2.4.4-r13, 2.5.2-r7

dev-python/pycrypto: 2.0.1-r6

dev-util/cmake:      2.6.2-r1

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.63

sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2

sys-devel/binutils:  2.18-r3

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.27-r2

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /var/lib/hsqldb"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo "

LDFLAGS="-Wl,-O1"

LINGUAS="en_US"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X aac aalib acl alsa audiofile avi berkdb bzip2 cddb cdparanoia cdr cli cracklib crypt css cups cupsddk dbus divx dri dvd dvdr dvdread encode equalizer fam ffmpeg firefox flac flash foomaticdb fortran gdbm gpm hal iconv imagemagick imlib ipod ipv6 isdnlog java jpeg lame midi mmx mmxext mp3 mpeg mplayer mudflap ncurses nls nptl nptlonly nsplugin offesnive ogg oggvorbis opengl openmp oss pam pcre pdf pdflib perl png ppds pppd python readline reflection ruby samba sane scanner session shorten spl sse sse2 ssl sysfs tcpd truetype unicode usb vorbis wavpack win32codecs wma x86 xcomposite xine xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" USERLAND="GNU" VIDEO_CARDS="nvidia"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

I think I need to change the march and makeopts. I apparently also need to update to gcc 4.3.2 (Should I do this before or after installing new hardware?).

So any input on this would be great as I'm sure I'm missing something ... especially in the updating make.conf part and what to do with gcc.

Thanks,

BobLast edited by bobspencer123 on Fri Apr 17, 2009 2:09 pm; edited 1 time in total

----------

## johnisevil

I recently had to do something similar except I was able to salvage the CPU from the previous setup but I did get a new motherboard.  The new board used some different hardware than the one previous and out of the box didn't work with my current Gentoo setup.  Here are the steps I had to take to repair my system for the new motherboard:

1.  Booted from the Gentoo 2008.0 install CD.

2.  Load necessary modules.

3.  Assemble my RAID1 arrays with the following:

```
# mdadm --assemble /dev/md1 /dev/sda1 /dev/sdb1

# mdadm --assemble /dev/md2 /dev/sda2 /dev/sdb2

# mdadm --assemble /dev/md3 /dev/sda3 /dev/sdb3

# mdadm --assemble /dev/md4 /dev/sda4 /dev/sdb4
```

4.  Mount partitions and activate swap.

5.  Chroot into my Gentoo install.

6.  Recompile kernel.

7.  Exit chroot.

8.  Unmount partitions, reboot and cross fingers.

This can be and is a pain in the ass but it sure beats having to reinstall Gentoo because of a minor hardware change.

----------

## bobspencer123

thanks johnisevil that helps me out with first part ... now I just have to figure out timing and manner of changes in make.conf with new cpu.

----------

## johnisevil

 *bobspencer123 wrote:*   

> thanks johnisevil that helps me out with first part ... now I just have to figure out timing and manner of changes in make.conf with new cpu.

 

If you're making CFLAGS changes to /etc/make.conf you'll definitely want to rebuild world.  When I upgrade my CPU to a Phenom II soon I'll be doing that since I want to change -march=i686 to -march=barcelona now that I'm using the latest GCC.

----------

## bobspencer123

ok so my new cpu, mobo, and memory arrived last night. I have everything up and working and it's pretty freakin fast. I will list the step below in case anyone searches the forums and finds this post they will have their question answered.

Before new hardware arrived I switched to gcc 4.3.2 and used -march=native and rebuilt system and world.

STEPS:

1) Install new hardware (duh)

2) Boot with system rescue cd.

3) chroot into your gentoo environment 

        I did this for / being on sda4 and /boot being on sda3

```

mount /dev/sda4 /mnt/gentoo

mount /dev/sda3 /mnt/gentoo/boot

chroot /mnt/gentoo /bin/bash

```

4) compile new kernel to reflect hardware changes and update grub.conf

5) emerge nvidia-drivers (if using proprietary nvidia)

6) edit make.conf and only changed makeopts="-j5" and didn't need to change -march because I was using the new native switch.

7) rebooted

 :Cool:  I only had to change net.eth2 because new nic became that. So I added that to default runlevel.

9) set new soundlevels

10) to optimize my system (and test out newly found speed) I did an emerge system.

NOTE: I think I found a bug in gcc 4.3.2-r3 that when it is being built by gcc 4.3.2-r3 with an amd phenom and -march=native or -march=amdfam10 their is an internal compiler error. I found a bug like this on the gcc bug tracker but not on gentoo. I wanted to make sure so I upgraded to ~x86 gcc 4.3.3-r2 and it built fine with those marches. So if you run into this problem with a phenom and gcc 4.3.2-r3 I think the solution at this point is to upgrade gcc or build it with a generic march or mtune instead of the newly optimized -march=amdfam10 (but that takes the fun out of the new processor so I just upgraded to testing and it works great).

I think that is it. And oh yeah this baby burns now  :Smile: 

----------

