# Copy Desktop Gentoo to my Laptop?

## sequalit

If I have a system compiled on my desktop, is it possible to copy all the files over to my laptop and it run correctly?

Both have same processor, but the laptop has one hard drive and the desktop has raid... would I have to just re'edit some config files to make it work correctly?

Just don't feel like recompiling gentoo for my laptop  :Razz:  but alas if i must i will

----------

## SiberianSniper

My gut feeling is that most things should work, although I'd recompile the kernel with a new config and make sure I looked at all of my /etc files again.  Make sure when you copy it that permissions are preserved (I like tar, as it does this automatically).  And I'd recommend copying the desktop hard drive from a boot CD so /proc, /sys, /dev, etc don't get filled up with things you might not want to transfer to the laptop.  And remember to run grub after everything is copied over.  I'm sure I've forgotten some important stuff, but I think you'll be able to figure it out.

----------

## sequalit

is there any way i can make a livedvd out of my desktop system, to make things easier to copy over?

----------

## chris.c.hogan

Making a livedvd from the desktop system isn't needed. The livecd is only suggested so you are not copying a live (active) operating system. It's certainly possible to copy a live system. However, extra steps are needed. It's just easier to use a livecd.

----------

## sequalit

ok, well how do i go about copying the files from my desktop to the laptop?

since my desktop is in raid configuration, it must be live to copy all the stuff...

I was thinking of just burning the whole thing to a dvd and copying the dvd to the harddrive while in a simple linux install on my laptop.

Would that work?

----------

## chris.c.hogan

Hardware or software RAID? I seem to recall Gentoo's install CDs support software RAID. It's been a while since I dug into the initrd on an install CD. I could be wrong.

Burning a DVD will work. Turn off everything but the shell and put it all in a tarball. Make sure to exclude /proc, /sys, and /dev. Then just follow the install manual on the laptop. Use your tarball instead of the stage tarball. I'm not sure it's needed, but I'd also use tar's --numeric-owner option.

How do I copy a live system? Connect both systems to a network switch. Boot the new system with a livecd. Start ssh on the new system. Use rsync to transfer the system.

On the old system:

```
rsync -az --exclude '/proc/' --exclude '/sys/' --numeric-ids --progress / newsystem:/
```

Replace newsystem with the ip address of the new system. Follow the install manual for things like grub.

----------

## sequalit

Okay, sounds fun !  :Smile:  thanks for your help...

I just don't feel like compiling KDE / OpenOffice and stuff for my laptop... took a few days on my desktop will take a week on my laptop

Again thank you for your help I appreciate it.

----------

## StarDragon

 *sequalit wrote:*   

> Both have same processor,

 

How can this be? Usually laptops have mobile processors that allow for CPU frequency scaling, desktop processors don't have this ability.

You are better off just installing from scratch. I think you will get better performance that way.

----------

## robdd

Hi sequalit - I've recently copied my laptop Gentoo installation onto a new desktop (both are x86-64 architecture, otherwise it wouldn't have worked). I use dump/restore, because dump knows about the ext2/ext3 filesystem and so doesn't try to back up the /proc directory and stuff - which happens if you naively try to use tar to back up the root partition. I think it's the quickest way to get a new box up and running, especially for me since I am still using slow old ADSL1. Once I have the individual partitions backed up I partition the target disk and restore the partition dumps onto that. Once you have a system that boots (obviously need to get grub into the MBR) you can then edit the kernel config to tailor for the new machine and re-compile. You'll need to emerge app-arch/dump first, and for partitioning the target system you'll need a live CD to boot off (unless you can mount the target disk on the source machine) - I have an old copy of Knoppix from a magazine that has dump/restore on it and usually just use that.

The only problem (and it may be a show-stopper) is what happens if the source disk is RAID ?  I would go ahead and "suck it and see" because it should be very quick to try.

To dump each partition:

```

dump -0 -v -f /work/dumps/root.dmp /

dump -0 -v -f /work/dumps/usr.dmp /usr

```

will do a level zero (i.e. full) dump of the partition. You'll need to find a partition with enough storage to hold the dump file, and it CAN'T be on the parition you're dumping. If you can mount the target disk on the same (source) machine you can even pipe the output of dump straight into restore, then go and have a cup of coffee. Otherwise using a USB drive to hold the dumps is easy (and you DO back up your filesystems regularly onto another drive, don't you   :Very Happy:  ).

To restore is similarly easy:

```

cd /mnt/new_root

restore -vrf /path_to_dump_file/root.dmp

mount -t ext3 /dev/whatever /mnt/new_root/usr

cd usr

restore -vrf /path_to_dump_file/usr.dmp

```

I like the "v" (verbose) switch on to see what's going on, but it runs faster without it.

