# Change to 64bit kernel

## chris...

How would I change my kernel to 64bit?

How do I emerge multilib gcc?

----------

## skellr

You'd need to build the new kernel from a runnning 64 bit system or a live cd.

There is a multilib profile that's helpful for this, although, i haven't gone 32=>64 myself.

----------

## gerard27

I changed to 64 bit + multilib ~1.5 years ago.

The fastest and best way IMHO is re-install.

If your /home directory is on a separate partition all the better.

Otherwise you'll have to make a backup.

I recommend rescuecd (link in my sig).

Gerard.

----------

## i92guboj

There's no standard way (no easy way either) to go from x86 to x86_64. So, re-install.

----------

## chris...

I used crossdev and now have a 64bit kernel running and 32bit userland

How can I use the multilib profile? Is there a guide anywhere?

I have done it in sparc

http://www.gentoo.org/proj/en/base/sparc/multilib.xml

I consider creating a 64bit chroot, compile a multillib toolchain and putting this in my system as easy

also copy the lib directories to lib32

create lib64

link lib to lib64

add lib32 and lib64 to library path

change CHOST and change the portage profile

from what understand all existing 32bit binaries will use there own libs in lib32, and all new binaries and libraries will be in 64bit

I'm probably missing something or im wrong

----------

## Hu

 *chris... wrote:*   

> How can I use the multilib profile? Is there a guide anywhere?

 There is no need for a specific guide, because there is not much to it.  Just select any of the multilib profiles offered by eselect profile list in your amd64 Gentoo installation.

 *chris... wrote:*   

> I consider creating a 64bit chroot, compile a multillib toolchain

 A stage built from a multilib amd64 system will come with support for multilib.  No further action is required beyond unpacking it.

 *chris... wrote:*   

> also copy the lib directories to lib32
> 
> create lib64
> 
> link lib to lib64
> ...

 The conventional advice is not to attempt a conversion.  Although it is theoretically possible, it will almost always be simpler to reinstall instead.  Since you have a 64-bit kernel now, you can unpack an amd64 stage into a spare partition, chroot into it, and begin customizing it while your 32-bit Gentoo runs.  When you are happy with the 64-bit Gentoo, you can reboot with it as your root filesystem and remove the 32-bit Gentoo.

----------

## chris...

 *Hu wrote:*   

>  *chris... wrote:*   How can I use the multilib profile? Is there a guide anywhere? There is no need for a specific guide, because there is not much to it.  Just select any of the multilib profiles offered by eselect profile list in your amd64 Gentoo installation.

 

eselect profile list doesnt show any amd64 profile I manually linked it

 *Hu wrote:*   

>  *chris... wrote:*   also copy the lib directories to lib32
> 
> create lib64
> 
> link lib to lib64
> ...

 

I did do the direct conversion of a live system and the only tricky part for some strange reason whatever i compiled e.g. patch, bzip2, tar would not accept a file as an input

e.g.

bzip2 file did not work

bzip2 <file >file.bz2 did work

after install binary various packages from the chroot it did eventually work correctly

I've recompiled system now I'm getting everything else done

----------

## covici

So, I would like to use my existing kernel, but make it a 64-bit, so my 32-bit system can run while I chroot into my 64-bit system and get everything compiled, copying /etc and /var/lib/portage along the way.

My kernel has x86-32bit set, but I cannot find anywhere to change it to 64-bit.

What am I missing?

----------

## wswartzendruber

emerge --info

----------

## covici

 *wswartzendruber wrote:*   

> emerge --info

 

Portage 2.2.0_alpha28 (default/linux/x86/10.0/desktop, gcc-4.4.5, glibc-2.12.2-r0, 2.6.30-gentoo-r4 i686)

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

System uname: Linux-2.6.30-gentoo-r4-i686-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.0.2

Timestamp of tree: Fri, 25 Mar 2011 03:00:01 +0000

app-shells/bash:     4.2_p8

dev-java/java-config: 2.1.11-r3

dev-lang/python:     2.7.1-r1, 3.1.3-r1

dev-util/cmake:      2.8.4

sys-apps/baselayout: 2.0.2

sys-apps/openrc:     0.8.0

sys-apps/sandbox:    2.5

sys-devel/autoconf:  2.13::<unknown repository>, 2.68

sys-devel/automake:  1.4_p6::<unknown repository>, 1.5::<unknown repository>, 1.6.3::<unknown repository>, 1.7.9-r1::<unknown repository>, 1.8.5-r3::<unknown repository>, 1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.21

