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