1 |
this way copies everything that is needed to make a system run. i'll make an |
2 |
example so that you can understand better: |
3 |
now you have |
4 |
/dev/hda1 as / |
5 |
/dev/hda2 as /boot |
6 |
/dev/hda3 as swap |
7 |
/dev/hda4 as /usr |
8 |
/dev/sda1 as /mnt/disk |
9 |
|
10 |
when you make cp -a with the system in run (all the partitions mounted |
11 |
right) you'll get a single partition in /mnt/disk that contains /, /boot and |
12 |
/usr. |
13 |
later on you aren't sattisfied with the partition table and decide to move |
14 |
to the following: |
15 |
/dev/hda1 /boot |
16 |
/dev/hda4 extended |
17 |
/dev/hda5 / |
18 |
/dev/hda6 /usr |
19 |
/dev/hda7 /var |
20 |
/dev/hda8 /tmp |
21 |
/dev/hda9 /opt |
22 |
/dev/hda10 swap |
23 |
/dev/hda11 /home |
24 |
|
25 |
all that you'll have to do is boot into some livecd and mount the drives in |
26 |
some directories (we'll assume in the /mnt) and then mount the external disk |
27 |
into /mnt/sda. |
28 |
now all that you have to do is do: |
29 |
cp -a /mnt/sda/var/* /mnt/var/ |
30 |
cp -a /mnt/sda/usr/* /mnt/usr/ |
31 |
. |
32 |
. |
33 |
. |
34 |
cp -a the dirs in their partitions and /etc /mnt /lib /sbin /bin /root /dev |
35 |
/include /media /mnt /share /sys on the new root partition (these need to be |
36 |
on the root partition otherwise you cannot boot). |
37 |
after recopying you go to /etc/fstab and point the new root and other |
38 |
partitions to the new location following the fstab example inside. |
39 |
then you only have to reinstall the bootloader. unmount all the partitions, |
40 |
remount the new root under /mnt/root, remount the new /boot into |
41 |
/mnt/root/boot and the others partitions in the /mnt/root/[partition] and |
42 |
the chroot into the new environment with |
43 |
chroot /mnt/root /bin/bash |
44 |
do a env-update && source /etc/profile |
45 |
then type grub |
46 |
you'll get the grub command line |
47 |
write root (hd0,0) |
48 |
then setup (hd0) |
49 |
quit |
50 |
then exit, unmount the partitions and reboot |
51 |
you'll be able to reboot into the old linux with the new partitioning. |
52 |
this was an example on how the cp -a helps you do a backup of the things |
53 |
that you have on disk and on how you can use it if you want to modify your |
54 |
partitioning. obviously, you can also just do a backup and then copy the |
55 |
stuff on a partition that doesn't boot anymore. |
56 |
if you change your partition table but you mantain the same hdd and don't |
57 |
change /boot partition then you don't need to reinstall grub, but only to |
58 |
repoint your /etc/fstab. |
59 |
this type of work is better than partimage's one since partimage can only |
60 |
backup a partition and recopy in the same way it was and you can only do it |
61 |
from partimage, while the cp -a stuff works independently from the linux |
62 |
version you're using and on whatever pc you have, since cp is a base linux |
63 |
command. |
64 |
|
65 |
|
66 |
2007/11/11, Herbert Laubner <laubner@×××.net>: |
67 |
> |
68 |
> Am Sonntag, 11. November 2007 14:31:46 schrieb Beso: |
69 |
> > there's no other way to do it for what i know since partimage won't run |
70 |
> on |
71 |
> > 64bits. |
72 |
> > there's another option: |
73 |
> > |
74 |
> > if you need a / backup take a disk (also an usb one) go to a shell and |
75 |
> then |
76 |
> > do a cp -a / /mnt/disk (assuming that the disk is mounted into |
77 |
> /mnt/disk) |
78 |
> > and after some time which depends on the stuff installed you'll have a |
79 |
> > mirror version of / on the other disk. if you want it to be compressed, |
80 |
> > then do a tar on the mounted disk and you'll have a compressed image of |
81 |
> > your / partition. |
82 |
> > then when you want to to copy it from the backup disk to the running |
83 |
> disk |
84 |
> > do again: cp -a and you'll have the / running as it was when you made |
85 |
> the |
86 |
> > backup. if you experience problems with running x then do |
87 |
> > chmod 777 /home -R && chmod 777 /tmp -r && chmod 777 |
88 |
> > /var/tmp/kdecache-[your username] and then x would run again. the |
89 |
> problem |
90 |
> > is that sometimes when doing the cp -a you can experience problems with |
91 |
> the |
92 |
> > permissions on these directories when not using root. |
93 |
> > |
94 |
> Will I get this way also the mbr and the file alloction table correct |
95 |
> copied? |
96 |
> -- |
97 |
> gentoo-amd64@g.o mailing list |
98 |
> |
99 |
> |
100 |
|
101 |
|
102 |
-- |
103 |
dott. ing. beso |