Gentoo Archives: gentoo-amd64

From: Herbert Laubner <laubner@×××.net>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] partimage won't run on AMD64
Date: Sun, 11 Nov 2007 15:58:07
Message-Id: 200711111656.00602.laubner@gmx.net
In Reply to: Re: [gentoo-amd64] partimage won't run on AMD64 by Beso
1 Am Sonntag, 11. November 2007 16:45:31 schrieb Beso:
2 > this way copies everything that is needed to make a system run. i'll make
3 > an example so that you can understand better:
4 > now you have
5 > /dev/hda1 as /
6 > /dev/hda2 as /boot
7 > /dev/hda3 as swap
8 > /dev/hda4 as /usr
9 > /dev/sda1 as /mnt/disk
10 >
11 > when you make cp -a with the system in run (all the partitions mounted
12 > right) you'll get a single partition in /mnt/disk that contains /, /boot
13 > and /usr.
14 > later on you aren't sattisfied with the partition table and decide to move
15 > to the following:
16 > /dev/hda1 /boot
17 > /dev/hda4 extended
18 > /dev/hda5 /
19 > /dev/hda6 /usr
20 > /dev/hda7 /var
21 > /dev/hda8 /tmp
22 > /dev/hda9 /opt
23 > /dev/hda10 swap
24 > /dev/hda11 /home
25 >
26 > all that you'll have to do is boot into some livecd and mount the drives in
27 > some directories (we'll assume in the /mnt) and then mount the external
28 > disk into /mnt/sda.
29 > now all that you have to do is do:
30 > cp -a /mnt/sda/var/* /mnt/var/
31 > cp -a /mnt/sda/usr/* /mnt/usr/
32 > .
33 > .
34 > .
35 > cp -a the dirs in their partitions and /etc /mnt /lib /sbin /bin /root /dev
36 > /include /media /mnt /share /sys on the new root partition (these need to
37 > be on the root partition otherwise you cannot boot).
38 > after recopying you go to /etc/fstab and point the new root and other
39 > partitions to the new location following the fstab example inside.
40 > then you only have to reinstall the bootloader. unmount all the partitions,
41 > remount the new root under /mnt/root, remount the new /boot into
42 > /mnt/root/boot and the others partitions in the /mnt/root/[partition] and
43 > the chroot into the new environment with
44 > chroot /mnt/root /bin/bash
45 > do a env-update && source /etc/profile
46 > then type grub
47 > you'll get the grub command line
48 > write root (hd0,0)
49 > then setup (hd0)
50 > quit
51 > then exit, unmount the partitions and reboot
52 > you'll be able to reboot into the old linux with the new partitioning.
53 > this was an example on how the cp -a helps you do a backup of the things
54 > that you have on disk and on how you can use it if you want to modify your
55 > partitioning. obviously, you can also just do a backup and then copy the
56 > stuff on a partition that doesn't boot anymore.
57 > if you change your partition table but you mantain the same hdd and don't
58 > change /boot partition then you don't need to reinstall grub, but only to
59 > repoint your /etc/fstab.
60 > this type of work is better than partimage's one since partimage can only
61 > backup a partition and recopy in the same way it was and you can only do it
62 >
63 > >from partimage, while the cp -a stuff works independently from the linux
64 >
65 > version you're using and on whatever pc you have, since cp is a base linux
66 > command.
67 >
68
69
70 Thanks a lot!!
71
72 --
73 gentoo-amd64@g.o mailing list