| View previous topic :: View next topic |
| Author |
Message |
MrUlterior Guru

Joined: 22 Mar 2005 Posts: 503 Location: Switzerland
|
Posted: Thu Apr 27, 2006 11:58 am Post subject: x86 32bit to 64bit server conversion - tips? experiences? |
|
|
The Situation
I have a AMD XP 2000 MP (single CPU, the other died .. ) server with 2GB RAM, running LVM ontop of RAID-1 with about a TB of diskspace. The server generally is used for:
- File server (Samba for win32 clients and NFS for *nix)
- Loop-AES encrypted user home dirs
- Icecast server
- MPD Server
- Redundant MySQL Server
- Backup server (rdiff-backup of all boxes)
- Vmware-Server (contains Win2003 advanced server & FreeBSD 6.0 & 5.4 for development purposes)
Since the 2nd CPU died, the first is pretty much taxed to its limits 24/7 (Load average 6 - 10 depending on the time of day), additionally the Tyan motherboard has run out of slots so I'm unable to add diskspace.
As an "upgrade" I'm going to replace the Athlon 2000 MP with an AMD Athlon 64 3000+ which will hopefully perform a little better, and switch the mobo to one with an additional four SATA ports allowing me to still grow without retiring working HDDS.
The Question
My question is what is the simplest most effective method to convert this system to 64bit entirely?
The Tentative Plan
The FAQ quite specifically states that "emerge -e world" will NOT work. So my intention is to build a new chroot 64bit environment on another 64bit machine. In this environment, I'll follow the standard install, emerge -e world, then emerge all the needed packages, finally replace the config files with the known working versions from the live server. Once this is done, I shall test by booting the chroot via NFS in VMWARE, which will hopefully will allow me to fix most problems before I finally copy the entire chroot onto the existing box's /
Any advice or relevant experiences? Please share! Remember the goal is to guarantee that the chroot is as close as possible to a config that will work on the server, thus incurring minimal downtime. _________________
"Misanthropy 2.0 - why be racist in the digital age?" - Dave Bell
http://xs.mw
|
|
| Back to top |
|
 |
juhah n00b

Joined: 03 Oct 2004 Posts: 46
|
Posted: Thu Apr 27, 2006 9:27 pm Post subject: Re: x86 32bit to 64bit server conversion - tips? experiences |
|
|
Lets hope that the raid/lvm/ext3 (or what ever file system you have) is 64bit friendly.
How I would do it:
[list=]
[*] Create backup of all valuable data
[*] Make clean install
[*] Restore backups
[/list]
Your plan of making clean install in chroot and by testing in vmware sounds good.
I would not recommend copying of chroot into server's / by overwriting existing files. Format / and /usr and others before copying of chroot. Having 32bit libs and binaries lying around doesn't sound good. |
|
| Back to top |
|
 |
MrUlterior Guru

Joined: 22 Mar 2005 Posts: 503 Location: Switzerland
|
Posted: Fri Apr 28, 2006 7:55 am Post subject: Re: x86 32bit to 64bit server conversion - tips? experiences |
|
|
| juhah wrote: | Lets hope that the raid/lvm/ext3 (or what ever file system you have) is 64bit friendly.
|
Ext3 & software RAID (mdadm) definitely work in 64bit as I have other machines in similar setups. Is there any reason why LVM wouldn't work similarly?
| juhah wrote: | | I would not recommend copying of chroot into server's / by overwriting existing files. Format / and /usr and others before copying of chroot. Having 32bit libs and binaries lying around doesn't sound good. |
Yep, I intend to format / _________________
"Misanthropy 2.0 - why be racist in the digital age?" - Dave Bell
http://xs.mw
|
|
| Back to top |
|
 |
tkdfighter Apprentice


Joined: 14 May 2004 Posts: 271 Location: Bludenz, Austria
|
Posted: Fri Apr 28, 2006 12:17 pm Post subject: |
|
|
Well, I've done this before:
First, pretend you are installing Gentoo from scratch. Do a stage 3 install.
Then, copy over your world file, /etc and whatever else you need (/home, /root, ...).
emerge -e world
Done. |
|
| Back to top |
|
 |
MrUlterior Guru

