# Migration suggestions...

## snakeo2

Hi guys,

I've recently completed building a new system and I'm now ready to migrate Gentoo to my new box. My current set up consists of a dual boot (separeate drives) XP/Gentoo running on an AMD X2 dual core cpu. My new system consists of:

Gigabyte GA-MA790X-UDP

AMD Quad Core Phenom Black edition

4GB of Corsair PC-8500 Dual Channel ram

1TB Hitachi Sata 3.0 drive

Sata DVD burner. 

The system is up and running right now with XP. So my question is do I simply plug the drive (sata 3.0) where gentoo currently resides, plug into sata channel 1, since the Hitachi drive is on sata channel 0, re-install grub on the hitachi drive, edit grub.conf so it points to the XP drive...rebuld my entire system with the appropriate cflags, ...am I missing something or do you have better recommendations? Thanks in advance.

----------

## USTruck

Hello

Just 1 month late, I migrate from athlon 64x2 to phenom x4 920.

Finaly I install new version from x86 to amd64.

First stage, I put a disk, boot from livecd x86, chroot gentoo install and recompile kernel (new hardware !!!), verify grub.conf and re-install loader on disk0.

After first boot ..... everthing works (yeah), and my gentoo see 8GB.

Attention : if you set -mtune=native -march=native on your previous install, probably you don't get a system ready.

Attention under x86 with pae bios it's work, select memory size over 4gb for kernel 

Verify your BIOS settings option like "Remap memory'. Normaly, under x86 a bios put some information around 4GB of ram when present.

Due that, all memory upper 4GB aren't view by linux. With 'Remap memory' a bios change memory allocation (I don't know how but I know it's work)

After some test and work, I re-install from fresh amd64 version.

Total time to install (livecd, stage 3, reboot, change some settings and stage1 to stage3, install all applications needed, reboot) = 18 hour include openoffice (1h45).

With your black edition ... probably 1 or 2 hour less.

How free space have you on 1TB drive ?

Personnal, I create 4 partition of 40GB reserved for gentoo install. I have one stable (I work with it) and 3 reserve to install another for test (or to install another distribution to know). 

Attention UNDER AMD64 KDE4 are released !!!!

About cflags : I use -mtune=barcelona -march=barcelona

emerge -e system and emerge -e world to recompile all with correct set if you need same system version.

Do not miss to backup your /home and some personal settings (/etc/xx.conf)

Edit : I reread your post, put only one video first, get first system ready before work on dual video card.

----------

## snakeo2

USTruck,

Thanks and congratulation on the migration. I'm not sure I follow, so let me rephrase what you wrote to make sure I understood your suggestions. First, I should mention that I already have gentoo 64bit currently running on a separate sata drive which is part of a dual boot system. Now back to my new system which is already running with XP on  the 1TB hitachi drive....I should take the drive where gentoo resides, plug it into sata channel 1, boot off the latest live gentoo 64, chroot into my system and recompiled everything. Once that is done re-install grub again and make sure grub.con points to right places? 

I dont understand why you recommend to do a clean isntall of gentoo 64? I dont want to do a clean install...I want to migrate my existing system to it's compatitable with my new hardware. Thanks for the help.

----------

## USTruck

Hello,

Sorry, I have very bad english.

You have all ready amd64 system.

Put your gentoo disk on sata1, boot on livecd, chroot gentoo install, recompile kernel to get new config of hardware (chipset, audio, processor, ...), modify/verify grub.conf, set grub loader and reboot.

Recompile entire system only if you require change of -mtune and -march settings of cflag

I spoke about amd64 and fresh install because my old hardware not support amd64 and i'm forced to use x86.

----------

## snakeo2

Ok, I've never done this type of migration so I'm a little hesitant as I dont want to mess things up. After chrooting into my system I'm guessing I  have to emerge the latest gentoo-vanilla sources as I'm almost positive the ones I have now dont have an option for the amd quad core cpus. So this is what I'm planning to do

chroot into my box

emerge gentoo-vanilla sources

recompile the new kernel

emerge ati drivers as I"m switching from nividia to ati

copy the new arch_86_64 image to /boot/grub/