sys-devel/gcc:       4.4.5, 4.5.2

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.4-r1

sys-devel/make:      3.82

virtual/os-headers:  2.6.38 (sys-kernel/linux-headers)

Repositories:

gentoo

    location: /usr/portage

    sync: rsync://rsync.gentoo.org/gentoo-portage

    priority: -1000

local_ebuilds

    location: /usr/local/portage

    masters: gentoo

    priority: 0

Installed sets: 

ACCEPT_KEYWORDS="x86 ~x86"

ACCEPT_LICENSE="* -@EULA dlj-1.1 EULA AdobeFlash-10.1"

ACCEPT_PROPERTIES="*"

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"

ANT_HOME="/usr/share/ant"

APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_aliasasis authn_alias log_forensic substitute vhost_alias asis log_forensic"

APACHE2_MPMS="prefork"

ARCH="x86"

AUTOCLEAN="yes"

BASH_ENV="/root/.bashrc"

CAMERAS="ptp2"

CBUILD="i686-pc-linux-gnu"

CFLAGS=" -O2 -mtune=core2 -pipe -ggdb"

CHOST="i686-pc-linux-gnu"

CLEAN_DELAY="5"

COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"

COLLISION_IGNORE="/lib/modules"

CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"

CVS_RSH="ssh"

CXXFLAGS=" -O2 -mtune=core2 -pipe -ggdb"

DISTDIR="/usr/portage/distfiles"

EDITOR="/usr/bin/emacs"

ELIBC="glibc"

EMERGE_DEFAULT_OPTS="--ask --color=n  --verbose --nospinner"

EMERGE_WARNING_DELAY="10"

EPREFIX=""

EROOT="/"

FCFLAGS=""

FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FETCHCOMMAND="/usr/bin/wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""

FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""

FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec sftp -P \${port} \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}""

FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""

FFLAGS=""

GDK_USE_XFT="1"

GENTOO_MIRRORS="ftp://mirror.iawnet.sandia.gov/pub/gentoo http://distfiles.gentoo.org"

GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx"

GSETTINGS_BACKEND="gconf"

HOME="/root"

INFOPATH="/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.21/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.4.5/info:/usr/share/info/emacs-23"

INPUT_DEVICES="keyboard mouse evdev"

JAVAC="/etc/java-config-2/current-system-vm/bin/javac"

JAVA_HOME="/etc/java-config-2/current-system-vm"

JDK_HOME="/etc/java-config-2/current-system-vm"

KERNEL="linux"

LADSPA_PATH="/usr/lib/ladspa"

LANG="en_US.ISO-8859-1"

LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LESS="-R -M --shift 5"

LESSOPEN="|lesspipe.sh %s"

LOGNAME="root"

LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:snipped, as this long line was mangling forum formatting --cach0rr0:"

MAILMAN_MAILGID="2"

MAKEOPTS="-j1"

MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.21/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.4.5/man:/etc/java-config/system-vm/man/:/usr/lib/php5.3/man/:/usr/share/postgresql-8.4/man:/usr/share/postgresql-9.0/man"

NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"

NOCOLOR="true"

OLDPWD="/usr/src/linux-2.6.30-gentoo-r4"

OPENGL_PROFILE="nvidia"

PAGER="/usr/bin/less"

PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.5:/root/bin"

PHP_TARGETS="php5-3"

PKGDIR="/usr/portage/packages"

PORTAGE_ARCHLIST="ppc sparc64-freebsd ppc-openbsd x86-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd x86-cygwin amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris mips-irix m68k sh x86-solaris sparc-fbsd"

PORTAGE_BINHOST_CHUNKSIZE="3000"

PORTAGE_BIN_PATH="/usr/lib/portage/bin"

PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"

PORTAGE_CONFIGROOT="/"

PORTAGE_DEBUG="0"

PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"

PORTAGE_ELOG_CLASSES="log warn error"

PORTAGE_ELOG_MAILFROM="portage@localhost"

PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"

PORTAGE_ELOG_MAILURI="covici /usr/sbin/sendmail"

PORTAGE_ELOG_SYSTEM="save mail_summary"

PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"

PORTAGE_FETCH_RESUME_MIN_SIZE="350K"

PORTAGE_GID="250"

PORTAGE_INST_GID="0"

PORTAGE_INST_UID="0"

PORTAGE_PYM_PATH="/usr/lib/portage/pym"

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

PORTAGE_RSYNC_RETRIES="-1"