Joined: 22 Mar 2005 Posts: 503 Location: Switzerland
|
Posted: Mon May 01, 2006 2:49 pm Post subject: |
|
|
| tkdfighter wrote: | Well, I've done this before:
First, pretend you are installing Gentoo from scratch. Do a stage 3 install.
Then, copy over your world file, /etc and whatever else you need (/home, /root, ...).
emerge -e world
Done. |
Thanks, I'm going to be attempting this over the next two days & will post updates. _________________
"Misanthropy 2.0 - why be racist in the digital age?" - Dave Bell
http://xs.mw
|
|
| Back to top |
|
 |
gian Apprentice


Joined: 26 Jul 2004 Posts: 212 Location: Europe
|
Posted: Wed May 10, 2006 8:19 am Post subject: |
|
|
I had exact same problem, i.e. the "sizeof" message while emerging glibc.
I tryied
gcc-config -l
and found I was not running the latest profile. Changing to the latest installed gcc compiler solved the problem (obviously sourcing /etc/profile in the shell I was using to emerge glibc). I'm not sure the problem wa with the compiler, or, simply, the system needed those nice little operations that are prformed when you change a gcc profile. |
|
| Back to top |
|
 |
Corona688 Veteran


Joined: 10 Jan 2004 Posts: 1204
|
Posted: Wed May 10, 2006 2:16 pm Post subject: |
|
|
| tkdfighter wrote: | Well, I've done this before:
First, pretend you are installing Gentoo from scratch. Do a stage 3 install.
Then, copy over your world file, /etc and whatever else you need (/home, /root, ...).
emerge -e world
Done. | Could you give a little more detail on this please? This sounds very useful. _________________ Petition for Better 64-bit ATI Drivers - Sign Here
http://www.petitiononline.com/atipet/petition.html |
|
| Back to top |
|
 |
tkdfighter Apprentice


