BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Tue Mar 04, 2008 5:37 pm Post subject: |
|
|
Boot a livecd on the target system and get networking and sshd up, fdisk, format, and mount partitions to /mnt/gentoo.
On the source system, mount your /boot partition, do "mount -o bind / /mnt/gentoo", "mount -o bind /boot /mnt/gentoo/boot", then run:
Code: | cd /mnt/gentoo; tar -cvz . | ssh target-system "cd /mnt/gentoo; tar -xzp" |
The bind mounting is the important step lots of people miss, since otherwise you end up copying the contents of udev's /dev, /proc, and /sys to the target, which you won't want. Bind mounting will only pick up the filesystem at its root and not things mounted under it.
Optionally you can remove the -z's from the tar commands if you'd prefer faster copying over effecient network use. Using one command line to clone a machine over a network? Yeah, just try that in Windows...
As a cautionary note, I've had a bizarre issue with KDE when doing this - it won't want to show the desktop contents after logging in. I'm not sure if it's a permissions problem or what, but after I emerge some things (probably baselayout), the problem goes away. It's strange because permissions and everything should be preserved properly...
After things are copied, you just have to install grub, change relevant config files (/etc/fstab, /etc/conf.d/net, etc) and you should be good to go. |
|