PORTAGE_SANDBOX_COMPAT_LEVEL="22"

PORTAGE_SYNC_STALE="30"

PORTAGE_TMPDIR="/var/tmp"

PORTAGE_VERBOSE="1"

PORTAGE_WORKDIR_MODE="0700"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

PORT_LOGDIR="/var/log/portage"

PRELINK_PATH_MASK="/usr/lib/klibc:/usr/lib/libfreebl3.so:/usr/lib/libnssdbm3.so:/usr/lib/libsoftokn3.so"

PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"

PS1="\h:\w\$ "

PWD="/usr/src"

PYTHONDOCS="/usr/share/doc/python-docs-2.7.1/html/library"

PYTHONDOCS_2_6="/usr/share/doc/python-docs-2.6.6/html/library"

PYTHONDOCS_2_7="/usr/share/doc/python-docs-2.7.1/html/library"

PYTHONDOCS_3_1="/usr/share/doc/python-docs-3.1.3/html/library"

PYTHONDONTWRITEBYTECODE="1"

RESUMECOMMAND="/usr/bin/wget -c -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""

RESUMECOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""

RESUMECOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""

ROOT="/"

ROOTPATH="/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.5"

RPMDIR="/usr/portage/rpm"

RUBYOPT="-rauto_gem"

RUBY_TARGETS="ruby18"

SGML_CATALOG_FILES="/etc/sgml/sgml-docbook-4.0.cat:/etc/sgml/sgml-docbook-4.4.cat:/etc/sgml/sgml-docbook-3.0.cat:/etc/sgml/sgml-lite.cat:/etc/sgml/sgml-docbook.cat:/etc/sgml/xml-simple-docbook-1.0.cat:/etc/sgml/sgml-ent.cat:/etc/sgml/xml-docbook-4.2.cat:/etc/sgml/xml-docbook-4.4.cat:/etc/sgml/xml-docbook-4.1.2.cat:/etc/sgml/xml-simple-docbook-4.1.2.4.cat:/etc/sgml/xml-docbook-4.5.cat:/etc/sgml/dsssl-docbook-stylesheets.cat:/etc/sgml/sgml-docbook-4.5.cat:/etc/sgml/openjade-1.3.2.cat:/etc/sgml/sgml-docbook-4.2.cat:/etc/sgml/xml-docbook-4.3.cat:/etc/sgml/sgml-docbook-4.1.cat:/etc/sgml/sgml-docbook-3.1.cat"

SHELL="/bin/bash"

SHLVL="1"

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

TERM="linux"

USE="X a52 aac accessibility acl acpi alsa berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus doc dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gdu gif gpm gtk gtk2 iconv ipv6 jpeg lcms ldap libnotify mad mikmod mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt3support readline sdl session spell ssl startup-notification svg sysfs tcpd tiff truetype udev unicode usb vorbis x264 x86 xcb xml xorg xulrunner 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 auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_aliasasis authn_alias log_forensic substitute vhost_alias asis log_forensic" APACHE2_MPMS="prefork" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

USER="root"

USERLAND="GNU"

USERNAME="root"

USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CAMERAS COLLECTD_PLUGINS CROSSCOMPILE_OPTS DRACUT_MODULES DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS GPSD_PROTOCOLS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL PHP_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS XFCE_PLUGINS XTABLES_ADDONS"

USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"

USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"

UUCPLOCK="/var/lock/LCK.."

VIDEO_CARDS="nvidia"

XDG_CONFIG_DIRS="/etc/xdg"

XDG_DATA_DIRS="/usr/local/share:/usr/share:/usr/share/gdm"

XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

_="/usr/bin/emerge"

----------

## chris...

OP here

I successfully change to 64bit and didnt like it

32bit is much better

changing back to 32bit was easier then going to 64bit

----------

## covici

What did you not like about the 64-bit arrangement?

----------

## chris...

considering i could directly compare it to very similar hardware running the exact same software but in 32bit

the difference i could tell was 64bit used significantly more memory and also utilized less memory

----------

## wswartzendruber

How does 64-bit use less RAM.  Pointers are twice as large.

----------

## Aquous

 *chris... wrote:*   

> the difference i could tell was 64bit used significantly more memory and also utilized less memory

 What?

----------

## chris...

less as in less cache and buffers

but more as in more memory less chace and buffers

example to get the point across

64bit

total memory used 75%

memory used less cache and buffers 50%

32bit

total memory used 95%

memory used less cache and buffers 25%

----------

