PDA

View Full Version : how to clone whole 120 gb disk with alll partitions to a ne



Valent
04-07-2004, 12:36 AM
Hi, I have new 200 GB hdd and I would like to copy all partitions from old 120 GB one. I have mandrake, knoppix, fedora and slackware system partitions and few for storage (one ext3, one fat and one ntfs partition). How do I clone all this to new hdd with preserving system layout and it must work and boot as nothing changed!

Can I resize partitonsa on the fly, so when I copy one from old hdd to new one I define new size? Can I add extra space to one of the partitions or I can only add new partiton from extra 80 GB space?

arkaine23
04-07-2004, 12:50 AM
You should be able to use tar on each partition, and then stick them on new partitions on the new drive (provided you don't change anything). You can use different partition sizes, but the stuff from hda1 on the first drive will still need to be in hda1 on the second drive (or else you'll need to change /etc/fstab and probably your bootloader too)

And you'll want to reinstall the bootloader to the MBR ion the new drive once you've transferred everything.

To create tarballs-
tar -cpvzf filename.tgz /dir /dir /dir /dir


Untarring tarballs-

cd to new location for files
tar -xpvzf filename.tgz

I believe this is pretty standard useage for tar, though the -p option preserves permissions and timestamps.


You can do the same thing in one stroke with dd, but I'm not familiar with the syntax.

johnb
04-07-2004, 03:51 AM
Check out partimage. I recently started playing with it and it works great.
johnb