Tech Support > Operating Systems > Linux / Variants > Clone HDD
Clone HDD
Posted by Kejpa on February 1st, 2004


Hi,
I've finally got my RH9 system to where I want it, now I'd like to move
it to another HDD. Is there a clone tool?
On my Win-computers I use Norton Ghost, I've tried to use it but I do't
get to GRUB Stage 2 with the cloned disc.

Any help appreciated!
/Kejpa

Posted by Andreas Janssen on February 1st, 2004


Hello

Kejpa (<kejpa@netscape.net>) wrote:

You could use partimage. Or you directly copy the partitions using dd.
Or you use cp. Or read the Hard Disk Upgrade Howto:
<http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/>

best regards
Andreas Janssen

--
Andreas Janssen
andreas.janssen@bigfoot.com
PGP-Key-ID: 0xDC801674
Registered Linux User #267976

Posted by Dances With Crows on February 1st, 2004


On Sun, 01 Feb 2004 21:39:44 +0200, Kejpa staggered into the Black Sun
and said:
http://partimage.org/ ? FWIW, Ghost doesn't grok ReiserFS and may not
handle ext3 properly. You *want* to be using ReiserFS or ext3 on your
system for obvious reasons.

Reinstalling GRUB is pretty bloody easy if that's all that's stopping
you.

