On 12/27/2010 10:20 AM, Marc Blumentritt wrote:
Hi,
I have bought myself a Christmas present, a new shiny hard disk. Now I
want to copy my old Gentoo system to my new disk like this:
1.) boot with gentoo boot cd
2.) mount my old system ind /old ( / in one partition, /home, /usr,
/var, /tmp and /opt in lvm2 volumes and /boot on it's own partition)
3.) mount my new disk ind /new (just 2 partitions, 1 for / and 1 for /boot)
4.) copy from /old to /new
5.) modify fstab and prepare grub
6.) reboot
Concerning step 4: what is the best copy command?
I tried with
cp -a /old/* /new
This should have gotten the permissions right; -a implies
--preserve=all. Not sure what happened there.
The tar method you're looking for is:
tar -C /old cpf - | tar -C /new xvpf -
You'll probably not want to do the entire / in a single go,
since /proc, /sys, and /dev (at least) should be skipped.
Copy /old/sbin -> /new/sbin, etc. for all of the root
folders that aren't their own partitions. The rest you can
do the entire mount point at once, though I'm not sure you
really need to copy /tmp either.
You can also use rsync, dump/restore, and probably a dozen
other tools to make this work. Google for "backup entire
hard disk" and start reading :)
--Mike