Cloning a Gentoo System

A quick reference guide for Akili and others

Cloning the filesystem is best done with rsync:

rsync -aHAXxv /mnt/src/ /mnt/dest

The trailing slash on the source will prevent it from making /mnt/dest/src/...

You may be tempted to dd if=/dev/sourcedrive of=/dev/targetdrive bs=446 count=1

Don't.

Boot into the system with a CD, and run the general following:

mount -t proc none /mnt/gentoo/proc

mount -o bind /dev /mnt/gentoo/dev

chroot /mnt/gentoo /bin/bash

grep -v rootfs /proc/mounts > /etc/mtab

grub-install --no-floppy --recheck /dev/sda

And while you are here, make sure that /etc/fstab matches the filesystem you are using on the destination drive, or you will be booting right back to the CD. Yes, this is experience talking.

That should do it.

GentooClone (last edited 2008-09-05 21:36:59 by akili)