0. Boot from a good rescue system (I like Gentoo's LiveCD, YMMV),
1. mount /dev/wherever_your_root_partition_is /mnt/somewhere
2. chroot /mnt/somewhere /bin/bash
3. grub
4. grub> root (hdX,Y)
(replace X and Y with GRUB device#s; hd0,0 is /dev/hda1, hd0,1 is
/dev/hda2, GRUB supports tab-completion...)
5. grub> setup (hd0)
(installs GRUB in the MBR, best place for it IMHO)
6. grub> quit
(remove rescue CD from drive)
7. shutdown -r now

....and enjoy.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / Hire me!
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume

Posted by at on February 2nd, 2004


On Sun, 01 Feb 2004 21:39:44 +0200, Kejpa <kejpa@netscape.net> wrote:

Been there - Done that!

Make it easy for yourself and visit www.storix.com and download their
"free" version of storix. It does EXACTLY what you are asking AND it
allows even writing to disks with different geometry.

Bob

Posted by root/administrator on February 2nd, 2004


Kejpa wrote:

If your hard drives are of the same size, you can duplicate your hard drive
using "dd".

--
root/administrator

Posted by John Bailo on February 2nd, 2004


Kadaitcha Man wrote:

You sure are smart for a tard.



--
*W '04* <:> Open Source <:> Open Competition

Posted by Kadaitcha Man on February 2nd, 2004


John Bailo wrote:
Compliment taken.

--
Kadaitcha Man: Registered Linux User #344402
Akhenaten: Registered Linux Machine #235500

--
Your Free Insult: Thou imbedding, immerging, irremediable gooney bird bricking weasel.


Posted by Kadaitcha Man on February 2nd, 2004


at Bob Mariotti wrote:
Apparently you haven't.

You stupid fucking cunt. Storix Personal Edition is free and the free
version only supports tape backup - nothing else. If you fucking well
bothered to read, the OP wants to move to another disk. He made no
mention of having a tape unit, you fuckwitted cuntbubble. He will need
the standalone admin version, which costs, wait for it, fucknuts, wait
for it... $U395.

--
Kadaitcha Man: Registered Linux User #344402
Akhenaten: Registered Linux Machine #235500

--
Your Free Insult: Thou deforcing, sledding, deprived agitationist disowning homo.


Posted by Yvan on February 2nd, 2004


Nedavno Andreas Janssen pise:

| > I've finally got my RH9 system to where I want it, now I'd like to
| > move it to another HDD. Is there a clone tool?
| > On my Win-computers I use Norton Ghost, I've tried to use it but I
| > do't get to GRUB Stage 2 with the cloned disc.

I do not see OP post (some problems with my ISP news server), so I am
replying here.

If you are using ext3, after Norton Ghost clones hdd partitions go back
to ext2, so you need to convert them to ext3 with
# tune2fs -j /dev/hdax
(at least that helped me once).

Better way IMHO is:

1. Partition the new hard disk in the SAME ORDER, such that, the device
names were the same. This way you do not have to edit or modify any
configuration files.

While running from the old hard disk, most of the setup and copying can
be performed. Only the last step, rewriting of the boot sector on the
new hard disk, needs to be done from the Linux Rescue mode.

2. Once partitioned, each partition must be "formatted" before mounting.
Don't forget disk label !!!

# mke2fs -c -j -L /boot /dev/hdc1


BE CAREFUL not to screw with any device from hdaX, since that's the old
hard disk we are copying from.

3. Now that each partition is formatted, each of these "file systems"
may be mounted under a mount point, and the content copied on to them.
Down server during this process, to minimize various daemons changing
the content of the old disk, during the copy.

$ shutdown now
$ mkdir /mnt/new
$ mount /dev/hdc2 /mnt/new

(if /dev/hda2 is mounted as / and new hard disk is partitioned in the
SAME ORDER)

Copying the old root from hda2 to hdc2 creates the other mount points
for: boot, usr, home and var.

$ cd /
$ find . -xdev | cpio -admpv /mnt/new


4. Repeat the process for the remaining file systems

$ mount /dev/hdc1 /mnt/new/boot
$ cd /boot
$ find . -xdev | cpio -admpv /mnt/new/boot
....


5. Shut down. Disconnect old hdd. Move new hdd from the secondary master
to the primary master (or whatever your case may be). Stuck in Red Hat
Linux Boot CD, and boot into "Linux rescue" mode.

$ mkdir /mnt/new
$ mount /dev/hda2 /mnt/new
$ mount /dev/hda1 /mnt/new/boot
$ cd /mnt/new
$ sbin/lilo -v -v -r /mnt/new
$ exit

Entering exit causes a reboot. Remove the Red Hat Linux Boot CD, and
allow it to boot from the new hdd.




--
___ ____
/__/ / \ ** Registrovani korisnik Linuksa #291606 **
/ / \/ /\ \ ** http://counter.li.org/ **
/__/\____/--\__\ ** Reply at: ivica - at - ptt - dot - yu **

Posted by Robert M. Stockmann on February 2nd, 2004


On Mon, 02 Feb 2004 06:31:54 +0000, John Bailo wrote:

"Migration of a Linux installation from a old to a new bigger disk." :
http://crashrecovery.org/CrashRecove...resize2fs.html

Robert
--
Robert M. Stockmann - RHCE
Network Engineer - UNIX/Linux Specialist
crashrecovery.org stock@stokkie.net


Posted by Dan Espen on February 3rd, 2004


root/administrator <root@dev.null.dnsalias.net,administrator@dev.null .dnsalias.net> writes:

Actually, I just went thru this a few days ago.

I used Ghost and got an unbootable Grub.

Then I did a little reading and saw that using "dd" was sorta problematic.
I had nothing to loose so I just did:

dd if=/dev/hda of=/dev/hdb

then removed the old 5G drive, changed the new 120G drive to the primary and
was on my way. No problems at all.

Posted by Kadaitcha Man on February 3rd, 2004


Dan Espen wrote:
Does that actually mean that the two drives do not need to be of the
same size?

--
Kadaitcha Man: Registered Linux User #344402
Akhenaten: Registered Linux Machine #235500

--
Your Free Insult: Thou wrying, furloughing, forty-second rate budgie killing snipe.




















Posted by Ermanno Sartori on February 3rd, 2004


Kadaitcha Man wrote:

1. connect the new one as slave.
2. create partitions as you like (don't forget swap) using fdisk
3. format them using mke2fs.jfs
4. format swap partition using dd if=/dev/zero of=/dev/....
5. mount destination partition in /mnt/temp
6. create image using dumpfs there.
7. boot from CD
8. mount new partition in mnt/temp
9. issue restore command to rebuild data structure
10. reboot from CD using root=/dev/... as parameter
11. lilo will terminate this operation making new disk bootable.

remember to change devices in /etc/fstab if you change from slave to master.


--
http://counter.li.org/cgi-bin/runscr...gi?user=180114
ICQ : 115909199
--



Similar Posts