Once you've got the new filesystems restored you'll need to get into the new /etc and edit fstab if you've moved partitons around. Apart from that you can boot off a grub floppy/CD, and then set up the new menu.conf and install grub. It *may* just work if on the new system you specify the "normal" un-RAIDed partition names, e.g. hdaX instead of mdX.

Please feel free to ask any questions about dump/restore, as I think it's a really easy way to copy systems around. But I prefer to use a partitioning of /, swap, /usr, and keep all my work & data files on /work, and use ext3 and *not* LVM. Once you start making things complicated it may not work so well - I'm a "keep it simple" person.

Regards, Rob

----------

## sequalit

Worked like a charm robdd, even with my desktop system being in a raid. THANKS!  :Smile: 

Now I don't have to wait a week to have Gentoo running on my laptop *grins*

used the livecd and external harddrive with no problems at all.

Thank you again Robdd, you saved me a whole lot of time and headache  :Smile: 

----------

## Jaglover

 *StarDragon wrote:*   

>  *sequalit wrote:*   Both have same processor, 
> 
> How can this be? Usually laptops have mobile processors that allow for CPU frequency scaling, desktop processors don't have this ability.
> 
> You are better off just installing from scratch. I think you will get better performance that way.

 

I agree.

Gentoo is a customized/hand-tailored Linux installation by definition. If you copy it to another platform/hardware it is not Gentoo any more. Gebuntu maybe.   :Razz: 

distcc shortens compilation times drastically.

----------

## sequalit

Isn't distcc for networked computers?

----------

## Jaglover

A NIC in both computers plus a crossover ethernet cable is all you need.

----------

## chris.c.hogan

 *Jaglover wrote:*   

>  *StarDragon wrote:*    *sequalit wrote:*   Both have same processor, 
> 
> How can this be? Usually laptops have mobile processors that allow for CPU frequency scaling, desktop processors don't have this ability.
> 
> You are better off just installing from scratch. I think you will get better performance that way. 
> ...

 

If the make.conf file is identical on both machines, what is the point of recompiling. All you are doing is wasting time to produce the exact same files.

Some things should be reconfigured and recompiled or added:

Kernel: The laptop will have features that the desktop most likely lacked (CPU frequency scaling, PCMCIA, battery module for ACPI, etc.). Go though your kernel configuration and add any new hardware capabilities.

HAL: You might want to add pcmcia to your USE flags

PCMCIA (PC Card): Emerge sys-apps/pcmciautils.

Video: How much did the video hardware change? Do you need to emerge a different X video driver?

For 99% of the programs and applications, nothing will change unless you are changing your CHOST or march= settings.

robdd: Cool, yet another method.  I hadn't considered dump/restore. Thanks for the info.

sequalit: Glad it worked out for you.

----------

## jcat

 *StarDragon wrote:*   

>  *sequalit wrote:*   Both have same processor, 
> 
> How can this be? Usually laptops have mobile processors that allow for CPU frequency scaling, desktop processors don't have this ability.
> 
> 

 

Although it's the norm to have a scaling cpu in a laptop, it's just a computer, the manufacturer can use whatever they see fit.  Same for Desktop, in fact you quite often get adjustable cpu's in desktops these days, and that makes cases of the the same cup more likely.

Cheers,

jcat

----------

## Jaglover

 *sequalit wrote:*   

> 
> 
> I just don't feel like compiling KDE / OpenOffice and stuff for my laptop... took a few days on my desktop will take a week on my laptop
> 
> 

 

Does this same processor mean they are both i686?

----------

## drescherjm

 *StarDragon wrote:*   

>  *sequalit wrote:*   Both have same processor, 
> 
> How can this be? Usually laptops have mobile processors that allow for CPU frequency scaling, desktop processors don't have this ability.

 

This used to be true but all of the x86 (32 or 64 bit) processors that are currently produced by AMD and Intel have frequency scaling regardless if they are desktop or notebook cpus.

 *Quote:*   

> For 99% of the programs and applications, nothing will change unless you are changing your CHOST or march= settings.

 

The use flags will have an impact on the build but if they are the same on both systems there is no point of a total rebuild.

----------

## sequalit

 *Quote:*   

> The use flags will have an impact on the build but if they are the same on both systems there is no point of a total rebuild.
> 
> 

 

/agree

No they are not the same, but If i compile everything for  i686, then itl work on any i686 computer... which worked like a charm  :Razz: 

I did have to redo the kernel to enable those settings, but most settings i had enabled without knowing, such as pcmcia lol..

----------

## Jaglover

 *sequalit wrote:*   

> 
> 
> No they are not the same, but If i compile everything for  i686, then itl work on any i686 computer... which worked like a charm 
> 
> I did have to redo the kernel to enable those settings, but most settings i had enabled without knowing, such as pcmcia lol..

 

Like charm, with -march=i686?   :Rolling Eyes:  So your desktop runs also Gebuntu?

----------