Joined: 14 May 2004 Posts: 271 Location: Bludenz, Austria
|
Posted: Thu May 11, 2006 12:34 pm Post subject: |
|
|
Well, I actually wanted to copy over gcc and glibc from a stage3 at first to go from no-multilib to multilib, but I kind of messed that up, bad.
Then I thought: what's the best and quickest way to reinstall my Gentoo, without having to emerge all my programs manually and moving my data around? So I came up with this solution: install Gentoo anew and copy over my world file. Be careful to not mount /home and to backup /etc before attempting this. I did not backup /etc until it was too late, having overwritten some important files (fstab, ...).
Here's the procedure I would use if I had to do it a second time:
| Code: |
su -
mkdir /home/backup
bu=!$ # set environment variable to /home/backup when using sh or bash
cp -p /var/lib/portage/world $bu
tar -zcpvf $bu/etc.tar.gz /etc
tar -zcpvf $bu/portage -X /usr/portage/distfiles/* /usr/portage
tar -zcpvf $bu/other.tar.gz /usr/share/icons /usr/scripts /usr/src /mnt # backup other stuff (icons, self-made scripts, mnt directories used by ivman, ...)
# insert Gentoo LiveCD
reboot
# issue all commands to get LiveCD up and running with networking support for internet
rdisk=/dev/sda5; rdir=/mnt/gentoo
mke2fs -j $rdisk
tune2fs -O dir_index $rdisk
tune2fs -O has_journal -o journal_data $rdisk
mount $rdisk $rdir
# do the above for /, /usr and /opt
#mount /tmp and /var
cd $rdir
rm -rf $rdir/var/db/pkg # delete installed package library so it doesn't conflict with the new one
wget http://gentoo.inode.at/releases/amd64/current/stages/stage3-amd64-2006.0.tar.bz2
wget !$.DIGESTS
md5sum -c stage3-amd64-2006.0.tar.bz2.DIGESTS # if ok, do next, otherwise download again
tar -jxpvf stage3-amd64-2006.0.tar.bz2
cp -L /etc/resolv.conf $rdir/etc/resolv.conf
mount -t proc none $rdir/proc
mount -o bind /dev $rdir/dev
mount /dev/vg/home $rdir/home
tar -zxpvf $rdir/home/backup/etc.tar.gz $rdir/etc/make.conf $rdir/etc/portage
tar -zxpvf $rdir/home/portage.tar.gz . # do not emerge --sync! this way, you do not run into new problems and you can use your old config files
cp -p $rdir/home/backup/world $rdir/var/lib/portage/world
umount $rdir/home
chroot $rdir /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"
emerge -eav system # optional, as these packages are installed in world too. This way, you build your world with the latest and greatest toolchain, though.
for x in $(cat /var/lib/portage/world); do emerge -pv $x; done | grep block # search for blocking packages so you can emerge -C the blockers
for x in $(cat /var/lib/portage/world); do emerge -v $x; if ($? != 0); then break; fi; done # emerge all packages in world and stop loop if emerge fails
# go to sleep or do something
mount /dev/hdxy /home
tar -zxpvf /home/backup/etc.tar.gz
dispatch-conf
tar -zxpvf /home/other.tar.gz .
umount /home
exit
reboot
# welcome to your fresh Gentoo install!
rm -r /home/backup
|
Please take notice that I have seperate partitions for /, /home, /usr, /opt, /tmp, /var and /boot. Also, I use lvm2.
I hope this is helpful.
edit: added optional emerge -e system. Thanks for the suggestion, juhah!
edit 2: fixed some wrong commands ... I'm using my own guide right now because I unluckily b00rked my toolchain once again
edit 3: ran into some unexpected problems. Fixed all of them, I hope.
Last edited by tkdfighter on Tue Jun 06, 2006 7:12 pm; edited 3 times in total |
|
| Back to top |
|
 |
juhah n00b

Joined: 03 Oct 2004 Posts: 46
|
Posted: Fri May 12, 2006 5:44 pm Post subject: |
|
|
| tkdfighter wrote: |
| Code: |
...
export PS1="(chroot) $PS1"
emerge -e world
# go to sleep or do something
...
|
|
It might be a good idea to execute 'emerge -e system' before the 'emerge -e world'. |
|
| Back to top |
|
 |
gentuse Tux's lil' helper

Joined: 15 Aug 2002 Posts: 75 Location: Seattle
|
Posted: Tue Jun 13, 2006 9:26 pm Post subject: |
|
|
| Quote: | | Since the 2nd CPU died, the first is pretty much taxed to its limits 24/7 (Load average 6 - 10 depending on the time of day) |
Have you completed your upgrade? What are the results? Is the Athlon64 handling the load? |
|
| Back to top |
|
 |
MrUlterior Guru

Joined: 22 Mar 2005 Posts: 503 Location: Switzerland
|
Posted: Wed Jun 14, 2006 12:25 pm Post subject: |
|
|
| gentuse wrote: | | Quote: | | Since the 2nd CPU died, the first is pretty much taxed to its limits 24/7 (Load average 6 - 10 depending on the time of day) |
Have you completed your upgrade? What are the results? Is the Athlon64 handling the load? |
Yep all done:
| Code: | # uname -a
Linux xenophobe 2.6.16-gentoo-r7-x2 #2 SMP Sun Jun 4 16:23:10 CEST 2006 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ GNU/Linux
# w
14:22:05 up 4 days, 23:21, 4 users, load average: 1.65, 2.20, 3.58
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md/0 9.4G 3.5G 5.5G 39% /
udev 1006M 304K 1006M 1% /dev
/dev/mapper/vg-portage
4.0G 968M 3.1G 24% /usr/portage
/dev/mapper/vg-data 1011G 724G 287G 72% /mnt/data
shm 1006M 0 1006M 0% /dev/shm
//chiark/mp3 90G 39G 51G 44% /mnt/data/music/ftp
|
The load stays between 1.5 - 2.5 during most "normal" activity (eg. excluding during compiles), the services all respond much better over the LAN, the RAID seems much more responsive (I took the opportunity to remove all non-SATA drives) now my LVM (1011G) gives between 40 - 50mb/sec sustained throughput.
I'd post more detail, but I've a broken hand -- so typing isn't fun at all
EDIT: I forgot to mention, that the new CPU is an Athlon x64 dual core 3800 and not the single-core 3000+ I mentioned initially _________________
"Misanthropy 2.0 - why be racist in the digital age?" - Dave Bell
http://xs.mw
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|