rebuild the entire system

One question, would i have to re-emerge grub since I added a new hardrive where xp is now?

----------

## Hu

 *snakeo2 wrote:*   

> Ok, I've never done this type of migration so I'm a little hesitant as I dont want to mess things up. After chrooting into my system I'm guessing I  have to emerge the latest gentoo-vanilla sources as I'm almost positive the ones I have now dont have an option for the amd quad core cpus.

 

Linux has had SMP support for a long time.  You probably need to reconfigure the kernel to match your new hardware, but a source upgrade is not required.  I would recommend it though, since you have the opportunity to do so in a fairly safe manner.

 *snakeo2 wrote:*   

> rebuild the entire system

 

This is probably not necessary.

 *snakeo2 wrote:*   

> One question, would i have to re-emerge grub since I added a new hardrive where xp is now?

 

No, but you might need to reinstall it into the MBR.  Try without it first and see what happens.  If it fails, go back to the CD environment and fix it.  If you intend to dual-boot via the grub in the MBR, read the grub documentation first.  There are some quirks associated with booting Microsoft systems via grub.

----------

## snakeo2

Hu,

Thanks for the great tips. However, I'm quickly realizing that this may take more work than anticipated. In my old box my hdd's set up was a follows:

/dev/hda ===>XP

/dev/sda===> gentoo

So whenever I had to work/altered gentoo, I knew I had mount the partitions I created using the mount /dev/sda format....however, I just read that "even IDE drives are labeled /dev/sd* with the new libata framework in the kernel" which may make things a little not so clear. Now my motherboard on the new system comes with 6 onboard sata controllers, four by AMD & 2 by Gigabyte.  As of now, the one and only sata HDD (Where windows currently resides) is connected to sata controller " 0 ". I will be connecting the HDD where gentoo to sata controller "1". This of course makes me realize that I will have to edit my fstab file since all the devices on that file reference /dev/sda which should now be /dev/sdb since it will be on controller 1. It also means making edits to my grub.conf file to make sure it points to the right device. Pardon my ignorance, but is there a command that can provide all HDD installed and their correct nomenclature? I'm guessing that if:

hdd1 is connected to sata controller " 0 " = /dev/sda

hdd2 is connected to sata controller "1" = /dev/sdb

hdd3 is connected to sata controller "2" =/dev/sdc.....so on and so forth.

Does this make sense or am I completely out of the loop? thanks.

----------

## DaggyStyle

 *snakeo2 wrote:*   

> Hu,
> 
> Thanks for the great tips. However, I'm quickly realizing that this may take more work than anticipated. In my old box my hdd's set up was a follows:
> 
> /dev/hda ===>XP
> ...

 

plug both of the hds and boot the gentoo latest net install disk, you will be able to see all hds ie the sata manner, you can use fdisk -l to findout which is which (hint, look at the fs type) chroot to the gentoo partition, edit fstab according to the new layout, reconfigure the kernel, recompile and install it to /boot. don't forget to change the MAKEOPT to -j5.

resetup grub on the main hd (remember the right locations) and reboot, that should do the trick.

----------

## snakeo2

Thanks for the tip. I have the 2007 live cd gentoo....that should do the trick as well right? If not, I'll go ahead and download the graphic install dvd, I did however did that the GUI install dvd had lots of issues a while back, not sure if those issues are still present.

----------

## DaggyStyle

 *snakeo2 wrote:*   

> Thanks for the tip. I have the 2007 live cd gentoo....that should do the trick as well right? If not, I'll go ahead and download the graphic install dvd, I did however did that the GUI install dvd had lots of issues a while back, not sure if those issues are still present.

 

the gui installer is crap, you get the latest netinstall to be on the safe side, if you must have a gui, get the live dvd that was published for the 10 years gentoo birthday

----------

## honeymak

if ur kernel options are NOT too strict when u played with ur old machine

then u may just try to plug it in

and see if it boots or oops

voila   :Laughing: 

if so, just try to figure out the drive symbol, i mean sdX or etc

then play little bit with grub.conf

may not need to re-install grub in mbr if u find out how+why ^_^

----------

## snakeo2

