[aklug] Re: Ghosting a set up.

From: Shane R. Spencer <shane@bogomip.com>
Date: Thu Mar 19 2009 - 15:09:24 AKDT

If you plan on moving ext3 to the spare 40 gig drive then you can use
quite a few tools to get the job done as a "ghost". You can boot from
the ubuntu desktop cd itself and use parted to copy the data from one
devices partition to another drive.
...
(parted) cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER
...

So in this case you would boot a live CD using linux and make a new swap
and ext3 partition on /dev/sdb (your spare 40 gig drive).

parted is pretty straight forward.. the docs for it are well done IMHO.

then just issue a command 'cp /dev/sda 4 2' if /dev/sda4 is your
original filesystems partition and /dev/sdb2 is your destination partition.

You can also use this approach:

booting from your livecd, install resize2fs if it is not already installed.

Use parted or fdisk to partition /dev/sdb how you want it partitioned
then run 'sfdisk -uS -l /dev/sdb' and it shuold print out the sector
count per partition. Lets assume its 123456789 sectors large and the
source partition is /dev/sda4.

using 'resize2fs /dev/sda4 123456789s'

Then you can simply run 'dd if=/dev/sda4 of=/dev/sda2'

Sorry for the crazy instructions.

Once you're done with that use 'mkswap' on the partition for the swap.
Then mount /dev/sda2 to /mnt and type 'chroot /mnt'.

Open up a new terminal and type 'sudo blkid' and look for the partition
containing your swap partition. Use that UUID in /etc/fstab for the
line pertaining to your swap. and finally change the UUID of the old
partition in the new terminal by using 'tune2fs -U random /dev/sda4' to
generate a new one. Make sure you also "mount -o bind /dev/ /mnt/dev/"
for the next step.

Now you just have to change the grub settings in
/mnt/boot/grub/menu.list to reflect the correct drive where linux AND
the grub bootloader is located.. then run "grub-install /dev/sda" to
update it's references to disk data. You may have had to 'mount /proc/'
in the chroot.

Then cleanly shut down the computer and it may.. if you had your toes
crossed.. work.

You can always learn how to use tar to do this :) It can retain all the
info and give you a nice fresh new filesystem to work off of.
http://ubuntuforums.org/showthread.php?t=371001

You just need to update the old partitions with a new UUID and update
the new partitions with the old UUID's.. or modify /boot/grub/menu.list
and /etc/fstab to reflect the new partitions.

Good day sir!

Shane

Scott Carnahan wrote:
> No, I was going ot leave it as is. I can if I need to, but don't have to
> do so.
>
> oh! some one said just use "dd". What is "dd"?
>
> Scott
>
>
> Quoting "Shane R. Spencer" <shane@bogomip.com>:
>
>> Are you going to be doing any repartitioning before you move the data
>> around?
>>
>> Scott Carnahan wrote:
>>> No. I have 4 partitions on the disk, a 40 gig ntfs, a 40 gig ext3, a
>>> 4 =20
>>> gig swap and a 40 gig unformated but partitioned.
>>>
>>> Quoting "Shane R. Spencer" <shane@bogomip.com>:
>>>
>>>> Do you have to repartition before you attempt this?
>>>> Scott Carnahan wrote:
>>>>> I have 8.04.2 installed on a partition and am dual booting (grub). How
>>>>> do I make a ghost image and set it up on a third partition? I can do a
>>>>> full install from scratch, but would like to be able to ghost it over
>>>>> to save time and bandwidth on the download.
>>>>>
>>>>> Thanks
>>>>>
>>>>> Scott
>>>>>
>>>>> ---------
>>>>> To unsubscribe, send email to <aklug-request@aklug.org>
>>>>> with 'unsubscribe' in the message body.
>>>>>
>>>>
>>>>
>>>> -- Attached file included as plaintext by Ecartis --
>>>> -- File: signature.asc
>>>> -- Desc: OpenPGP digital signature
>>>>
>>>> -----BEGIN PGP SIGNATURE-----
>>>> Version: GnuPG v1.4.9 (GNU/Linux)
>>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>>>
>>>> iEYEARECAAYFAknCwgkACgkQXK/vGhypreKgwgCePkVPq9tZ6MxphDxBJ/rzhovI
>>>> rkIAnRRWDedIkRoWJ190Q1Nah+6GCPtd
>>>> =3Dmq4B
>>>> -----END PGP SIGNATURE-----
>>>>
>>>>
>>>> ---------
>>>> To unsubscribe, send email to <aklug-request@aklug.org>
>>>> with 'unsubscribe' in the message body.
>>>>
>>>>
>>>
>>>
>>>
>>> ---------
>>> To unsubscribe, send email to <aklug-request@aklug.org>
>>> with 'unsubscribe' in the message body.
>>>
>>
>>
>>
>
>
>

-- Attached file included as plaintext by Ecartis --
-- File: signature.asc
-- Desc: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknC0KQACgkQXK/vGhypreIaOgCfWGISLhWT3bdujeq6UWZAYn8+
KWQAnickXRY/1R8+JwrnUblHA8LTJhNP
=ni6I
-----END PGP SIGNATURE-----

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu Mar 19 15:09:43 2009

This archive was generated by hypermail 2.1.8 : Thu Mar 19 2009 - 15:09:43 AKDT