Ok, whenever I try to download the gentoo live 10 dvd, it crashes and after booting with gentoo live 2007, the x server crashes and i can only get to the shell. I now have 3 hdds connected in the following manner:

/dev/hda ====xp

dev/sdx====>windows 7

/dev/sdax====> gentoo.

I went ahead and issued "fdisk -l" to get the correct labels for the hard drives, fdisk only recognizes /dev/hda which is where xp is. It does not see the other two hard drives. i tried 

fdisk /dev/sda

fdisk /dev/sdb

fdisk /dev/sdc

fdisk /dev/sde...etc.. and i get the following "unable to open /dev/sdax"....any ideas? In the mean time im downloading the gentoo live 10 dvd...

----------

## snakeo2

I downloaded pclinux live cd and was able to boot. At first i was getting all kinds of errors and complains, so i went ahead and shut the power to the hdd where xp resides and rebooted with only the two sata drives powered on (one for windows 7 & one for gentoo) and booted without any problems. Im guessing since i installed grub on the drive where xp resides, it cant read the partition table, not sure if that makes sense. Although I'm planning to migrate to windows 7, im still not ready to do so i need to find a way to have a triple boot. here is the output of fdisk -l

fdisk -l

Disk /dev/sda: 251.0 GB, 251000193024 bytes

255 heads, 63 sectors/track, 30515 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x516b516b

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          31      248976   83  Linux

/dev/sda2              32         135      835380   82  Linux swap / Solaris

/dev/sda3             136        6823    53721360   83  Linux

/dev/sda4            6824       30515   190305990    5  Extended

/dev/sda5            6824       15334    68364576   83  Linux

/dev/sda6           15335       26277    87899616   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdb: 1000.2 GB, 1000203804160 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0xeb385719

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   *           1          13      102400    7  HPFS/NTFS

Partition 1 does not end on cylinder boundary.

/dev/sdb2              13       42070   337817600    7  HPFS/NTFS

so i know gentoo is on /dev/sda & windows 7 is on /dev/sdb. is it possible to go ahead and try to get a dual boot with windows 7 & gentoo and add xp later ?

----------

## snakeo2

One more question, does it matter that gentoo is on sda & windows on sdb? or do i need to switch windows to sda & gentoo to sdb ? thanks in advance.

----------

## pappy_mcfae

My experience is that Windoze drives are very pissy, and always want to be the first in a string of drives, especially when talking about dual boot scenarios. Two out of three of my dual-booters have the Windoze drive as the primary drive, even though both installs were originally Gentoo only. The other one, this machine, has Windoze on the primary partition (/dev/sda1). 

Blessed be!

Pappy

----------

## honeymak

try booting plain with ur gentoo only disk 1st (for this part, remove the win disk)

then put ur gentoo disk in 1st available slot, then win the 2nd

then let grub handle ur windows boot by editing grub.conf

if this not a success, i bet ur board bios has some non-std stuff in it.......

just like mine in gigabyte......that's bad......

u have to put win disk in 1st, then gentoo 2nd

then install grub mbr part in 1st disk and use grub to handle win boot

but this is dangerous.......coz u may not hv 2nd chance.......  :Cool: 

----------

## snakeo2

Ok, I think I'm making some progress now. I went ahead and downloaded the minimal 2009 live cd and rebooted my machine. I was able to chroot into my existing environment. I then issued fdisk -l to get the correct labeling of my three drives and they are labeled as follows:

/dev/hda ==> xp

/dev/sda===> windows 7

dev/sdb====> gentoo.

I went ahead and made edits to my fstab file to that it now reads

/dev/sdb1  /boot (instead of /dev/sda1) as it previously read

dev/sdb2  /swap

dev/sdb3  /root

/dev/sdb4 /extended

/dev/sdb5 /home

/dev/sdb6 /virtualbox

I also made edits to my grub.conf file and unless I misunderstood grub labels drives in the following manner

the first drive is hd0

second drive is hd1

third drive is hd2

in my case (hd0,0) is xp

(hd1,0) windows 7

(hd2,0) /boot

now i didnt re-installed grub or recompiled the kernel, i simply wanted to see if that would enough to be able to boot into any of those OS....I rebooted and im greeted by grub, however is fuzzy and lines going across....i can see the choice of either xp and a few entries i had for gentoo corresponding to several kernels i compiled over the years. However, when i try to boot into xp or gentoo...it crashes and because the screen is not legible it's hard to post the exact error. I wish i had the live dvd so i can use the shell and copy & paste my files, but everytime i tried to download it....it crashed. any suggestions?

----------

## snakeo2

i have some doubts that i would like to clear...

"resetup grub on the main hd" someone was kind enough to suggest I do this on the posts above. In the past this was a no brainer and there were only ide devices. Now that we have sata and ide, my question is which one is considered the main? is it /hda or /sda?

I have both so I'm not sure which one to reset grub on......thanks for all the help.

----------

## honeymak

there is NO strict listing for this

becoz bios AND kernel options can interfere with the device listing sequence

the thing u can do is to "tab" inside grub and guess by the partition type pattern listing

u will know if the disk is win or linux by that list >.^

----------

## pappy_mcfae

 *snakeo2 wrote:*   

> i have some doubts that i would like to clear...
> 
> "resetup grub on the main hd" someone was kind enough to suggest I do this on the posts above. In the past this was a no brainer and there were only ide devices. Now that we have sata and ide, my question is which one is considered the main? is it /hda or /sda?
> 
> I have both so I'm not sure which one to reset grub on......thanks for all the help.

 

If you set up using the SATA (libata) drivers, you will wind up with /dev/sd(x). If you set up ATA/ATAPI/MFM/RLL drivers, you'll wind up with /dev/hd(x).

Blessed be!

Pappy

----------

## snakeo2

My saga continues....so I went ahead and connected my drives similar to what i had on my dualboot, that being

xp /dev/hda

windows 7 /dev/sda

gentoo /dev/sdb

edit my ftab to reflect changes on mentoo mount points from sda to sdb.....edit my grub.conf file and tried rebooting without re-installing grub to see how far i would get...well im now getting grub error 17 which i know it means there is something wrong with my grub.conf file. Here is my grub.conf

title=Gentoo-Server-2.6.26

root (hd2,0) since gentoo is on drive sdb 

kernel /boot/kernel-2.6.26-gentoo-r3     root=/dev/sdb3

title= windows xp

rootnoverify (hd0,0)

makeactive

chainloader (hd0,0)+1

title = windows 7

rootnoverify (hd1,0)

makeactive

chainloader(hd1,1)+1

any suggestions?

----------

## pappy_mcfae

You would have to issue the command grub-install to make sure you get the boot loader on the boot drive.

Blessed be!

Pappy

----------

## snakeo2

thanks pappy_face,

I just went ahead and emerged grub, everything seemed to have gone ok, but I got one error about being "unable to calculate the linux kernel version". I also ran into a similar issue when i tried to recompiled the kernel. Whenever i issued "make menuconfig" i get the following error:

"make:****No rule to make target 'menuconfig'. Stop. "However, when I run ls -l /usr/src/linux it points to :

lrwxrwxrwx 1 root root 22 Nov 30 2008 /usr/src/linux -> linux-2.6.26-gentoo-r3

----------

## snakeo2

I have another question, when setting up a dual boot where gentoo is on the second drive, when you get to the point of installing grub, can someone confirm that grub needs to be installed on the second drive where gentoo is being set up and not the first drive which is where windows is? thanks.

----------

## pappy_mcfae

 *snakeo2 wrote:*   

> thanks pappy_face,
> 
> I just went ahead and emerged grub, everything seemed to have gone ok, but I got one error about being "unable to calculate the linux kernel version". I also ran into a similar issue when i tried to recompiled the kernel. Whenever i issued "make menuconfig" i get the following error:
> 
> "make:****No rule to make target 'menuconfig'. Stop. "However, when I run ls -l /usr/src/linux it points to :
> ...

 

If you get a "no rule" error, you are not in the kernel source directory. You need to cd directly to the kernel source directory. Don't assume that the directory to which /usr/src/linux points is there, or is workable. Considering you getting that message, one or the other scenarios is in play here.

Blessed be!

Pappy

----------

